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 (<http://www.chainpoint.org/>) 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 (<https://github.com/opentimestamps>).
Installation
$ 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()
3
>>> cp.get_merkle_root()
'7075152d03a5cd92104887b476862778ec0c87be5c2fa1c0a90f87c49fad6eff'
>>> cp.get_receipt(0, "e8b4177a30c8af5dd5f33adbc530e8970b593af1001b322c289e60b4ce395e13")
{'type': 'ChainpointSHA256v2', 'targetHash': 'ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb', 'anchors': [{'type': 'BTCOpReturn', 'sourceId': 'e8b4177a30c8af5dd5f33adbc530e8970b593af1001b322c289e60b4ce395e13'}], 'proof': [{'right': '3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d'}, {'right': '2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6'}], '@context': 'https://w3id.org/chainpoint/v2', '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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blockchain-proofs-0.2.1.tar.gz.
File metadata
- Download URL: blockchain-proofs-0.2.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4b7db3b5e8da0566acee2a376f7a6d40bfa679e7eba9bf9383f870ee8106f56
|
|
| MD5 |
46587d740cef9686a09bd2cd0f24b08b
|
|
| BLAKE2b-256 |
3f88f3f606a05e3e884d4500e4ba3561a77456127ca8500ed3f5e0beeedfbb3d
|
File details
Details for the file blockchain_proofs-0.2.1-py3-none-any.whl.
File metadata
- Download URL: blockchain_proofs-0.2.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8752d7ca67b9c12415d8653164791d056b625133388a9a99b6650c62cf106433
|
|
| MD5 |
963da05cd530ed292fcd9022813b7e08
|
|
| BLAKE2b-256 |
63ac656af6dd6bad38f527bfd29f55f086ef9e78bc21daadba318faf962ca28d
|