FFORGE//RS
← Roadmap

blockchain / LEVEL 4

The Merkle proof with swapped children

EST.50 MIN
01

THEORY / RETRIEVAL

What to restore

  • Fold a Merkle authentication path in direction-aware order
  • Treat the empty proof as a leaf-root proof
  • Bound adversarial proof depth before expensive hashing

A proof carries position as well as hashes

For a binary Merkle tree, every sibling hash needs a left/right direction. If the compression hash is not commutative, swapping children changes the parent. The verifier folds from the leaf toward the committed root using the exact protocol encoding.

Authenticated does not mean available or fresh

A valid proof links data to a particular root. The caller must still decide whether that root is trusted, finalized and recent enough. Proof size, depth and hash work are untrusted inputs that need resource limits.

CHECKPOINT

What does a valid Merkle inclusion proof establish by itself?

ISOLATED RUST 1.96
src/lib.rsEDIT

02 / DEBUGGING

Find and fix the defect

Fix generic Merkle verification. Hash at most 64 proof nodes, preserve sibling direction, and accept an empty proof only when leaf equals expected root. The hash function is injected so this task tests tree logic rather than inventing cryptography.

Initializing editor…
CLOUD SANDBOXnetwork off · 256 MB · 12 s
1 / 64 KB
OUTPUT
Runner is waiting for a submission.