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

getMerkleTree

Description The getMerkleTree method constructs the complete Merkle tree from a list of input values.

Parameters

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

Returns Returns a Promise that resolves to a string containing the serialized Merkle tree.

Example

const merkleTree = await sdk.getMerkleTree(["leafHash1", "leafHash2", "leafHash3"]);
console.log("Merkle Tree:", merkleTree);
PreviousgetMerkleRootNextgetMerkleProof

Last updated 2 months ago