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
- TypeScript
- Go
- Kotlin
Basic Usage
- TypeScript
- Go
- Kotlin
Pre-building the Proving Key
To avoid the ~10 second delay during transaction construction, pre-build the proving key at app startup:- TypeScript
- Go
- Kotlin
Utility Functions
| Function | Description |
|---|---|
prebuild_proving_key() | Build and cache the proving key |
is_proving_key_ready() | Check if proving key is cached |
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
| Operation | Time (first run) | Time (cached) |
|---|---|---|
| Build proving key | ~10 seconds | N/A |
| Generate proof | ~1-2 seconds | ~1-2 seconds |
- CPU speed
- Number of Orchard actions
- Browser vs native runtime
Verifying Proofs Were Added
Common Errors
Proving error
Proving error
The proving process failed. This is rare but can happen if:
- The PCZT is malformed
- Memory constraints in browser

