Label: complexity: high
Points: 200
Description
Verifying a specific payment exists among thousands requires scanning the entire payments list. This issue adds build_payment_merkle() that computes a Merkle root over all payment entries and stores it on-chain, with verify_payment_merkle() allowing efficient single-payment verification using a proof path.
Technical Context
Involves lib.rs. Add build_payment_merkle(env, invoice_id) that hashes each (payer, amount) pair using env.crypto().sha256(), builds a binary Merkle tree, and stores the root in persistent key ("merkle", invoice_id). Add get_merkle_root(env, invoice_id) -> BytesN<32>.
Acceptance Criteria
Label: complexity: high
Points: 200
Description
Verifying a specific payment exists among thousands requires scanning the entire payments list. This issue adds
build_payment_merkle()that computes a Merkle root over all payment entries and stores it on-chain, withverify_payment_merkle()allowing efficient single-payment verification using a proof path.Technical Context
Involves
lib.rs. Addbuild_payment_merkle(env, invoice_id)that hashes each(payer, amount)pair usingenv.crypto().sha256(), builds a binary Merkle tree, and stores the root in persistent key("merkle", invoice_id). Addget_merkle_root(env, invoice_id) -> BytesN<32>.Acceptance Criteria
build_payment_merkle()computes and stores Merkle rootget_merkle_root()returns stored rootcargo clippypasses with zero warnings