finalize_and_extract function performs final validation and produces the raw transaction bytes ready to broadcast to the Zcash network.
Prerequisites
Before finalization, ensure:- β All transparent inputs are signed
- β All Orchard proofs are generated
Function Signature
- TypeScript
- Go
- Kotlin
Basic Usage
- TypeScript
- Go
- Kotlin
What Happens During Finalization
1
Spend Finalizer
Assembles final script signatures from partial signatures.
2
Validation
Verifies all required data is present and valid.
3
Transaction Extractor
Converts the PCZT into a raw Zcash transaction.
4
Serialization
Produces the final byte representation.
Broadcasting the Transaction
After extraction, broadcast the transaction to the Zcash network:Using zcash-cli
Using lightwalletd
Using a Block Explorer
Many block explorers provide a βBroadcastβ or βPush TXβ feature where you can paste the raw transaction hex.Using JSON-RPC
Complete Example
Transaction Structure
The extracted transaction follows the v5 transaction format:| Field | Description |
|---|---|
| Header | Version, version group ID |
| Transparent | Inputs with signatures, outputs |
| Sapling | (empty in t2z transactions) |
| Orchard | Actions with proofs, binding signature |
| Expiry | Block height expiry |
- 1 input β 1 Orchard output: ~2.5 KB
- 1 input β 2 Orchard outputs: ~5 KB
Common Errors
Missing signatures
Missing signatures
Not all transparent inputs have been signed. Use
inspect_pczt to check which inputs need signing.Missing proofs
Missing proofs
Orchard proofs havenβt been generated. Call
prove_transaction first.Spend finalizer error
Spend finalizer error
The PCZT couldnβt be finalized. This usually means something is inconsistent β try rebuilding from scratch.
After Broadcasting
After a successful broadcast:- Get the txid β Most broadcast methods return the transaction ID
- Wait for confirmation β Monitor for inclusion in a block
- Verify in explorer β Check the transaction on a block explorer
π Congratulations!
Youβve completed the full t2z transaction flow:- β Proposed the transaction
- β Verified (optional)
- β Signed all inputs
- β Generated proofs
- β Finalized and broadcast
Try the Demo
See this entire flow in action with the interactive demo.

