propose_transaction function creates a PCZT by combining the Creator, Constructor, and IO Finalizer roles from ZIP 374.
Function Signature
- TypeScript
- Go
- Kotlin
Parameters
Array of transparent UTXOs to spend. Each input requires:
| Field | Type | Description |
|---|---|---|
pubkey | string | 33-byte compressed public key (hex) |
prevoutTxid | string | 32-byte transaction ID (little-endian hex) |
prevoutIndex | number | Output index in previous transaction |
value | bigint | Value in zatoshis |
scriptPubkey | string | P2PKH scriptPubkey (hex) |
sequence | number? | Sequence number (default: 0xffffffff) |
Array of outputs to create. Each payment requires:
| Field | Type | Description |
|---|---|---|
address | string | Unified address (Orchard) or transparent address |
amount | bigint | Amount in zatoshis |
memo | string? | Hex-encoded memo for shielded outputs (max 512 bytes) |
label | string? | Optional display label |
Address to receive change. Can be:
- Unified address with Orchard receiver (recommended for privacy)
- Transparent P2PKH address (
t1...ortm...) nullif no change expected
Network to use:
'mainnet' or 'testnet'Block height at which the transaction expires. Must be:
- After Nu5 activation (mainnet: 1,687,104 / testnet: 1,842,420)
- At least
current_height + 40to avoid “tx-expiring-soon” errors
Example
- TypeScript
- Go
What Happens Internally
- Validation — Inputs and payment addresses are validated
- Fee Calculation — ZIP 317 fee is computed based on transaction structure
- Change Calculation —
change = total_input - total_payments - fee - Builder Construction — Zcash transaction builder creates the structure
- PCZT Creation — Builder output is converted to PCZT format
- IO Finalization — Input/output metadata is finalized
Fee Calculation
Fees are calculated automatically according to ZIP 317:| Scenario | Fee |
|---|---|
| 1 input → 1 Orchard output | 10,000 zats |
| 1 input → 1 Orchard output + Orchard change | 10,000 zats |
| 2 inputs → 1 Orchard output | 10,000 zats |
| 3 inputs → 2 Orchard outputs | 15,000 zats |
Common Errors
OrchardBuilderNotAvailable
OrchardBuilderNotAvailable
The expiry height is before Nu5 activation. Use a height after:
- Mainnet: 1,687,104
- Testnet: 1,842,420
InsufficientFunds
InsufficientFunds
Total input value is less than payments + fee. Either:
- Add more inputs
- Reduce payment amounts
ChangeRequired
ChangeRequired
There’s leftover value but no change address provided. Pass a change address.
InvalidAddress
InvalidAddress
The address couldn’t be parsed. Ensure it’s a valid:
- Unified address (
u1...orutest1...) - Transparent address (
t1...ortm...)

