getMerkleProof

Description The getMerkleProof method generates a Merkle proof for a specific leaf in the Merkle tree.

Parameters

  • inputs (string[]): An array of strings representing the hashed leaf nodes of the Merkle tree.

  • index (number): The index of the leaf for which to generate the proof.

Returns Returns a Promise that resolves to a string[] containing the Merkle proof (sibling hashes).

Example

const proof = await sdk.getMerkleProof(["leafHash1", "leafHash2", "leafHash3"], 1);
console.log("Merkle Proof:", proof);

Last updated