Wishlist
Shielded spending conditions
A spending condition is a rule for how a note is spent. An example: the note pays only to addresses on a list, up to a cap. Transparent Zcash has a draft for such rules. Shielded Zcash has no draft.
ZIP 222 (Transparent Zcash Extensions) is a draft for transparent outputs only. This page describes what a shielded version needs and which parts are open. One design has a public forum post and no ZIP. Treat its numbers as claims.
Necessary changes
- Improves
- Threshold keys. There, people enforce the rules. A condition in the proof makes the rules independent of the signers.
- Wallets
- Wallets commit to a condition when the note is made. They prove the condition at each spend. They test each way out of the note before the wallet funds it.
- ZIP
- A new ZIP is necessary for the condition, its commitment and the proof. See Parts of a spec.
- Consensus
- Change. The Action statement has a fixed list of facts. The author of the forum proposal says that it needs a network upgrade.
- Status
- Proposal. A ZIP and an audit are open.
Problem
Apps need rules for funds: a list of payees, a cap for each spend, a recovery path, a time limit. Transparent
Zcash can express some rules in Bitcoin script. ZIP 222 states that limits on shielded spending are
even more restricted
.
An Orchard Action proves a fixed list of facts. The list is in the protocol specification. The old note commitment is correct and in the tree. The nullifier and the value commitment are correct. The spender has spend authority. The address and the new note commitment are correct. The enable flags are set.
The owner of a note cannot add a rule to this list.
One restriction of this type exists. The flag enableCrossAddress is in the Action statement
(ZIP 2006, Final). In the Orchard pool, the flag must be 0. Thus,
an Action must send its output to the same receiver as the note that it spends. Consensus sets this flag for
all notes in the pool. The owner of a note cannot choose it.
Today, an app can use threshold keys: any t of
n members can sign a spend. The condition is then a policy of the signers. If t
members agree, they can send the note to any address. A timelock is also unavailable: the threshold keys page
states that nLockTime is in effect only for transactions with transparent inputs.
Mechanism
Transparent: ZIP 222
An output has a precondition. A spending input has a witness. An extension has a
function tze_verify. The function takes the mode, the precondition, the witness and a context
object. It returns true if the precondition is met. Each node runs it. Thus, the precondition and the witness
are public. For this reason, ZIP 222 does not fit shielded notes.
ZIP 222 has the status Draft. The fields tze_in and tze_out are in a new transaction
format. No extension is deployed.
Shielded: the same split, in zero knowledge
A shielded version keeps the split of ZIP 222. The owner commits to a condition when the note is made. At each spend, the wallet runs the condition on private data and makes a proof that the condition is met. A node examines the proof. The condition, the witness and the result stay hidden from the node.
Zexe (2018) is the research design for this. Users run offline computations and make transactions that hide all information about the computation. Anyone can validate a transaction in constant time. In the paper, a transaction has 968 bytes, whatever the computation.
Delta Execution Arguments (DEA) are a different design, from one author on the Zcash forum (November 2026). In the idea, a program is bound to an address and runs once for each Action, inside the proof. The author claims:
- about 1.1 KB of added proof size;
- less than 20% extra proving time;
- a limit of about 200 rows for a program.
The forum post has a second example: a note that pays to one of two committed addresses, with a fee cap. The author says that this example needs 25 to 30 rows. The thread has no proof and no review of the construction. The author says that DEA needs a ZIP, formal proofs and a network upgrade.
Design points that decide if it is safe
These points come from replies in the DEA forum thread. They apply to all designs.
- Commit at creation. A condition chosen at spend time has no protective effect. In a 2-of-3 escrow, two members meet the threshold and can prove under a different program. This attack cannot be prevented by a signature. In ZIP 244, the Orchard proofs are in the authorizing data digest. The digest that the signature covers has no proof. Thus, the condition must be bound to the note or to the address.
- One format for all Actions. If only some Actions have a program package, an observer can see which notes have a condition. The notes with a condition then form a smaller anonymity set. A package in each Action fixes this. The package is empty for normal spends. Each Action then has the cost of the package.
- Test each exit before funding. A mistake in a condition leaves the funds locked for good. The wallet proves a test spend on each exit path. The wallet also checks that a spend to an address outside the exits fails.
-
Time. A rule such as "refund only after height H" needs the height or
nLockTimeas an input of the circuit.
Which language
We found no source that tests which language is easiest to verify formally. A language that is easy to verify has three properties:
- Loops have a fixed bound. The circuit has a fixed size, so each loop is unrolled. For this reason, the DEA author expects short loops.
- The cost of a program is known before it runs.
- The language has formal semantics, so a tool can check that the circuit matches the language.
Simplicity for Bitcoin is an example of a language with these properties. It is a typed, functional language with a fixed set of combinators. Loops and recursion are absent. Its semantics are formal, in Coq. The language is not Turing complete. Thus, a tool can find an upper bound for the time and the space of a program before the program runs.
The forum poll lists Python, Solidity and BitcoinScript. The DEA author says that programs are in a compiled intermediate form. Thus, many front languages can exist, as for the EVM. The formal work belongs to the small intermediate form and to the circuit that checks it. The front language comes after.
Comparison
| Design | Condition is | Enforced by | Shielded notes | Status |
|---|---|---|---|---|
| Transparent extension (ZIP 222) | Public | Each node | No | Draft |
| Threshold keys | Policy of the signers | t of n members | Yes | Experimental pattern. ZIP 312 is a draft. |
| Public flag (ZIP 2006) | Public flag, same for all notes | The proof and consensus | Yes, with one value for all owners | Final |
| Program in the proof (Zexe) | Hidden | The proof | Yes, in a new system | Research paper |
| Program in the Action proof (DEA) | Hidden, as the author claims | The proof | Yes, after a network upgrade (author claim) | Forum proposal. A ZIP is open. |
Parts of a spec
- Commitment. Where the condition is bound: in the note, in the address, or in a new field. A third party who pays into a conditional note must know which one. Wallets that restore from a seed must find the note again.
- Instruction set. A small intermediate form with formal semantics and a known cost for each instruction.
- Circuit and size. The change to the Action statement, the added proof size, and the cost of a package in each Action for one format.
- Inputs. The public values that a condition can read: the new address, the amount, the fee, and the height or time.
- Wallet checks. Before funding, each exit decodes to a valid address. No exit belongs to the spender. Each exit is unique. A test proof exists for each exit, and a spend to an address outside the exits fails.
- Upgrade rules. A condition commitment must stay valid after a network upgrade. Otherwise, old conditional notes can be lost.