Skip to main content

Implements chainpoint v2 proof of existence approach

Project description

Implementation for generating and validating blockchain proofs/receipts (for proof of existence). Currently it offers support only for Chainpoint v2 (<>) but it can be easily extended.

Note that it also validates that the merkleRoot is properly stored in the blockchain (testnet or mainnet).

In the future the library may incorporate other approaches like OpenTimestamps (<>).


$ pip install blockchain-proofs

Example usage

$ python

>>> from blockchain_proofs import ChainPointV2
>>> leafs = ['a', 'b', 'c']
>>> cp = ChainPointV2()
>>> cp.add_leaf(leafs, True)
>>> cp.make_tree()
>>> cp.get_leaf_count()
>>> cp.get_merkle_root()
>>> cp.get_receipt(0, "e8b4177a30c8af5dd5f33adbc530e8970b593af1001b322c289e60b4ce395e13")
{'type': 'ChainpointSHA256v2', 'targetHash': 'ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb', 'anchors': [{'type': 'BTCOpReturn', 'sourceId': 'e8b4177a30c8af5dd5f33adbc530e8970b593af1001b322c289e60b4ce395e13'}], 'proof': [{'right': '3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d'}, {'right': '2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6'}], '@context': '', 'merkleRoot': '7075152d03a5cd92104887b476862778ec0c87be5c2fa1c0a90f87c49fad6eff'}

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blockchain-proofs-0.2.1.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

blockchain_proofs-0.2.1-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page