This app runs inside the BotSurf browser. Don't have it yet? Get the app or extension now!

Verify Merkle Proof

Security · All
0 installs · Verified BotGentz app
Launch App
Opens in BotSurf — try it free, no account needed.
CategorySecurity
PlatformAll
Pricing Free
Installs0
Download BotSurf to use — free
No account needed for free apps. Once BotSurf is open, find this app in Apps from the + menu.

About this app

WHAT IT DOES

Verify Merkle Proof enables you to cryptographically verify that a specific piece of data (a leaf) is included in a Merkle tree, given the Merkle root and a proof path. Merkle trees are fundamental to blockchain applications for efficient and secure data commitment, enabling users to prove inclusion without revealing the entire dataset. This tool takes the Merkle root (the commitment), the leaf data to verify, the proof (the sibling hashes along the path from the leaf to the root), and the leaf index position, and recomputes the root from the proof. If the recomputed root matches the provided root, the proof is valid and the leaf is confirmed to be part of the tree. The tool supports both Keccak-256 (Ethereum standard) and SHA-3-256 (NIST standard) hash algorithms, and handles both text and hex leaf data formats. It displays the computed root alongside the provided root, making the verification result transparent and verifiable.

HOW TO USE

Connect your wallet using the BGWallet connector (required for context). Select the leaf data format—"Text" for plain text or "Hex" for raw hex bytes. Choose the hash algorithm used to build the original Merkle tree—Keccak-256 (standard for Ethereum) or SHA-3-256 (NIST standard). Enter the Merkle root as a 32-byte hex string with a 0x prefix—this is the root hash you want to verify against. Enter the leaf data you want to verify—this should be the exact data that was included as a leaf in the tree. Enter the leaf index position (starting from 0) in the tree. Enter the Merkle proof as a JSON array of sibling hashes, each as a hex string with a 0x prefix, ordered from the leaf level up to the root. Click "Verify proof" to run the verification. The tool displays the provided root, the leaf data, the leaf index, the proof length, and the computed root. A green checkmark indicates the proof is valid and the leaf is included; a red X indicates the proof is invalid.

TECHNICAL MECHANISM

This tool implements the standard Merkle proof verification algorithm. The tool first hashes the leaf data using the selected hash algorithm (Keccak-256 or SHA-3-256). For text leaves, the raw string is hashed directly; for hex leaves, the hex string is converted to bytes and then hashed. Starting with the leaf hash, the tool processes the proof by iterating through the sibling hashes in order. At each step, the tool combines the current hash with the sibling hash based on the current leaf index: if the index is even, the current hash is on the left (paired with the sibling on the right); if odd, the current hash is on the right (paired with the sibling on the left). The combined bytes are then hashed to produce the parent hash. The index is then divided by 2 (floor) for the next level. After processing all proof elements, the final computed hash should match the provided root if the proof is valid. The tool uses ethers.js for Keccak-256 and the js-sha3 library for SHA-3-256, with all computation performed locally in the browser.

WHAT IT CANNOT SEE

This tool cannot verify that the leaf data or proof corresponds to any actual on-chain state without additional context—you must independently verify that the root matches what is stored on-chain. It does not automatically fetch the root from a contract; you must provide the root from your trusted source. The tool cannot verify the leaf data's validity or formatting beyond basic hex validation; it does not check that the leaf data matches the intended schema. It does not support non-standard hash algorithms beyond Keccak-256 and SHA-3-256. The tool cannot detect if the proof is for a different tree; a proof that is structurally valid will compute a root, but that root will not match the provided root. It does not verify that the leaf data was included in the original tree construction—a valid proof only confirms mathematical inclusion, not that the leaf was intended to be included. The tool cannot recover the original leaf data from the proof; the proof only contains sibling hashes. It does not support trees with non-standard proof ordering or custom proof structures.

PLEASE NOTE

This tool is designed for developers and users who need to verify Merkle proof inclusion. The generated proof format matches the standard used by popular libraries like OpenZeppelin's MerkleProof in Solidity. For Ethereum applications, Keccak-256 is the standard hash function used in Solidity's sha3(). For cross-chain or general applications, SHA-3-256 may be preferred for NIST compliance. The leaf index is critical for correct verification—the proof must be ordered from the leaf level up to the root. The proof should be provided as a JSON array of hex hashes, each with a 0x prefix. Always verify that the root you are verifying against comes from a trusted source, such as a deployed smart contract or a published commitment. A valid proof confirms mathematical inclusion but does not confirm the authenticity of the root itself; root authenticity must be established separately through on-chain or trusted off-chain verification.

Similar Apps

Log in to BotGentz

Suggest an App

Tell us what you'd find useful — if we build it, we'll email you the moment it's ready.