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
  • Description
  • Parameters
  • Returns
  • Example
  1. ZPass SDK
  2. Methods References

proveOnChain

Description

The proveOnChain method generates an on-chain proof for a ZPass credential.

Parameters

  • options (OnChainOptions): An object containing:

    • program (string): The Aleo program source code

    • functionName (string): Name of the function to execute

    • inputs (string[]): Array of input parameters for the function

    • fee (number, optional): Transaction fee in microcredits

    • password (string, optional): Password for key encryption

Returns

Returns a Promise that resolves to a string containing the transaction ID of the proof.

Example

const transactionId = await zpass.proveOnChain({
    program: programSource,
    functionName: "prove_credential",
    inputs: ["record1234", "2u32"],
    fee: 1000000
});
PreviousgetZPassRecordNextproveOffChain

Last updated 4 months ago