Skip to main content
The prove_transaction function generates Halo 2 zero-knowledge proofs for all Orchard actions in the transaction.

About Orchard Proofs

Orchard uses the Halo 2 proving system which:
  • Requires no trusted setup (unlike Groth16 used by Sapling)
  • Builds the proving key programmatically (no downloads)
  • Provides recursive proof composition
The first proof generation takes ~10 seconds to build the proving key. Subsequent proofs are fast because the key is cached.

Function Signature

Basic Usage

Pre-building the Proving Key

To avoid the ~10 second delay during transaction construction, pre-build the proving key at app startup:

Utility Functions

Browser Considerations

In browser environments, proving can block the UI. Consider:

1. Show Loading State

2. Use Web Workers

For a non-blocking experience, run proving in a Web Worker:

3. Pre-build at Startup

Build the proving key while the user is entering transaction details:

Parallel with Signing

Proving and signing are independent — they can run in parallel:
If you’re the same party doing both signing and proving sequentially, the combine step isn’t needed — just do them in sequence on the same PCZT.

Performance

Performance varies by:
  • CPU speed
  • Number of Orchard actions
  • Browser vs native runtime

Verifying Proofs Were Added

Common Errors

The proving process failed. This is rare but can happen if:
  • The PCZT is malformed
  • Memory constraints in browser
Try refreshing and rebuilding the PCZT.

Next Step

After proofs are generated (and all inputs are signed), proceed to finalization to extract the raw transaction.