This section assembles the public data of an Action and of a bundle, states the transaction format that carries them, constructs the digest that both kinds of signature sign and proves in Proposition 11.10 which data the signatures fix, states the chain state and the rules of each pool, and gives the procedures of the sender and of the verifier, with a worked two-Action payment.
The objects of this subsection are constructed in §4 to §10. The subsection fixes their encodings and their grouping; it redefines neither the Action nor the bundle (Definitions “Action” and “Bundle”, §4.4). As in §10.2, a star encoding enters a byte string as the bytes and is identified with them.
The Action description of an Action is the byte string
of
| Field | Type enforced on parsing | Encoding | Bytes | Constructed in |
|---|---|---|---|---|
| , the identity admitted | Definition 8.2 | |||
| Definition 6.3 | ||||
| ; the identity excluded by a separate rule | §7.2 | |||
| Definition 4.4 | ||||
| §10.2 | ||||
| -byte string | itself | §10.2 | ||
| -byte string | itself | §10.3 | ||
| Action description | ||||
Every field of an Action description must be the canonical encoding of its type (protocol specification, §“Action Descriptions”; for also §“Action Description Encoding and Consensus”). Hence and are integers below , and neither is checked to be the -coordinate of a Pallas point; is a non-identity point by its type; is a point, and the rule of “Randomised validating keys” (§7.2) excludes the identity; and may be the identity. The Action’s spend-authorisation signature, of bytes (“The RedPallas signature scheme”, §7.1), and its proof are not part of the Action description. The bundle carries the signatures, one per Action, and one aggregate proof, whose per-Action instances are in the order of the Action descriptions (ZIP 229, “Consensus Rules”).
A bundle of one pool with
its Action descriptions;
one anchor (“Anchors”, §5.2), shared by all Actions: no Action description carries an anchor, and the transaction carries one anchor field for each pool with Actions, and ;
one flags byte (“Bundle flags”, §9.1), whose bit is and bit , and whose bit is in and reserved and in ;
the balancing value of “The balancing value” (§8.2);
one aggregate proof over its Actions (“The Action circuit and the Halo 2 proof”, §9.3);
spend-authorisation signatures, one per Action;
one binding signature (“The binding signature”, §8.3).
The anchor and the flags are common to all Actions of the bundle and are encoded once (protocol specification, §“Action Transfers and their Descriptions” and §“Action Descriptions”, note). A transaction carries at most one bundle per pool, hence one binding signature for each pool with Actions (ZIP 229, “Transaction Format” and “Consensus Rules”). Figure 4 shows each public field with the checks that consume it.
A bundle that consumes real notes and creates real notes has
From NU7 the transaction formats in force are version , specified in ZIP 225, and version , specified in ZIP 229; a transaction of any other version, version included, is invalid (ZIP 2003, “Specification”, which amends the rule of the protocol specification, §“Transaction Consensus Rules”, that admits versions , and from NU6.3; ZIP 259, Abstract). Of the two Orchard-protocol bundles a version- transaction can carry only the Orchard-pool bundle; a transaction with Ironwood-pool Actions is of version (protocol specification, §“Action Descriptions”). The Orchard-pool rules of “Chain state and pool rules” (§11.4) apply to Orchard-pool Actions in both versions (ZIP 229, “Consensus Rules”). Sprout, Zcash’s first shielded protocol, spends its notes only through JoinSplit descriptions, its transfer descriptions, which only transaction versions to carry (protocol specification, §“Transaction Encoding and Consensus”); Sprout funds are therefore unspendable, and their value remains counted as issued, in the sense of the total issued supply defined in “Chain state and pool rules” (§11.4) (ZIP 2003, Abstract and “Interaction with the proposed Network Sustainability Mechanism”; ZIP 259, Abstract). This subsection describes version .
A version- transaction consists of the fields of the version- format up to and including the Orchard component (ZIP 225), followed by the Ironwood component. Its first five fields form the header:
, whose bit , the flag, is set and whose bits to hold the version, ;
, which must be ;
, which must equal the consensus branch identifier used by the signature digest of “Transaction digests and signatures” (§11.3), the identifier of the consensus branch under which the transaction is validated, where a consensus branch is a sequence of consecutive blocks under one consensus rule set whose first block is the genesis block or follows a block validated under older rules, and each network upgrade fixes for the branch that it begins a globally unique non-zero -bit consensus branch identifier (ZIP 200, Terminology and “Specification”);
, the transparent lock time, which no rule of this volume uses;
, the expiry height.
In version , bits and of are named and , as in , and bits to of are reserved and must be , in version and version alike (“Bundle flags”, §9.1). The Ironwood component has the structure of the Orchard component, with its own flags, balancing value, anchor, proof and signatures; both encode each Action as the -byte Action description of §11.1 (ZIP 229, “Transaction Format” and “Consensus Rules”; protocol specification, §“Transaction Consensus Rules”).
A coinbase transaction is the first transaction of a block; it collects the block subsidy, the value newly issued in that block, and the fees of the block’s other transactions, less from NU7 the part of those fees removed from circulation (“The balancing value”, §8.2). Every block has exactly one (protocol specification, §“Coinbase Transactions”).
The field is , which disables expiry, or a block
height. The expiry rule is: for a transaction other than a coinbase
transaction, is at most , and such a
transaction with
Let be the number of Ironwood-pool Actions of a version-
transaction. The Ironwood component is the sequence of the fields of
Table 9, in that order. The fields after
are present if and only if
| Field | Bytes | Content |
|---|---|---|
| compactSize | the count | |
| the Action descriptions of §11.1 | ||
| bit , bit , bit , bits to reserved and | ||
| the balancing value, signed -bit little-endian | ||
| the anchor | ||
| compactSize | the proof length, | |
| the aggregate proof | ||
| one spend-authorisation signature per Action, in Action order | ||
| the binding signature |
The consensus rules on the component are:
Write
The transaction identifier of a version- transaction is
the Ironwood digest last, where:
the header digest is under ZTxIdHeadersHash of the -byte little-endian encodings of , , , and ;
the transparent digest and the Sapling digest are those of ZIP 244, “T.2: transparent_digest” and “T.3: sapling_digest”, the latter with the version- node of ZIP 229; they cover the transparent inputs and outputs and the Sapling component, the component of Zcash’s second shielded protocol;
for
with the compact, memo and non-compact records and personalisations
for
the Orchard digest has the same structure over the Orchard-pool Actions, with and , under the personalisation ZTxIdOrchardH_v6, with the Action digests personalised
without Orchard-pool Actions it is .
(ZIP 244, “Digests”, “txid_digest”, “T.1: header_digest” and “T.4: orchard_digest”; ZIP 229, “Ironwood component digest”, “Anchor commitment (version 6)” and “Summary of the resulting digest structure”.)
The ciphertext is the ChaCha20 encryption of the
-byte note plaintext, byte for byte, followed by the -byte tag
(Crypto Guide, §“The ChaCha20-Poly1305 AEAD”, Construction
“ChaCha20-Poly1305”; “The note plaintext”, §10.1).
The offsets therefore split it into the encryption of the -byte prefix
of the plaintext, the lead byte, , and
(
The authorising-data digest of a version- transaction is
where is the transparent scripts digest and
the Sapling authorising-data digest (ZIP 244,
“Authorizing Data Commitment”; ZIP 229), and, for
and
ZIP 244, “Authorizing Data Commitment”, describes the pair of the transaction identifier and the authorising-data digest as a commitment to all data of the transaction. In version the anchors are authorising data so that a transaction can be signed before its anchor is chosen and its proofs are computed; replacing a bundle’s anchor and proof together does not change the transaction identifier (ZIP 229, Motivation and “Anchor commitment (version 6)”). Below the two roots, a node whose directly hashed input differs between versions and has a version- personalisation of its own; the roots keep theirs and hash one more child in version . The nodes that omit or include an anchor in version are personalised ZTxIdSSpendNH_v6, ZTxAuthSapliH_v6, ZTxIdOrchardH_v6 and ZTxAuthOrchaH_v6 (ZIP 229, “Ironwood component digest” and “Anchor commitment (version 6)”).
The signature digest of a transaction is its digest not associated with a transparent input, under the hash type , which covers all transparent inputs and outputs:
whose header and shielded children are those of and whose
child is the transparent signature digest of ZIP 244,
“S.2: transparent_sig_digest”. For a coinbase transaction and for a
transaction without transparent inputs,
Proposition 8.11, which holds for every message, applies to the binding signature on .
In version the root of the transaction identifier has four children, the header, transparent, Sapling and Orchard digests, under the same root personalisation. The Orchard digest, under ZTxIdOrchardHash, hashes
with the Action digests of version , and the Orchard authorising-data digest, under ZTxAuthOrchaHash, covers the proofs and the signatures only. In version the Orchard anchor is therefore effecting data and fixed by the signatures; the proofs are authorising data in both versions. A version- transaction carries Orchard-pool Actions only (ZIP 244, “txid_digest”, “T.4: orchard_digest” and “A.3: orchard_auth_digest”).
Figure 5 draws both trees. The binding of the signatures needs one further assumption, stated at its first use.
No efficient algorithm outputs, except with negligible probability, two
distinct pairs and , each of a -byte personalisation
and an input string, with
Let be a version- transaction, and for a bundle of , of either
pool, let
each is uniform on the non-zero scalars for which
has even -coordinate (§3.1),
and every value of the experiment other than a signature by the holder of
is computed from
the holder of signs under only
, and signs any other message only under
An adversary receives and all other public data, and obtains on request, for messages of its choice, signatures of the key holders under fresh randomisers as in (S); it receives no and no . Under Assumptions 11.9, 2.22 and 7.3, the probability that it outputs an accepted transaction that contains an Action description with validating key for some and whose effecting data differ from those of is negligible.
The signatures thus fix the effecting data: every Action’s , , , , , and , the number and order of the Actions, each bundle’s flags and balancing value, the header, with the consensus branch identifier and the expiry height, and the transparent data. They fix neither the anchor nor the proof of a bundle: for a pair such that verifies on the primary inputs formed with , replacing by changes neither the transaction identifier nor any signed message, so every signature remains valid, and binds as a primary input (Definition 9.2).
Let be the event that the adversary outputs such a . On , let
be the least index for which contains an Action description with
key , and let be the spend-authorisation signature that
carries for it. Since is accepted, is valid under
on
Case : a collision. The digest is computed by the tree of its definition from the effecting data and, when the transaction has transparent inputs, from the values and scripts of the coins that they spend. Each node hashes a string from which its children and its fields are recovered uniquely: its input consists of fixed-length fields and digests, of concatenations of fixed-length per-Action records whose number the length determines, or, for transparent outputs, of records whose variable-length script carries its length; the two nodes that share a personalisation, the transparent digest and the transparent signature digest, hash strings of different lengths (ZIP 244, “TxId Digest” and “Signature Digest”). Compare the trees of and from the root, whose outputs are equal. At a node with equal outputs, either the two (personalisation, input) pairs differ, a collision of , or they agree, and then the node’s children have equal outputs and its fields are equal. The effecting data of and differ, so some field, or some number of records, differs, and descending along the nodes that cover it ends in a collision. An algorithm that runs the experiment, which it can since it samples every key, and performs this descent outputs a collision with probability , which is negligible by Assumption 11.9.
Case : a forgery. An algorithm plays the
adversary of Proposition 7.12. It receives
less a negligible term, where
Anchor and proof. By the definitions above, the anchor and the proof of each bundle are inputs of the authorising-data digest and of no node of or . Replacing them changes neither, and every signature, whose message is , remains valid. The verifier checks the bundle’s proof against the primary inputs formed with the bundle’s anchor field (protocol specification, §“Action Descriptions”), now , so the modified bundle is accepted only if verifies for , and the anchor rule then applies to . □
For keys generated with
The consensus branch identifier enters twice, in the root personalisation and in the header digest, and a consensus rule requires to equal the identifier of the consensus branch under which the transaction is validated (protocol specification, §“Transaction Consensus Rules”; ZIP 244, “txid_digest” and “T.1: header_digest”). Under any other branch a signed transaction either fails that rule or carries another , hence other effecting data, and Proposition 11.10 excludes valid signatures on such a transaction that keeps an Action of , except with negligible probability. A signed transaction is therefore valid under one consensus branch only and cannot be carried across the activation of a network upgrade (ZIP 259, “Backward compatibility”). That the anchors and the proofs are authorising data does not affect this binding, since the header is effecting data.
The Orchard pool and the Ironwood pool each have their own chain state: a note commitment tree (“The Merkle hash and the tree”, §5.1) with its anchors (“Anchors”, §5.2), a nullifier set (“Nullifier sets”, §6.2) and a chain value pool balance, defined below. An Action is checked only against the state of its own pool (ZIP 229, Terminology and Rationale, “Separate state”; protocol specification, §“Nullifier Sets” and §“Note Commitment Trees”).
The Ironwood chain value pool balance of a block chain is the negation of the sum of the fields of all its transactions, and the Orchard chain value pool balance the negation of the sum of their fields, an absent field counting as . The total issued supply is the sum of the balances of all chain value pools of the protocol specification, §“Chain Value Pool Balances”, the transparent pool and the other shielded pools included, computed without overflow (ZIP 209, Terminology and “Specification”).
The consensus rules on the balances are: a block that would make the chain value pool balance of any pool negative is invalid, and a block that would make the total issued supply exceed (§11.2) is invalid (ZIP 209, “Specification”; protocol specification, §“Chain Value Pool Balances”). ZIP 229, Motivation and Privacy Implications, calls this mechanism of ZIP 209 the turnstile, a term that ZIP 258, “Consensus rules from NU6.3 activation”, also uses: the value that a transaction moves across the boundary of a shielded pool is public, as the pool’s balancing value, and the rule on the balances bounds what leaves each pool by what has entered it.
Fix a pool and write each of its balancing values as
The following Orchard-pool rules apply to every transaction, whatever its version (ZIP 258, “Consensus rules from NU6.3 activation”; ZIP 229, “Consensus Rules”).
Cross-address transfers are disabled for every Orchard-pool Action:
bits to of are , so every Orchard-pool
Action has
For every transaction,
Of the two Orchard-protocol pools, therefore, only the Ironwood pool accepts net inflow: a shielding transaction, one whose transparent inputs fund a negative balancing value, can place that negative balancing value, among the Orchard-protocol pools, only in its Ironwood component (ZIP 258, same section; protocol specification, §“Shielded Pools and Notes”).
The coinbase transaction of “The transaction format” (§11.2) is subject to the following rules on the shielded path (protocol specification, §“Transaction Consensus Rules”; ZIP 229, “Consensus Rules”; ZIP 258, “Consensus rules from NU6.3 activation”).
A coinbase transaction has no Orchard-pool Actions.
The bit is in of a
coinbase transaction of version or and in
of a coinbase transaction of version . By condition A8 of
Definition 9.2, under Assumption 9.12, every Action
of a coinbase transaction has, except with negligible probability, an
extracted witness with
Every Ironwood-pool output of a coinbase transaction must decrypt to a note plaintext by the recovery with of “The outgoing ciphertext” (§10.3) under the all-zero outgoing viewing key, the string of zero bytes, so its plaintext is public and its lead byte is , the only lead byte that recovery accepts (ZIP 213, “Specification”; ZIP 258, “Changes to the Protocol Specification”).
Rule (v) is the only check by consensus of the lead byte of an Orchard-protocol output. Every Ironwood-pool output uses the note format of lead byte (“The note seed”, §4.3), and the Action statement does not check the derivation of (Definition 9.2, Remark “What the statement does not check”); for every other output the lead byte is encrypted and the recipient enforces it, decryption returning when the byte is not allowed for the pool (“Trial decryption and note acceptance”, §10.4; protocol specification, §“Decryption using an Incoming Viewing Key (Sapling and Orchard)”).
Figure 6 draws the flows of value that these rules
permit. Value moves between pools only through the transparent transaction
value pool of a transaction (“The balancing value”,
§8.2): transparent inputs and positive balancing values
add to it, transparent outputs and negative balancing values draw from it,
and the value that remains in it is the fee, which the block’s coinbase
transaction collects, less from NU7 the part of the block’s fees removed
from circulation (same section). The Sapling pool, the value pool of Zcash’s
second shielded protocol (§11.3), is not sealed by ZIP 258:
its balancing value , of the same sign convention,
may be positive or negative (protocol specification, §“Balance and Binding
Signature (Sapling)”). A coinbase transaction consumes no Sapling note, no
Orchard-pool note and no Ironwood-pool note of non-zero value, and may pay
transparent outputs, Sapling outputs and Ironwood-pool outputs (protocol
specification, §“Transaction Consensus Rules”; rules (iii) and (iv)). A
transaction that spends a transparent output of a coinbase transaction has
no transparent output (same section), so that value next enters a shielded
pool or the fee. Value leaves the Orchard pool for the Ironwood pool within
one transaction when that transaction has
The rules of ZIP 218, “Shielded pool action limits”, bound the shielded
components of a block. The Orchard-pool Actions of its transactions, counted
by the fields , and their Ironwood-pool Actions,
counted by the fields (ZIP 229, “Transaction
Format”), number each at most
The following procedure extends the single spend of the Crypto Guide’s Example “An Orchard shielded spend” (§“A shielded spend, end to end”) to a bundle with signatures and balance. Its steps follow the order of the preceding sections.
The input is the sender’s keys; the Ironwood-pool notes to consume, with their leaf positions; each recipient’s address, which its holder derives from an incoming viewing key (“Diversified addresses”, §3.3) and hands to the sender; the amounts; and the fee. The sender performs the following steps.
Pairing. For consumed and created notes it forms
Value commitments. For each Action it draws uniformly
from and sets
Randomised keys. For each Action it draws by
and sets
Flags and balance. It sets
Proof. It computes one Halo 2 proof over the instances
with the witnesses of Definition 9.2 (“The Action circuit and the Halo 2 proof”, §9.3). By Assumption 9.12 a prover of an accepted proof knows, for each Action, a witness satisfying A1 to A10; under Assumption 9.15 the proof reveals nothing beyond the instances.
Header. It sets the version to , to the identifier of the consensus branch in force, and (§11.2).
Digest. It computes (“Transaction digests and signatures”, §11.3).
Spend authorisation. For each Action it computes the spend-authorisation signature under on .
Binding signature. It sets
(Protocol specification, §“Sending Notes (Orchard)”, §“Dummy Notes (Orchard)”, §“Spend Authorization Signature (Sapling and Orchard)” and §“Balance and Binding Signature (Orchard)”.)
Steps (10) to (12) depend on neither nor the proof, which are authorising data, so signing can precede proving (ZIP 229, Motivation).
The sender sets . ZIP 218, “Default expiry
delta”, recommends to node implementations that create transactions a
default expiry height blocks above the current height, in place of
blocks before NU7, and ZIP 203, “Changes for NU7”, records the change
without changing the expiry rule. At the -second target spacing stated
in “Anchors” (§5.2) that default spans
The example is numeric only in amounts, fees, value differences, the balancing value, sizes and counts, each the output of a script; every curve point, field element, hash, ciphertext and signature is named and its derivation shown, not evaluated. The subscripts , and mark the sender’s key, the recipient’s key and the dummy spending key.
Amounts. The sender holds one Ironwood-pool note
of ZEC, zatoshi, and pays ZEC,
zatoshi, to a recipient’s address .
One real consumed note and two created notes need
| Action | Action | |
| consumed note | , the sender’s | , a dummy |
| spending key | the sender’s: , , | the dummy key: , , |
| created note | to | , the change, to |
The net values sum to
Public fields. The recipient derives
draws a uniform , derives , and from under lead byte (“The note seed”, §4.3), and sets
(Definition 4.4). With uniform on and drawn by ,
the negative difference read in
(Definition 8.2; “Randomised validating keys”,
§7.2). The anchor is the anchor of a
recent Ironwood-pool block, with the authentication path of
; the path of the dummy is
arbitrary, since A3 exempts
The witnesses of the two Actions satisfy the conditions of
Definition 9.2 as follows, where
is the expanded receiver of the
Action’s consumed note, and are the
incoming viewing keys of the sender’s key and of the dummy key, and
| Action | Action | |
|---|---|---|
| A1 | of is | of the dummy is |
| A2 | is the extracted commitment of , whose is | is that of , whose is |
| A3 | : the path of is valid to | : holds for any path |
| A4 | commits to under | commits to under |
| A5 | is derived under | is derived under |
| A6 | ||
| A7 | ||
| A8 | and | : holds for either flag |
| A9 | and | and |
| A10 | : no constraint | : no constraint |
Signatures, balance and size. The transaction has no transparent
inputs, so equals its transaction identifier
(“Transaction digests and signatures”, §11.3). The
spend-authorisation signatures are under
is the binding signature under on . By Table 9 the Ironwood component has
bytes: the count, the Action descriptions, the flags, the balancing value, the anchor, the proof length, the proof of bytes, the spend-authorisation signatures and the binding signature.
The two views. The verifier receives only the public data: for each
the Action description and , and , the flags byte with
bits , and set,
Each step of the following procedure is tagged with the requirements whose soundness part it serves and with the conditions of Definition 9.2 that it completes, in the pairing of the requirement map, Table 6.
Given the chain state of each pool, a transaction in a block is accepted, as far as its Orchard-protocol components are concerned, if and only if the following checks pass.
Parsing. The version of is or , the versions in
force from NU7 (§11.2), with the version group identifier
of its version, and equals
the identifier of the consensus branch in force. Every field of every
Action description is the canonical encoding of its type
(Table 8): and are
points, is a non-identity point, and and
are integers below ;
Proof. For each pool with Actions, the aggregate proof verifies under the post-NU6.3 verifying key of “The Action circuit and the Halo 2 proof” (§9.3) on the per-Action primary inputs
with and the flags read from the bundle. [R1 to R5, through A1 to A10.]
Anchor rule. Each bundle’s is the root of its pool’s final treestate at an earlier block of the chain (“Anchors”, §5.2). [R2, with A3.]
Nullifier rule. No nullifier repeats within or across the transactions of the chain; the nullifiers of each pool are checked against that pool’s nullifier set (“Nullifier sets”, §6.2). [R3, with A5.]
Spend authorisation. Each Action’s spend-authorisation signature is valid under its on (“Randomised validating keys”, §7.2). [R5, with A6 and A7.]
Balance. For each pool with Actions, the verifier computes
(Protocol specification, §“Transaction Consensus Rules”, §“Action Descriptions”, §“Action Description Encoding and Consensus”, §“RedDSA, RedJubjub, and RedPallas”, §“Action Transfers and their Descriptions”, §“Nullifier Sets”, §“Note Commitment Trees”, §“Balance and Binding Signature (Orchard)” and §“Transactions and Treestates”; ZIP 229, “Consensus Rules”; ZIP 2003, “Specification”; ZIP 259, Abstract.) These are the consensus checks on the Orchard-protocol components of ; the remaining rules of §“Transaction Consensus Rules” concern its other components.
Under Assumption 9.12 the proof yields, for each Action, a witness that satisfies Definition 9.2 for its primary input. Whether is a root that the chain recorded and whether is new are facts about the chain’s history, which no proof over one Action’s data attests; the verifier checks them against its state, in steps (3) and (4). Beyond the parsing of step (1), the fee rule of step (6) and the rules of step (7), validity is thus the conjunction of one proof per bundle, two kinds of signature and these two checks against chain state; apart from the coinbase rule (v) of §11.4, no step decrypts or inspects a note.
On accepting a block, for each pool: every nullifier of the pool’s Actions enters the pool’s nullifier set, so that a later Action that publishes the same nullifier fails step (4); every is appended to the pool’s note commitment tree, in the order of the transactions and, within a transaction, of the Actions, so that the note’s holder can later prove membership against an anchor whose tree contains it; and the chain value pool balance of the pool decreases by each transaction’s balancing value (protocol specification, §“Nullifier Sets”, §“Transactions and Treestates” and §“Chain Value Pool Balances”).
The verifier holds no viewing key and decrypts no Orchard-protocol ciphertext, except for the decryption of Ironwood-pool coinbase outputs under the all-zero outgoing viewing key that “Chain state and pool rules” (§11.4) requires, whose plaintexts are public by that rule (protocol specification, §“Transaction Consensus Rules”; ZIP 213, “Specification”). Its input is the transaction’s public data and the chain state; what those data reveal about the private inputs is the subject of Theorem 12.13 in “Privacy” (§12.4).