Skip to main content
The 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

Basic Usage

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: Typical sizes:
  • 1 input → 1 Orchard output: ~2.5 KB
  • 1 input → 2 Orchard outputs: ~5 KB

Common Errors

Not all transparent inputs have been signed. Use inspect_pczt to check which inputs need signing.
Orchard proofs haven’t been generated. Call prove_transaction first.
The PCZT couldn’t be finalized. This usually means something is inconsistent — try rebuilding from scratch.

After Broadcasting

After a successful broadcast:
  1. Get the txid — Most broadcast methods return the transaction ID
  2. Wait for confirmation — Monitor for inclusion in a block
  3. Verify in explorer — Check the transaction on a block explorer
The recipient can view incoming shielded funds using their full viewing key (not spending key). For Orchard, viewing keys are encoded as uview1... (mainnet) or uviewtest1... (testnet).

🎉 Congratulations!

You’ve completed the full t2z transaction flow:
  1. ✅ Proposed the transaction
  2. ✅ Verified (optional)
  3. ✅ Signed all inputs
  4. ✅ Generated proofs
  5. ✅ Finalized and broadcast

Try the Demo

See this entire flow in action with the interactive demo.