As promised, here is the design approach for Orchard and Ironwood spend authority, for feedback before any ZIP text is written.
Context
ZIP 311 defines how a payment disclosure proves Sapling spend authority: a fresh Sapling spend proof for the spent note against the transaction’s own anchor, plus a spendAuthSig under the new rk over a ZIP 311 digest. For Orchard the draft only says “TODO: Add support for Orchard”, and NU6.3 adds the Ironwood pool, which reuses the Orchard Action encoding and circuit (ZIP 229). This note proposes an Orchard-protocol construction that follows the Sapling one as closely as possible. Disclosing Orchard/Ironwood outputs and an Orchard analogue of the optional address proof are out of scope here.
Proposed construction
A disclosure gets two new sequences, orchardSpends and ironwoodSpends, mirroring vActionsOrchard and vActionsIronwood. Each entry contains:
index: an index into the corresponding vActions sequence;
cv_net', rk', cmx': the public inputs that the disclosure supplies;
proof': a Halo 2 proof of the Action statement for one Action;
spendAuthSig.
The anchor and the nullifier are not carried. They come from the transaction: rt is anchorOrchard or anchorIronwood (by pool), and nf is vActions<pool>[index].nf. The flags are fixed by this proposal, not chosen by the prover: enableSpends = 1, enableOutputs = 0, enableCrossAddress = 0 (so disableCrossAddress = 1).
To create an entry, the wallet uses the spent note n, its full viewing key (ak, nk, rivk), ask, and a Merkle path from cmx(n) to rt:
- Check that the nullifier of
n equals vActions<pool>[index].nf.
- Sample fresh
α' and rcv'.
- Build a dummy output note
n' with value 0, ρ = nf, a fresh rseed, and the same address as n (needed because disableCrossAddress = 1; see Pool and circuit details).
- Set
cv_net' = ValueCommit_rcv'(v(n) - 0), rk' = SpendAuthSig.RandomizePublic(α', ak), and cmx' = ExtractP(NoteCommit(n')).
- Prove the Action statement with the primary input
(rt, cv_net', nf, rk', cmx', 1, 0) plus disableCrossAddress = 1.
- After the unsigned disclosure is assembled, set
spendAuthSig = SpendAuthSig.Sign(RandomizePrivate(α', ask), digest), where digest is the existing ZIP 311 digest BLAKE2b-256("ZIP311Signed" || coinType, unsignedPaymentDisclosure).
Why nf binds the proof to the transaction’s spend. nf is committed in the txid in both v5 and v6. By “Nullifier integrity”, the fresh proof shows knowledge of a note n* with DeriveNullifier_nk(ρ, ψ, cm) = nf. Unless two distinct Orchard-protocol notes share a nullifier (ZIP 2005 notes this depends on the collision resistance of the hash underlying DeriveNullifier), n* is the note the transaction spent.
“Old note commitment integrity” then fixes v_old, so the fresh proof skips the Merkle check only if the original Action spent a zero-valued note. “Diversified address integrity”, together with the binding of Commit^ivk, ties the prover’s ak and nk to that note’s address. The argument does not rely on the original Action proof or on rt. ZIP 311’s Sapling check has the same shape, though it does not spell out the argument.
Why fresh randomization does not add linkage. The specification requires RandomizePrivate(α, sk) with random α to be distributed like a fresh key, so rk' is unlinkable to ak, to the transaction’s rk, and to other disclosures. cv_net' and cmx' use fresh randomness, and the specification states that ValueCommit and NoteCommit are unconditionally hiding (NoteCommit provided no ⊥ is observed). rt and nf are already public.
Rust API. A prototype built only on the public orchard 0.15.5 API passes these tests in both pools (Orchard with v2 note plaintexts, Ironwood with v3):
- an honest entry verifies, with a 4992-byte proof;
- a wrong nullifier or a wrong anchor fails the proof, and a different digest fails the signature;
- an entry for the prover’s own note does not verify against another spend’s anchor and nullifier;
- a dummy output to a different address fails verification.
The tests use synthetic Merkle paths, not mainnet data. The code is in tests/orchard_spend_authority.rs. Two helpers are crate-private, ValueCommitTrapdoor::random and Rho::from_nf_old, so the prototype uses ValueCommitTrapdoor::from_bytes and Rho::from_bytes on the nullifier’s bytes instead. The other calls are SpendInfo::new, Note::from_parts, RandomSeed::from_bytes, ValueCommitment::derive, SpendValidatingKey::randomize, MerklePath::from_parts, Circuit::from_action_context, Instance::from_parts, Flags::from_byte(0x01, …) with BundleVersion::orchard_v3() or ironwood_v3(), ProvingKey/VerifyingKey::build(OrchardCircuitVersion::PostNu6_3), Proof::create/verify, and SpendAuthorizingKey::randomize then sign.
Verification
This extends the ZIP 311 verification procedure:
- Structural checks. Each new sequence must be no longer than its
vActions, and each index must be unique and in range. The “at least one spend” rule counts the new sequences too.
- Per entry:
- Reject non-canonical encodings and an identity
rk'. Identity rk is a consensus rejection for Actions, and Instance::from_parts refuses it.
- Check
SpendAuthSig.Verify(rk', digest, spendAuthSig).
- Get a trustworthy
rt for the pool (see below), and take nf from the transaction.
- Verify
proof' under the PostNu6_3 verifying key with the primary input (rt, cv_net', nf, rk', cmx', 1, 0) and disableCrossAddress = 1.
Getting the anchor. The procedure depends on the transaction version, not the block height. ZIP 229 leaves the v5 digest algorithm unchanged.
-
v5: anchorOrchard is committed in the txid (ZIP 244, T.4f). Given pd.txid = tx.txid() and a mined transaction, rt is the value that consensus checked: it “MUST refer to some earlier block’s final treestate”.
-
v6: ZIP 229, “Anchor commitment (version 6)”, leaves anchorOrchard and anchorIronwood out of the txid digest and commits them in the auth digest instead. This is so that a transaction can be re-anchored without changing its txid. In that case pd.txid = tx.txid() does not authenticate the anchor. The verifier must also do one of the following:
- (a) check that the presented transaction’s auth digest is the one committed by the mined block’s
hashAuthDataRoot;
- (b) check independently that
rt is the root of the final treestate of some block earlier than the one containing tx, for that pool, for example against hashLatestOrchardRoot/hashLatestIronwoodRoot (ZIP 221, extended by ZIP 258) or a full node.
Soundness does not depend on this check, because nf binds the note (see above); it keeps the Merkle-path condition about the real tree.
Pool and circuit details
- Verifying key. Use PostNu6_3 for every disclosure, whatever the transaction’s height; the proof is new, so it need not match the original Action’s key.
InsecurePreNu6_2 (documented in the crate as never for proving or current verification) must never be accepted.
- Pools. Orchard and Ironwood share the circuit and encoding (ZIP 229) and differ only in where
rt and nf come from, so the pool must be covered by the digest; pool-specific sequences do that.
- Dummy output address. In the crate’s PostNu6_3 circuit, a nonzero
disableCrossAddress forces the output’s g_d and pk_d coordinates to equal those of the spent note, regardless of value. That is why step 3 reuses the spent note’s address. n' is never published, so this reveals nothing.
- Fixed flags.
enableOutputs = 0 forces the output value to 0, so cv_net' commits to exactly v(n). enableSpends = 1 is required whenever v(n) > 0.
What it does and does not prove
A valid entry shows that the signer holds the spend authority (ask, together with nk and rivk) for the note behind that Action’s nf. It does not identify an address: as ZIP 311’s rationale says for Sapling, one spend authority covers many diversified addresses.
Covering some Actions says nothing about the others (“one, but not all, spenders”), which matters more for Orchard because Actions often contain dummy spends. When v_old = 0 the statement does not check Merkle path validity, so an entry can be made for a dummy spend whose key the prover kept, and since cv_net' hides the value, a verifier cannot tell it from a real spend.
The digest covers txid, msg and every entry, proofs included. So each signature commits to the whole disclosure, and an entry cannot be added, removed or changed without invalidating every spendAuthSig (ZIP 311’s transparent BIP 322 signatures cover only msg). Because rk' is a primary input, replacing it requires a new proof. Putting a challenge in msg makes the disclosure interactive, as in ZIP 311. The transaction’s own spendAuthSig is made under a different key (rk), over the SIGHASH.
Witness requirement
As in ZIP 311’s Security and Privacy Considerations, the prover needs a witness for the spent note against the transaction’s anchor, which a wallet can cache when it creates the transaction’s proofs (in v6 the anchor may be chosen after signing). Otherwise, since the anchor is some block’s final treestate root, the wallet can locate that block (own records, ZIP 221 history tree leaves, or a node) and rebuild the path from the public cmx values up to it. α' and rcv' are fresh, so ZIP 311’s “no ephemeral data” requirement holds.
Open questions for reviewers
- Flags. Is
enableCrossAddress = 0 with a same-address dummy the right choice? The alternative is enableCrossAddress = 1 with an unconstrained dummy address. Either works under PostNu6_3; the point is to fix one.
- Statement. The NU6.3 Action statement is not fully written down. ZIP 2006 is still Reserved. The specification’s Action description lists
disableCrossAddress in the primary input, but the consensus rule and the Action statement both list seven inputs (nine field elements). Should the ZIP cite the crate’s PostNu6_3 circuit until the specification is updated?
- Circuit version. Should the ZIP pin the circuit version to PostNu6_3 explicitly, rather than “the current consensus key”?
- v6 anchors. Should verifiers be required to use check (a), check (b), or either?
- Own anchor in v6. Since v6 anchors are authorizing data, could a disclosure carry its own valid anchor so that wallets need not keep witnesses for spent notes? ZIP 311 argues a newer anchor brings no privacy benefit. Does it bring any cost?
- Binding assumption. Is nullifier collision resistance (plus the binding of NoteCommit and Commit^ivk) the right assumption to state, given it does not hold against a discrete-log-breaking adversary?
- Value opening. Should an entry be able to reveal
(v_old, rcv'), so that the verifier can see that the spent note was not zero-valued (this reveals the spent note’s value)?
- Encoding. Should there be one proof per entry (2720 + 2272 = 4992 bytes, by ZIP 229’s
sizeProofs formula), or one aggregated proof per pool?
- Hardware and FROST signers. Can these sign an arbitrary 32-byte digest with a randomized key, or do they need firmware changes?
Scope
This is a proposal for discussion before any ZIP text is written. It changes no consensus rules and needs no new trusted setup.