Skip to main content
The propose_transaction function creates a PCZT by combining the Creator, Constructor, and IO Finalizer roles from ZIP 374.

Function Signature

Parameters

inputs
TransparentInput[]
required
Array of transparent UTXOs to spend. Each input requires:
payments
Payment[]
required
Array of outputs to create. Each payment requires:
change_address
string | null
Address to receive change. Can be:
  • Unified address with Orchard receiver (recommended for privacy)
  • Transparent P2PKH address (t1... or tm...)
  • null if no change expected
If total_input > total_payments + fee, a change address is required.
network
string
required
Network to use: 'mainnet' or 'testnet'
expiry_height
number
required
Block height at which the transaction expires. Must be:
  • After Nu5 activation (mainnet: 1,687,104 / testnet: 1,842,420)
  • At least current_height + 40 to avoid “tx-expiring-soon” errors

Example

What Happens Internally

  1. Validation — Inputs and payment addresses are validated
  2. Fee Calculation — ZIP 317 fee is computed based on transaction structure
  3. Change Calculationchange = total_input - total_payments - fee
  4. Builder Construction — Zcash transaction builder creates the structure
  5. PCZT Creation — Builder output is converted to PCZT format
  6. IO Finalization — Input/output metadata is finalized

Fee Calculation

Fees are calculated automatically according to ZIP 317:

Common Errors

The expiry height is before Nu5 activation. Use a height after:
  • Mainnet: 1,687,104
  • Testnet: 1,842,420
Total input value is less than payments + fee. Either:
  • Add more inputs
  • Reduce payment amounts
There’s leftover value but no change address provided. Pass a change address.
The address couldn’t be parsed. Ensure it’s a valid:
  • Unified address (u1... or utest1...)
  • Transparent address (t1... or tm...)

Next Step

After creating the PCZT, you can optionally verify it before signing, or proceed directly to signing.