DOCS / TUTORIAL: ZCASH ESCROW

Design a shielded Zcash escrow.

Design an escrow whose release is authorized by a Solana program and paid from an Ironwood shielded Zcash note.

Testnet alpha, library only: PairKey source now validates a restricted version-6 Ironwood PCZT and inserts a two-party spend signature. The hosted service and published SDK still return only raw RedPallas application-message signatures for Zcash; they do not accept a PCZT. This alpha does not set up ZIP 2005 quantum recovery keys, and future recovery is not guaranteed. There is no supported escrow-address enrollment or completed wallet/prover flow. Do not deposit funds into a purported PairKey shielded escrow yet.

1. Define escrow terms

Record the payer, payee, amount, dispute authority, expiry and refund path in a Solana controller account. The program should commit exactly one release or refund decision and bind it to the destination transaction commitment. A message such as “release escrow” is insufficient to constrain a shielded spend.

2. Create a PCZT with an Ironwood-capable wallet

Use a wallet or prover that produces a ZIP 374 Partially Created Zcash Transaction (PCZT). The alpha accepts a testnet version-6 transaction in a version-2 PCZT with exactly one real Ironwood spend and one output. It rejects mixed pools, transparent inputs or outputs, additional Ironwood actions, and PCZTs above 256 KiB. The wallet supplies the exact PCZT, matching full viewing key and spend randomizer through a future signing API. For version 6, it may add the note witness, anchor and proof after signing. PairKey supplies the spend-authorizing signature from its threshold shares; the wallet never sends the spend secret key. Note discovery, proof construction, output encryption, binding authorization and broadcast remain wallet/prover responsibilities.

3. Bind the actual spend

The alpha source adapter binds the exact PCZT bytes to a commitment, computes the version-6 shielded digest, checks the PairKey key and randomized spend key, and inserts the signature through the PCZT signer role. It verifies the note, encrypted output, recipient, fee, pool and expiry against the requested terms. The hosted approval flow still needs private PCZT delivery to both signers, with a checked commitment in the 1,232-byte approval envelope. Version-6 signatures do not commit to anchors or witnesses, so the wallet/prover must verify those during proving. Raw signMessage({chain:'zcash'}) cannot fill this role.

4. Release or refund

Only after the hosted flow and wallet layer pass independent test vectors and an end-to-end testnet spend should the program approve a release. The application submits the assembled transaction to a Zcash node, confirms inclusion, and records the result. A Solana approval cannot make Zcash inclusion atomic. ZIP 2005 recovery enrollment is deferred for this alpha; do not describe its escrow notes as quantum-recoverable.