Module merkle_payments

Module merkle_payments 

Source

Structs§

MerkleBranch
A Merkle branch (proof) from a leaf or midpoint to the root
MerklePaymentCandidateNode
A node’s signed quote for potential reward eligibility
MerklePaymentCandidatePool
One candidate pool: midpoint proof + nodes who could store addresses
MerklePaymentProof
Data package sent from client to node for data storage and payment verification
MerkleTree
A Merkle tree built from XorNames (content addresses)
MidpointProof
A reward candidate derived from a midpoint
OnChainPaymentInfo
What’s stored on-chain (or disk) - indexed by winner_pool_hash
PoolCommitment
Minimal pool commitment for smart contract submission

Enums§

BadMerkleProof
Errors that can occur when verifying a Merkle proof for batch payments
MerklePaymentVerificationError
Errors that can occur during Merkle payment verification
MerkleTreeError
Errors that can occur when working with Merkle trees

Constants§

CANDIDATES_PER_POOL
Number of candidate nodes per pool (provides redundancy)
MAX_LEAVES
Maximum number of leaves (2^MAX_MERKLE_DEPTH)
MAX_MERKLE_DEPTH
Maximum supported Merkle tree depth
MERKLE_PAYMENT_EXPIRATION
Maximum age of a Merkle payment (one week in seconds) Payments older than this are considered expired and nodes will reject addresses

Functions§

expected_reward_pools
Calculate expected number of reward pools for a given tree depth
verify_merkle_proof
Verify a address proof against smart contract payment data