Skip to main content

Overview

Every operation that generates a Groth16 ZK proof requires a prover passed through deps. There is no built-in default — you must always supply one. All provers follow the same prove(inputs) → { proofA, proofB, proofC } contract. In V18 the prover and the asset CDN live inside the main SDK at the @umbra-privacy/sdk/zk-prover subpath. The standalone @umbra-privacy/web-zk-prover package from V13 has been deleted. For instantiation, Web Worker setup, and remote proving backends, see ZK Provers.
The burner prover factory and interface names retained their V13 spellings (getClaim…, IZkProverForClaim…). The creator prover factories were renamed — ETA-source: getETAIntoStealthPoolNoteCreatorProver / IZkProverForETAIntoStealthPoolNote; ATA-source: getATAIntoStealthPoolNoteCreatorProver / IZkProverForATAIntoStealthPoolNote. The high-level factory functions in /deposit, /withdrawal, /burn also use the new vocabulary. Both creator and burner prover names coexist but follow different patterns.

IZkProverForUserRegistration

interface IZkProverForUserRegistration {
  prove(inputs: UserRegistrationCircuitInputs): Promise<{
    proofA: Groth16ProofA;
    proofB: Groth16ProofB;
    proofC: Groth16ProofC;
  }>;
}
Required by: getUserRegistrationFunction deps (zkProver).

IZkProverForETAIntoStealthPoolNote

interface IZkProverForETAIntoStealthPoolNote {
  prove(inputs: ETAIntoStealthPoolNoteCircuitInputs): Promise<{
    proofA: Groth16ProofA;
    proofB: Groth16ProofB;
    proofC: Groth16ProofC;
  }>;
}
Shared by both ETA-source creator variantsgetETAIntoSelfBurnableStealthPoolNoteCreatorFunction and getETAIntoReceiverBurnableStealthPoolNoteCreatorFunction both take a zkProver: IZkProverForETAIntoStealthPoolNote dep. Use getETAIntoStealthPoolNoteCreatorProver() to get a default instance. For ATA-source creation, see IZkProverForATAIntoStealthPoolNote below.

IZkProverForClaimSelfClaimableUtxoIntoEncryptedBalance

interface IZkProverForClaimSelfClaimableUtxoIntoEncryptedBalance {
  readonly maxUtxoCapacity: 1;
  prove(inputs: ClaimSelfClaimableUtxoIntoEncryptedBalanceCircuitInputs): Promise<{
    proofA: Groth16ProofA;
    proofB: Groth16ProofB;
    proofC: Groth16ProofC;
  }>;
}
Required by: getSelfBurnableStealthPoolNoteIntoETABurnerFunction deps (zkProver). maxUtxoCapacity: 1 — one note per proof, the SDK loops internally if you submit an array.

IZkProverForClaimReceiverClaimableUtxoIntoEncryptedBalance

interface IZkProverForClaimReceiverClaimableUtxoIntoEncryptedBalance {
  prove(
    inputs: ClaimReceiverClaimableUtxoIntoEncryptedBalanceCircuitInputs,
    nLeaves: ClaimBatchSize,
  ): Promise<{
    proofA: Groth16ProofA;
    proofB: Groth16ProofB;
    proofC: Groth16ProofC;
  }>;
}
Required by: getReceiverBurnableStealthPoolNoteIntoETABurnerFunction deps (zkProver). This prover accepts a batch size nLeaves (1–5 in V18 — the SDK chunks to 5 notes per proof).

IZkProverForClaimSelfClaimableUtxoIntoPublicBalance

interface IZkProverForClaimSelfClaimableUtxoIntoPublicBalance {
  readonly maxUtxoCapacity: 1;
  prove(inputs: ClaimSelfClaimableUtxoIntoPublicBalanceCircuitInputs): Promise<{
    proofA: Groth16ProofA;
    proofB: Groth16ProofB;
    proofC: Groth16ProofC;
  }>;
}
Required by: getSelfBurnableStealthPoolNoteIntoATABurnerFunction deps (zkProver).

IZkProverForATAIntoStealthPoolNote

interface IZkProverForATAIntoStealthPoolNote {
  prove(inputs: ATAIntoStealthPoolNoteCircuitInputs): Promise<{
    proofA: Groth16ProofA;
    proofB: Groth16ProofB;
    proofC: Groth16ProofC;
  }>;
}
Shared by both ATA-source creator variantsgetATAIntoSelfBurnableStealthPoolNoteCreatorFunction and getATAIntoReceiverBurnableStealthPoolNoteCreatorFunction both take a zkProver: IZkProverForATAIntoStealthPoolNote dep. Use getATAIntoStealthPoolNoteCreatorProver() to get a default instance.

Quick Setup

Per-circuit factories are exported from @umbra-privacy/sdk/zk-prover. They wrap snarkjs Groth16 and fetch proving keys from Umbra’s CDN by default.
import {
  getUserRegistrationProver,
  getETAIntoStealthPoolNoteCreatorProver,
  getATAIntoStealthPoolNoteCreatorProver,
  getClaimSelfClaimableUtxoIntoEncryptedBalanceProver,
  getClaimReceiverClaimableUtxoIntoEncryptedBalanceProver,
  getClaimSelfClaimableUtxoIntoPublicBalanceProver,
} from "@umbra-privacy/sdk/zk-prover";

const registrationProver = getUserRegistrationProver();

// Stealth Pool Note creators — one prover instance is shared across self/receiver variants of the same source
const createFromEtaProver  = getETAIntoStealthPoolNoteCreatorProver();  // both ETA self-burnable + receiver-burnable
const createFromPataProver = getATAIntoStealthPoolNoteCreatorProver();  // both ATA self-burnable + receiver-burnable

// Burners
const burnSelfIntoEtaProver     = getClaimSelfClaimableUtxoIntoEncryptedBalanceProver();
const burnReceiverIntoEtaProver = getClaimReceiverClaimableUtxoIntoEncryptedBalanceProver();
const burnSelfIntoPataProver    = getClaimSelfClaimableUtxoIntoPublicBalanceProver();
Each factory accepts an optional IZkAssetProvider argument — a simple interface with one method, getAssetUrls(type, variant?). When no provider is passed, the factories default to the CDN provider (equivalent to calling getCdnZkAssetProvider() from @umbra-privacy/sdk/zk-prover/cdn), which fetches proving keys from Umbra’s CDN. You can supply your own provider to customise asset resolution. See ZK Provers for Web Worker setup, custom asset providers, and remote proving backends.