Skip to main content

A Python library to generate merkle trees and merkle proofs.

Project description

Stakewise python realization of @openzeppelin/merkle-tree

NB! Library is not well tested and not ready for the production use

A Python library to generate merkle trees and merkle proofs. Well suited for airdrops and similar mechanisms in combination with OpenZeppelin Contracts MerkleProof utilities.

Quick Start

poetry install

Building a Tree

from multiproof import StandardMerkleTree

values = [
    ["0x1111111111111111111111111111111111111111", 5000000000000000000],
    ["0x2222222222222222222222222222222222222222", 2500000000000000000]
]

tree = StandardMerkleTree.of(values, ["address", "uint256"])

print('Merkle Root:', tree.root)

todos

  • extend tests
  • add docs

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

multiproof-0.1.1.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

multiproof-0.1.1-py3-none-any.whl (8.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