zPass docs
  • zPass
    • Introduction
    • Quickstart
    • Background
    • Benefits & Use Cases
    • Technical Foundations
    • System Participants
    • Powered by Aleo
  • Fundamentals
    • Issuer
    • Holder
    • Verifier
    • Off-chain flow
    • On-chain flow
    • Local Execution with WASM
  • ZPass Programs
    • Background
    • Verify offchain program
    • zPass issuance program
    • zPass hiding program
    • zPass invalidate program
    • zPass invalidate hiding program
    • zPass merkle tree size 8 program
  • ZPass SDK
    • Methods References
      • constructor
      • setNewHost
      • issueZPass
      • getZPassRecord
      • proveOnChain
      • proveOffChain
      • verifyOnChain
      • verifyOffChain
      • signCredential
      • initThreadPool
      • createAleoWorker
      • getMerkleRoot
      • getMerkleTree
      • getMerkleProof
      • getLeavesHashes
      • signMerkleRoot
  • Example Usage
    • Step-by-step Guide
Powered by GitBook
On this page
  1. ZPass SDK
  2. Methods References

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);
PreviousgetMerkleTreeNextgetLeavesHashes

Last updated 2 months ago