# pymerkletools
[](https://badge.fury.io/py/merkletools)
[](https://travis-ci.org/aliciawyy/pymerkletools)
[](https://codecov.io/gh/aliciawyy/pymerkletools)
[](https://codeclimate.com/github/aliciawyy/pymerkletools/maintainability)
This project is adapted from the [pymerkletools](https://github.com/aliciawyy/pymerkletools) of Tierion.
It includes a `MerkleTree` class for creating Merkle trees, generating merkle proofs, and verification of merkle proofs.
## Installation
```
pip install pymerkletree
```
## Examples
The source code is simple by itself and examples can be found in the folder `demo`.
## Notes
### About tree generation
1. Internally, leaves are stored as `bytearray`. When the tree is built, it is
generated by hashing together the `bytearray` values.
2. Lonely leaf nodes are promoted to the next level up, as depicted below.
ROOT=Hash(H+E)
/ \
/ \
H=Hash(F+G) E
/ \ \
/ \ \
F=Hash(A+B) G=Hash(C+D) E
/ \ / \ \
/ \ / \ \
A B C D E
[](https://badge.fury.io/py/merkletools)
[](https://travis-ci.org/aliciawyy/pymerkletools)
[](https://codecov.io/gh/aliciawyy/pymerkletools)
[](https://codeclimate.com/github/aliciawyy/pymerkletools/maintainability)
This project is adapted from the [pymerkletools](https://github.com/aliciawyy/pymerkletools) of Tierion.
It includes a `MerkleTree` class for creating Merkle trees, generating merkle proofs, and verification of merkle proofs.
## Installation
```
pip install pymerkletree
```
## Examples
The source code is simple by itself and examples can be found in the folder `demo`.
## Notes
### About tree generation
1. Internally, leaves are stored as `bytearray`. When the tree is built, it is
generated by hashing together the `bytearray` values.
2. Lonely leaf nodes are promoted to the next level up, as depicted below.
ROOT=Hash(H+E)
/ \
/ \
H=Hash(F+G) E
/ \ \
/ \ \
F=Hash(A+B) G=Hash(C+D) E
/ \ / \ \
/ \ / \ \
A B C D E
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymerkletree-1.0.5.tar.gz
(5.1 kB
view details)
Built Distributions
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 pymerkletree-1.0.5.tar.gz.
File metadata
- Download URL: pymerkletree-1.0.5.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b4a581874f6f36f8151e985352ee70ed38b3908fca1ef19346153587b80559b
|
|
| MD5 |
a3bdbad0add60b0d7b29d96bb54b3f5d
|
|
| BLAKE2b-256 |
89f6c4048a47854aeb74740d50454452016d5fced5bdf81ae143f8ac7c1b5d09
|
File details
Details for the file pymerkletree-1.0.5-py3-none-any.whl.
File metadata
- Download URL: pymerkletree-1.0.5-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9ab024ad845b0718ea5c3c3afb466459a3224025cd7e168b788900ec497d314
|
|
| MD5 |
c69ef90f63aec434814751ccfbdf41e4
|
|
| BLAKE2b-256 |
763989bebecbb13e02e537bbb1df1a6359b2a6f7ae92965a38a09a6b488523f6
|
File details
Details for the file pymerkletree-1.0.5-py2-none-any.whl.
File metadata
- Download URL: pymerkletree-1.0.5-py2-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46331dcc4f01fe87d598aeb306ce228fb85fbbebc06a7ad9a5fa36f71c64b76b
|
|
| MD5 |
74b5079f7539582cce6894158c998510
|
|
| BLAKE2b-256 |
6abec8fd7ec6e594aeb1f8049c91cd980fdd5d9d07026548bf3a2cb04732bdd0
|