merkletree
— A NEO specific Merkle Patricia Tree implementation¶
This is a pure python implementation of a Merkle Patricia Tree that works on and returns hashes using NEOs UInt256
types.
For more information on the usage within the NEO system see their website.
-
class
neo3.core.cryptography.merkletree.
MerkleTree
(hashes)¶ Bases:
object
- Parameters
hashes (
List
[UInt256
]) – the list of hashes to build the tree from.- Raises
ValueError – if the hashes list is empty.
-
static
compute_root
(hashes)¶ Compute the Merkle root hash from a list of hashes.
- Parameters
- Raises
ValueError – if the hashes list is empty.
- Return type