The Zcash ArboretumThe Complete Arboretum PDF

11 Transactions and consensus rules

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.

11.1 Action descriptions and bundles

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 P⋆ enters a byte string as the 32 bytes 𝖫𝖤𝖡𝖲𝟤𝖮𝖲𝖯256⁢(P⋆) and is identified with them.

Definition 11.1 (Action description).

The Action description of an Action is the byte string

(𝖼𝗏𝗇𝖾𝗍)⋆⁢‖𝖨𝟤𝖫𝖤𝖮𝖲𝖯256⁢(𝗇𝖿)‖⁢𝗋𝗄⋆⁢‖𝖨𝟤𝖫𝖤𝖮𝖲𝖯256⁢(𝖼𝗆𝗑)‖⁢𝖾𝗉𝗄⋆⁢‖C𝖾𝗇𝖼‖⁢C𝗈𝗎𝗍

of 5⋅32+580+80=820 bytes, whose fields, in this order, are those of Table 6: the net value commitment of Definition 8.2, the nullifier of the consumed note (Definition 6.3), the randomised validating key of “Randomised validating keys” (§7.2), the extracted commitment of the created note (Definition 4.4), and the ephemeral public key and the two ciphertexts of “Encryption to the recipient” (§10.2) and “The outgoing ciphertext” (§10.3) (protocol specification, §“Action Descriptions” and §“Action Description Encoding and Consensus”).

Field Type enforced on parsing Encoding Bytes Constructed in
𝖼𝗏𝗇𝖾𝗍 ℰ⁢(𝔽p𝖯𝖺𝗅𝗅𝖺𝗌), the identity admitted (𝖼𝗏𝗇𝖾𝗍)⋆ 32 Definition 8.2
𝗇𝖿 {0,…,p𝖯𝖺𝗅𝗅𝖺𝗌−1} 𝖨𝟤𝖫𝖤𝖮𝖲𝖯256⁢(𝗇𝖿) 32 Definition 6.3
𝗋𝗄 ℰ⁢(𝔽p𝖯𝖺𝗅𝗅𝖺𝗌); the identity excluded by a separate rule 𝗋𝗄⋆ 32 §7.2
𝖼𝗆𝗑 {0,…,p𝖯𝖺𝗅𝗅𝖺𝗌−1} 𝖨𝟤𝖫𝖤𝖮𝖲𝖯256⁢(𝖼𝗆𝗑) 32 Definition 4.4
𝖾𝗉𝗄 ℰ⁢(𝔽p𝖯𝖺𝗅𝗅𝖺𝗌)∖{𝒪} 𝖾𝗉𝗄⋆ 32 §10.2
C𝖾𝗇𝖼 580-byte string itself 580 §10.2
C𝗈𝗎𝗍 80-byte string itself 80 §10.3
Action description 820
Table 6: The fields of an Action description, in the order of their encoding, with the type that parsing enforces and the byte length of the encoding.

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 p𝖯𝖺𝗅𝗅𝖺𝗌, and neither is checked to be the x-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 64 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 n≥1 Actions publishes:

  1. (i)

    its n Action descriptions;

  2. (ii)

    one anchor 𝑟𝑡 (“Anchors”, §5.2), shared by all n Actions: no Action description carries an anchor, and the transaction carries one anchor field for each pool with Actions, 𝖺𝗇𝖼𝗁𝗈𝗋𝖮𝗋𝖼𝗁𝖺𝗋𝖽 and 𝖺𝗇𝖼𝗁𝗈𝗋𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽;

  3. (iii)

    one flags byte (“Bundle flags”, §9.1), whose bit 0 is 𝖾𝗇𝖺𝖻𝗅𝖾𝖲𝗉𝖾𝗇𝖽𝗌 and bit 1 𝖾𝗇𝖺𝖻𝗅𝖾𝖮𝗎𝗍𝗉𝗎𝗍𝗌, and whose bit 2 is 𝖾𝗇𝖺𝖻𝗅𝖾𝖢𝗋𝗈𝗌𝗌𝖠𝖽𝖽𝗋𝖾𝗌𝗌 in 𝖿𝗅𝖺𝗀𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 and reserved and 0 in 𝖿𝗅𝖺𝗀𝗌𝖮𝗋𝖼𝗁𝖺𝗋𝖽;

  4. (iv)

    the balancing value v𝖻𝖺𝗅𝖺𝗇𝖼𝖾 of “The balancing value” (§8.2);

  5. (v)

    one aggregate proof over its n Actions (“The Action circuit and the Halo 2 proof”, §9.3);

  6. (vi)

    n spend-authorisation signatures, one per Action;

  7. (vii)

    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 s real notes and creates o real notes has n≥max⁡(s,o) Actions, since every Action consumes exactly one note and creates exactly one; its n−s consumed sides and n−o created sides without a real note carry dummy notes of value 0 (Definition “Dummy notes”, §4.4; protocol specification, §“Dummy Notes (Orchard)”). When the consumed value exceeds the payment and the fee, the difference is change: an ordinary created note to an address of the sender, constructed as every other created note.

Refer to caption
Figure 4: The public data of one bundle and the checks that consume them. Rows are the fields: per Action i, the net value commitment 𝖼𝗏𝗇𝖾𝗍, the nullifier 𝗇𝖿, the randomised validating key 𝗋𝗄, the extracted commitment 𝖼𝗆𝗑, the ephemeral key 𝖾𝗉𝗄⋆ and the ciphertexts C𝖾𝗇𝖼 and C𝗈𝗎𝗍 of the Action description, and the spend-authorisation signature σi; per bundle, the flags byte, the balancing value v𝖻𝖺𝗅𝖺𝗇𝖼𝖾, the anchor 𝑟𝑡, the aggregate proof π and the binding signature. Each column ends in the check or derived key that consumes it. A dot joins a field to a column; a row that crosses a column without a dot is not joined to it. Blue rows are effecting data and amber rows authorising data (“Transaction digests and signatures”, §11.3). Every effecting field, the ciphertexts included, joins the signature digest 𝖲𝗂𝗀𝖧𝖺𝗌𝗁, which feeds every spend-authorisation signature and the binding signature; the anchor and the proof do not join it (Proposition 11.10). The fields 𝗇𝖿, 𝖼𝗆𝗑, 𝖼𝗏𝗇𝖾𝗍, 𝗋𝗄, the flags and 𝑟𝑡 are primary inputs of the Action proof; 𝑟𝑡 also feeds the anchor rule, 𝗇𝖿 the nullifier-set rule, 𝗋𝗄 the spend-authorisation signature, and 𝖼𝗏𝗇𝖾𝗍 and v𝖻𝖺𝗅𝖺𝗇𝖼𝖾 the binding validating key 𝖻𝗏𝗄.

11.2 The transaction format

The transaction formats in force are version 5, specified in ZIP 225, and version 6, specified in ZIP 229; a transaction of any other version, version 4 included, is invalid (protocol specification, §“Transaction Consensus Rules”, as amended by ZIP 2003, “Specification”; ZIP 259, Abstract). Of the two Orchard-protocol bundles a version-5 transaction can carry only the Orchard-pool bundle; a transaction with Ironwood-pool Actions is of version 6 (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 2 to 4 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 6.

Construction 11.2 (Version-6 transaction).

A version-6 transaction consists of the fields of the version-5 format up to and including the Orchard component (ZIP 225), followed by the Ironwood component. Its first five fields form the header:

  1. (i)

    𝗁𝖾𝖺𝖽𝖾𝗋, whose bit 31, the 𝖿𝖮𝗏𝖾𝗋𝗐𝗂𝗇𝗍𝖾𝗋𝖾𝖽 flag, is set and whose bits 0 to 30 hold the version, 6;

  2. (ii)

    𝗇𝖵𝖾𝗋𝗌𝗂𝗈𝗇𝖦𝗋𝗈𝗎𝗉𝖨𝖽, which must be 𝟶⁢𝚡⁢𝙳⁢𝟾𝟾𝟺⁢𝙱⁢𝟼𝟿𝟾;

  3. (iii)

    𝗇𝖢𝗈𝗇𝗌𝖾𝗇𝗌𝗎𝗌𝖡𝗋𝖺𝗇𝖼𝗁𝖨𝖽, 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 32-bit consensus branch identifier (ZIP 200, Terminology and “Specification”);

  4. (iv)

    𝗅𝗈𝖼𝗄⁢_⁢𝗍𝗂𝗆𝖾, the transparent lock time, which no rule of this volume uses;

  5. (v)

    𝗇𝖤𝗑𝗉𝗂𝗋𝗒𝖧𝖾𝗂𝗀𝗁𝗍, the expiry height.

In version 6, bits 0 and 1 of 𝖿𝗅𝖺𝗀𝗌𝖮𝗋𝖼𝗁𝖺𝗋𝖽 are named 𝖾𝗇𝖺𝖻𝗅𝖾𝖲𝗉𝖾𝗇𝖽𝗌 and 𝖾𝗇𝖺𝖻𝗅𝖾𝖮𝗎𝗍𝗉𝗎𝗍𝗌, as in 𝖿𝗅𝖺𝗀𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽, and bits 2 to 7 of 𝖿𝗅𝖺𝗀𝗌𝖮𝗋𝖼𝗁𝖺𝗋𝖽 are reserved and must be 0, in version 5 and version 6 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 820-byte Action description of §11.1 (ZIP 229, “Transaction Format” and “Consensus Rules”; protocol specification, §“Transaction Consensus Rules”).

Definition 11.3 (Coinbase transaction).

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. Every block has exactly one (protocol specification, §“Coinbase Transactions”).

The field 𝗇𝖤𝗑𝗉𝗂𝗋𝗒𝖧𝖾𝗂𝗀𝗁𝗍 is 0, which disables expiry, or a block height. The expiry rule is: for a transaction other than a coinbase transaction, 𝗇𝖤𝗑𝗉𝗂𝗋𝗒𝖧𝖾𝗂𝗀𝗁𝗍 is at most 499 999 999, and such a transaction with 𝗇𝖤𝗑𝗉𝗂𝗋𝗒𝖧𝖾𝗂𝗀𝗁𝗍≠0 is invalid in every block of height greater than 𝗇𝖤𝗑𝗉𝗂𝗋𝗒𝖧𝖾𝗂𝗀𝗁𝗍; the 𝗇𝖤𝗑𝗉𝗂𝗋𝗒𝖧𝖾𝗂𝗀𝗁𝗍 of a coinbase transaction equals the height of its block (protocol specification, §“Transaction Consensus Rules”; ZIP 203, “Specification”; ZIP 229, “Transaction Format”). The sender’s choice of the expiry height is stated in “Construction of a transaction” (§11.5).

Definition 11.4 (Ironwood component).

Let n be the number of Ironwood-pool Actions of a version-6 transaction. The Ironwood component is the sequence of the fields of Table 7, in that order. The fields after 𝗇𝖠𝖼𝗍𝗂𝗈𝗇𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 are present if and only if n>0, and an absent 𝗏𝖺𝗅𝗎𝖾𝖡𝖺𝗅𝖺𝗇𝖼𝖾𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 is taken to be 0. A count and a proof length are encoded as compactSize, the variable-length integer encoding of Bitcoin (ZIP 229, “Transaction Format”).

Field Bytes Content
𝗇𝖠𝖼𝗍𝗂𝗈𝗇𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 compactSize the count n
𝗏𝖠𝖼𝗍𝗂𝗈𝗇𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 820⁢n the n Action descriptions of §11.1
𝖿𝗅𝖺𝗀𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 1 bit 0 𝖾𝗇𝖺𝖻𝗅𝖾𝖲𝗉𝖾𝗇𝖽𝗌, bit 1 𝖾𝗇𝖺𝖻𝗅𝖾𝖮𝗎𝗍𝗉𝗎𝗍𝗌, bit 2 𝖾𝗇𝖺𝖻𝗅𝖾𝖢𝗋𝗈𝗌𝗌𝖠𝖽𝖽𝗋𝖾𝗌𝗌, bits 3 to 7 reserved and 0
𝗏𝖺𝗅𝗎𝖾𝖡𝖺𝗅𝖺𝗇𝖼𝖾𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 8 the balancing value, signed 64-bit little-endian
𝖺𝗇𝖼𝗁𝗈𝗋𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 32 the anchor 𝑟𝑡
𝗌𝗂𝗓𝖾𝖯𝗋𝗈𝗈𝖿𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 compactSize the proof length, 2720+2272⁢n
𝗉𝗋𝗈𝗈𝖿𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 2720+2272⁢n the aggregate proof
𝗏𝖲𝗉𝖾𝗇𝖽𝖠𝗎𝗍𝗁𝖲𝗂𝗀𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 64⁢n one spend-authorisation signature per Action, in Action order
𝖻𝗂𝗇𝖽𝗂𝗇𝗀𝖲𝗂𝗀𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 64 the binding signature
Table 7: The Ironwood component of a version-6 transaction with n Ironwood-pool Actions (ZIP 229, “Transaction Format”). The fields after the count are present if and only if n>0.

The consensus rules on the component are: n<216; if n>0, at least one of 𝖾𝗇𝖺𝖻𝗅𝖾𝖲𝗉𝖾𝗇𝖽𝗌 and 𝖾𝗇𝖺𝖻𝗅𝖾𝖮𝗎𝗍𝗉𝗎𝗍𝗌 of 𝖿𝗅𝖺𝗀𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 is 1; bits 3 to 7 of 𝖿𝗅𝖺𝗀𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 are 0; 𝗏𝖺𝗅𝗎𝖾𝖡𝖺𝗅𝖺𝗇𝖼𝖾𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 lies in {−𝖬𝖠𝖷⁢_⁢𝖬𝖮𝖭𝖤𝖸,…,𝖬𝖠𝖷⁢_⁢𝖬𝖮𝖭𝖤𝖸}, where 𝖬𝖠𝖷⁢_⁢𝖬𝖮𝖭𝖤𝖸=2.1⋅1015 zatoshi is a protocol constant (protocol specification, §“Constants”); and 𝗉𝗋𝗈𝗈𝖿𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 has exactly 2720+2272⁢n bytes (ZIP 229, “Consensus Rules”; protocol specification, §“Transaction Consensus Rules” and §“Action Description Encoding and Consensus”). The flags byte differs from 𝖿𝗅𝖺𝗀𝗌𝖮𝗋𝖼𝗁𝖺𝗋𝖽 only in bit 2, which is 𝖾𝗇𝖺𝖻𝗅𝖾𝖢𝗋𝗈𝗌𝗌𝖠𝖽𝖽𝗋𝖾𝗌𝗌 in 𝖿𝗅𝖺𝗀𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 and reserved and 0 in 𝖿𝗅𝖺𝗀𝗌𝖮𝗋𝖼𝗁𝖺𝗋𝖽 (“Bundle flags”, §9.1). The proof length is the one that ZIP 229 fixes; the Halo 2 Guide, §“Halo 2’s specifics: parameters, generators from a hash, the deferred multi-scalar multiplication, and the proof bytes”, paragraph “The bytes”, describes what its constant and its per-Action term cover. For one Action the proof has 2720+2272=4992 bytes.

11.3 Transaction digests and signatures

Write 𝗁⁢(P,x):=BLAKE2b⁢-⁢256⁢(P,x), unkeyed BLAKE2b with a 32-byte output, the 16-byte personalisation P and the input x (§10.2); the personalisation is mixed into the initialisation vector (Crypto Guide, §“Domain separation and personalisation”). For a byte string C and 0≤a≤b≤|C|, the string C[a:b] consists of the bytes a to b−1 of C, counted from 0. Every field enters a digest in its encoding of Table 6 or Table 7, and β denotes the 4-byte little-endian encoding of the consensus branch identifier.

Definition 11.5 (Transaction identifier).

The transaction identifier of a version-6 transaction is

𝗍𝗑𝗂𝖽:=𝗁(ZcashTxHash_∥β,d𝗁𝖽𝗋∥d𝗍𝗋∥d𝖲𝖺𝗉∥d𝖮𝗋𝖼∥d𝖨𝗋𝗐),

the Ironwood digest last, where:

  1. (i)

    the header digest d𝗁𝖽𝗋 is 𝗁 under ZTxIdHeadersHash of the 4-byte little-endian encodings of 𝗁𝖾𝖺𝖽𝖾𝗋, 𝗇𝖵𝖾𝗋𝗌𝗂𝗈𝗇𝖦𝗋𝗈𝗎𝗉𝖨𝖽, 𝗇𝖢𝗈𝗇𝗌𝖾𝗇𝗌𝗎𝗌𝖡𝗋𝖺𝗇𝖼𝗁𝖨𝖽, 𝗅𝗈𝖼𝗄⁢_⁢𝗍𝗂𝗆𝖾 and 𝗇𝖤𝗑𝗉𝗂𝗋𝗒𝖧𝖾𝗂𝗀𝗁𝗍;

  2. (ii)

    the transparent digest d𝗍𝗋 and the Sapling digest d𝖲𝖺𝗉 are those of ZIP 244, “T.2: transparent_digest” and “T.3: sapling_digest”, the latter with the version-6 node of ZIP 229; they cover the transparent inputs and outputs and the Sapling component, the component of Zcash’s second shielded protocol;

  3. (iii)

    for n≥1 Ironwood-pool Actions, with the fields of Action i indexed by i, the Ironwood digest is

    d𝖨𝗋𝗐 :=𝗁⁢(ZTxIdIronwd_H_v6,d𝖢⁢‖d𝖬‖⁢d𝖭⁢‖𝖿𝗅𝖺𝗀𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽‖⁢𝗏𝖺𝗅𝗎𝖾𝖡𝖺𝗅𝖺𝗇𝖼𝖾𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽),
    d𝖷 :=𝗁⁢(P𝖷,r1𝖷⁢‖⋯‖⁢rn𝖷)(𝖷∈{𝖢,𝖬,𝖭}),

    with the compact, memo and non-compact records and personalisations

    ri𝖢 :=𝗇𝖿i∥𝖼𝗆𝗑i∥𝖾𝗉𝗄i⋆∥C𝖾𝗇𝖼,i[0:52], P𝖢 :=ZTxIdIrnActCH_v6,
    ri𝖬 :=C𝖾𝗇𝖼,i[52:564], P𝖬 :=ZTxIdIrnActMH_v6,
    ri𝖭 :=(𝖼𝗏i𝗇𝖾𝗍)⋆∥𝗋𝗄i⋆∥C𝖾𝗇𝖼,i[564:580]∥C𝗈𝗎𝗍,i, P𝖭 :=ZTxIdIrnActNH_v6;

    for n=0 it is d𝖨𝗋𝗐:=𝗁⁢(ZTxIdIronwd_H_v6,ε);

  4. (iv)

    the Orchard digest d𝖮𝗋𝖼 has the same structure over the Orchard-pool Actions, with 𝖿𝗅𝖺𝗀𝗌𝖮𝗋𝖼𝗁𝖺𝗋𝖽 and 𝗏𝖺𝗅𝗎𝖾𝖡𝖺𝗅𝖺𝗇𝖼𝖾𝖮𝗋𝖼𝗁𝖺𝗋𝖽, under the personalisation ZTxIdOrchardH_v6, with the Action digests personalised

    P𝖢=ZTxIdOrcActCHash,P𝖬=ZTxIdOrcActMHash,P𝖭=ZTxIdOrcActNHash;

    without Orchard-pool Actions it is 𝗁⁢(ZTxIdOrchardH_v6,ε).

(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 C𝖾𝗇𝖼 is the ChaCha20 encryption of the 564-byte note plaintext, byte for byte, followed by the 16-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 52-byte prefix of the plaintext, the lead byte, d, v and 𝗋𝗌𝖾𝖾𝖽 (1+11+8+32=52), the encryption of the 512-byte memo, ending at 52+512=564, and the tag. The empty Ironwood digest differs from the empty Orchard digest, since the two personalisations differ. Neither pool digest contains the anchor.

Definition 11.6 (Authorising-data digest; effecting and authorising data).

The authorising-data digest of a version-6 transaction is

𝖺𝗎𝗍𝗁:=𝗁(ZTxAuthHash_∥β,a𝗍𝗋∥a𝖲𝖺𝗉∥a𝖮𝗋𝖼∥a𝖨𝗋𝗐),

where a𝗍𝗋 is the transparent scripts digest and a𝖲𝖺𝗉 the Sapling authorising-data digest (ZIP 244, “Authorizing Data Commitment”; ZIP 229), and, for n≥1 Ironwood-pool Actions,

a𝖨𝗋𝗐:=𝗁(ZTxAuthIrnwdH_v6, 𝗉𝗋𝗈𝗈𝖿𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽∥𝗏𝖲𝗉𝖾𝗇𝖽𝖠𝗎𝗍𝗁𝖲𝗂𝗀𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽
∥𝖻𝗂𝗇𝖽𝗂𝗇𝗀𝖲𝗂𝗀𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽∥𝖺𝗇𝖼𝗁𝗈𝗋𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽),

and a𝖨𝗋𝗐:=𝗁⁢(ZTxAuthIrnwdH_v6,ε) for n=0; the Orchard digest a𝖮𝗋𝖼 has the same structure under ZTxAuthOrchaH_v6. Each Orchard-protocol anchor is committed if and only if its component has Actions. The effecting data of a transaction are the data under the transaction identifier digest; its authorising data are the proofs, the signatures, the anchors and the transparent scripts, the data under the authorising-data digest (ZIP 229, “Ironwood component digest” and “Anchor commitment (version 6)”; ZIP 244, “Authorizing Data Commitment”).

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 6 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 5 and 6 has a version-6 personalisation of its own; the roots keep theirs and hash one more child in version 6. The nodes that omit or include an anchor in version 6 are personalised ZTxIdSSpendNH_v6, ZTxAuthSapliH_v6, ZTxIdOrchardH_v6 and ZTxAuthOrchaH_v6 (ZIP 229, “Ironwood component digest” and “Anchor commitment (version 6)”).

Definition 11.7 (Signature digest).

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:

𝖲𝗂𝗀𝖧𝖺𝗌𝗁:=𝗁(ZcashTxHash_∥β,d𝗁𝖽𝗋∥s𝗍𝗋∥d𝖲𝖺𝗉∥d𝖮𝗋𝖼∥d𝖨𝗋𝗐),

whose header and shielded children are those of 𝗍𝗑𝗂𝖽 and whose child s𝗍𝗋 is the transparent signature digest of ZIP 244, “S.2: transparent_sig_digest”. For a coinbase transaction and for a transaction without transparent inputs, s𝗍𝗋=d𝗍𝗋, so 𝖲𝗂𝗀𝖧𝖺𝗌𝗁=𝗍𝗑𝗂𝖽; otherwise s𝗍𝗋 commits in addition to the values and scripts of the coins that the transparent inputs spend. The digest 𝖲𝗂𝗀𝖧𝖺𝗌𝗁 is the message of every spend-authorisation signature and of each pool’s binding signature, the message left as a parameter in “The RedPallas signature scheme” (§7.1) (ZIP 244, “Signature Digest”; ZIP 229, “Transaction Identifiers, Auth Digests, and Signature Digests”; protocol specification, §“Action Descriptions” and §“Balance and Binding Signature (Orchard)”).

Proposition 8.10, which holds for every message, applies to the binding signature on 𝖲𝗂𝗀𝖧𝖺𝗌𝗁.

Remark 11.8 (Version 5).

In version 5 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

d𝖢⁢‖d𝖬‖⁢d𝖭⁢‖𝖿𝗅𝖺𝗀𝗌𝖮𝗋𝖼𝗁𝖺𝗋𝖽‖⁢𝗏𝖺𝗅𝗎𝖾𝖡𝖺𝗅𝖺𝗇𝖼𝖾𝖮𝗋𝖼𝗁𝖺𝗋𝖽∥𝖺𝗇𝖼𝗁𝗈𝗋𝖮𝗋𝖼𝗁𝖺𝗋𝖽,

with the Action digests of version 6, and the Orchard authorising-data digest, under ZTxAuthOrchaHash, covers the proofs and the signatures only. In version 5 the Orchard anchor is therefore effecting data and fixed by the signatures; the proofs are authorising data in both versions. A version-5 transaction carries Orchard-pool Actions only (ZIP 244, “txid_digest”, “T.4: orchard_digest” and “A.3: orchard_auth_digest”).

Refer to caption
Figure 5: The version-6 transaction identifier (left) and authorising-data digest (right) as trees of personalised BLAKE2b-256 nodes, with the Orchard and Ironwood components expanded (ZIP 244; ZIP 229). Each node hashes the concatenation of its children, in order, under the personalisation shown; the string β encodes the consensus branch identifier. The Action digests d𝖢, d𝖬 and d𝖭 hash the listed fields of every Action of their component, Action after Action; the byte 𝖿𝗅𝖺𝗀𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 is the Ironwood component’s own flags byte. The header, transparent and Sapling digests are not expanded. The signature digest 𝖲𝗂𝗀𝖧𝖺𝗌𝗁 has the root personalisation and the children of 𝗍𝗑𝗂𝖽 (filled squares), except the transparent child (open square), which it replaces by the transparent signature digest. The anchors and the proofs lie under the authorising-data digest only. By Proposition 11.10, the signatures fix every field under 𝗍𝗑𝗂𝖽 and no field under the authorising-data digest.

Figure 5 draws both trees. The binding of the signatures needs one further assumption, stated at its first use.

Assumption 11.9 (Collision resistance of BLAKE2b).

No efficient algorithm outputs, except with negligible probability, two distinct pairs (P,x) and (P′,x′), each of a 16-byte personalisation and an input string, with 𝗁⁢(P,x)=𝗁⁢(P′,x′). The notion is the Crypto Guide’s Definition “Collision resistance” (§“Security notions: preimage, second-preimage, and collision resistance”), read for the unkeyed deployment as that volume’s Remark “Convention: keyed definitions, unkeyed deployments” (§“Hash functions and the random oracle model”, §“Syntax”) prescribes; the personalisation is mixed into the initialisation vector (§“Domain separation and personalisation”), so the pair (P,x) is the hashed input. It is used by Proposition 11.10 and by the consensus-branch binding below.

Proposition 11.10 (Bundle binding).

Let T be a version-6 transaction, and for a bundle of T, of either pool, let 𝗋𝗄1,…,𝗋𝗄n be the randomised validating keys of its Actions, 𝗋𝗄i=[𝗋𝗌𝗄i]⁢G𝖲𝗉𝖾𝗇𝖽𝖠𝗎𝗍𝗁 with 𝗋𝗌𝗄i=𝖺𝗌𝗄i+αi as in “Randomised validating keys” (§7.2), where 𝖺𝗌𝗄i is the spend authorising key of the spending key that authorises Action i. Assume:

  1. (H)

    each 𝖺𝗌𝗄i is uniform on the non-zero scalars a for which [a]⁢G𝖲𝗉𝖾𝗇𝖽𝖠𝗎𝗍𝗁 has even y-coordinate (§3.1), and every value of the experiment other than a signature by the holder of 𝖺𝗌𝗄i is computed from 𝖺𝗄iℙ=[𝖺𝗌𝗄i]⁢G𝖲𝗉𝖾𝗇𝖽𝖠𝗎𝗍𝗁 and from values drawn independently of 𝖺𝗌𝗄i;

  2. (S)

    the holder of 𝖺𝗌𝗄i signs under 𝗋𝗌𝗄i only 𝖲𝗂𝗀𝖧𝖺𝗌𝗁⁢(T), and signs any other message only under 𝖺𝗌𝗄i+α for a fresh randomiser α drawn by 𝖦𝖾𝗇𝖱𝖺𝗇𝖽𝗈𝗆.

An adversary receives T 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 𝖺𝗌𝗄i and no 𝗋𝗌𝗄i. Under Assumptions 11.9, 2.22 and 7.3, the probability that it outputs an accepted transaction T′ that contains an Action description with validating key 𝗋𝗄i for some i and whose effecting data differ from those of T is negligible.

The signatures thus fix the effecting data: every Action’s 𝗇𝖿, 𝖼𝗆𝗑, 𝖼𝗏𝗇𝖾𝗍, 𝗋𝗄, 𝖾𝗉𝗄, C𝖾𝗇𝖼 and C𝗈𝗎𝗍, 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).

Proof.

Let E be the event that the adversary outputs such a T′. On E, let i be the least index for which T′ contains an Action description with key 𝗋𝗄i, and let σ′ be the spend-authorisation signature that T′ carries for it. Since T′ is accepted, σ′ is valid under 𝗋𝗄i on m′:=𝖲𝗂𝗀𝖧𝖺𝗌𝗁⁢(T′) (“Randomised validating keys”, §7.2). Let m:=𝖲𝗂𝗀𝖧𝖺𝗌𝗁⁢(T), and split E into E=, where m′=m, and E≠, where m′≠m.

Case E=: 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 T and T′ 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 T and T′ 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 Pr⁢[E=], which is negligible by Assumption 11.9.

Case E≠: a forgery. An algorithm ℬ plays the adversary of Proposition 7.12. It receives Y=[x]⁢G𝖲𝗉𝖾𝗇𝖽𝖠𝗎𝗍𝗁 for x uniform on 𝔽p𝖵𝖾𝗌𝗍𝖺, with access to 𝖧 and to the signing oracle, and draws i∗ uniformly from {1,…,n}. If Y=𝒪 or Y has odd y-coordinate, it stops; otherwise, an event of probability (p𝖵𝖾𝗌𝗍𝖺−1)/(2⁢p𝖵𝖾𝗌𝗍𝖺), the point Y has the distribution that (H) gives to 𝖺𝗄i∗ℙ, and ℬ sets 𝖺𝗄i∗ℙ:=Y. It computes every other value of the experiment as (H) permits, in particular the proof of T, whose witness (Definition 9.2) contains 𝖺𝗄ℙ and α but not 𝖺𝗌𝗄; it draws every randomiser by 𝖦𝖾𝗇𝖱𝖺𝗇𝖽𝗈𝗆 itself; it obtains each signature by the holder of 𝖺𝗌𝗄i∗, on m and on the adversary’s requests, as the oracle’s answer on the pair (α,M); and it produces the other signatures with keys it holds. The adversary’s view is then that of the experiment. On E≠ with i=i∗, ℬ outputs (𝗋𝗄i∗,m′,σ′) with the randomiser αi∗, of its own choice, as part (ii) of Proposition 7.12 admits. The oracle answered under the key 𝗋𝗄i∗ only on m, except when a randomiser drawn for a request equals αi∗, which has negligible probability by the lemma on the distance of 𝖦𝖾𝗇𝖱𝖺𝗇𝖽𝗈𝗆 from uniform (§7.2); outside that event the output is a forgery. The index i∗ is independent of the adversary’s view, so ℬ forges with probability at least

p𝖵𝖾𝗌𝗍𝖺−12⁢p𝖵𝖾𝗌𝗍𝖺⋅Pr⁢[E≠]n

less a negligible term, where n<216. By Proposition 7.12(ii), under Assumptions 2.22 and 7.3, Pr⁢[E≠] is negligible.

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 𝑟𝑡′. □

Remark 11.11 (Hypothesis (H) for honest keys).

For keys generated with 𝗎𝗌𝖾⁢_⁢𝗊𝗌𝗄=𝖿𝖺𝗅𝗌𝖾 from uniform spending keys, hypothesis (H) holds up to a negligible change in the probability of every efficiently decidable event, in particular of the event of Proposition 11.10, which an algorithm holding the keys decides by verifying T′ and comparing its effecting data with those of T. By Lemma 2.15 (Assumption 2.12) the triple (𝖺𝗌𝗄,𝗇𝗄,𝗋𝗂𝗏𝗄) is indistinguishable from independent uniform elements; the sign normalisation of “The spending key and the spend-side secrets” (§3.1) maps a uniform non-zero 𝖺𝗌𝗄 to the uniform distribution on the set of (H); and rejection, by Lemma “Rejection in key generation” (§3.2), costs a negligible term under Assumptions 2.12, 2.22 and 2.8. A dummy spend uses such a key (Definition “Dummy notes”, §4.4).

Remark 11.12 (Consensus-branch binding).

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 T 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 T, 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.

11.4 Chain state and pool rules

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”).

Definition 11.13 (Chain value pool balances).

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 0. 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”).

Remark 11.14 (Outflow bound).

Fix a pool P and write each of its balancing values as v=v+−v− with v+:=max⁡(v,0) and v−:=max⁡(−v,0). The chain value pool balance of P is ∑v−−∑v+, summed over the transactions of the chain, so the rule that it is non-negative at every block states that at every block the net value that has left P through positive balancing values, ∑v+, is at most the net value that entered it through negative ones, ∑v−. Value created inside P by a failure of soundness can therefore leave P only up to the value recorded as having entered it (ZIP 209, “Specification”).

The following Orchard-pool rules apply to every transaction, whatever its version (ZIP 258, “Consensus rules from NU6.3 activation”; ZIP 229, “Consensus Rules”).

  1. (i)

    Cross-address transfers are disabled for every Orchard-pool Action: bits 2 to 7 of 𝖿𝗅𝖺𝗀𝗌𝖮𝗋𝖼𝗁𝖺𝗋𝖽 are 0, so every Orchard-pool Action has 𝖾𝗇𝖺𝖻𝗅𝖾𝖢𝗋𝗈𝗌𝗌𝖠𝖽𝖽𝗋𝖾𝗌𝗌=0 and primary input 𝖽𝗂𝗌𝖺𝖻𝗅𝖾𝖢𝗋𝗈𝗌𝗌𝖠𝖽𝖽𝗋𝖾𝗌𝗌=1 (“Bundle flags”, §9.1), and the verifying key that consensus selects for every Action enforces condition A10 of Definition 9.2. The meaning of A10 and its pool-level effect are those stated at A10 in “The Action statement” (§9.2).

  2. (ii)

    For every transaction, 𝗏𝖺𝗅𝗎𝖾𝖡𝖺𝗅𝖺𝗇𝖼𝖾𝖮𝗋𝖼𝗁𝖺𝗋𝖽≥0: net value may leave the Orchard pool and never enter it, so the Orchard chain value pool balance never increases.

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”).

  1. (iii)

    A coinbase transaction has no Orchard-pool Actions.

  2. (iv)

    The bit 𝖾𝗇𝖺𝖻𝗅𝖾𝖲𝗉𝖾𝗇𝖽𝗌 is 0 in 𝖿𝗅𝖺𝗀𝗌𝖮𝗋𝖼𝗁𝖺𝗋𝖽 of a coinbase transaction of version 5 or 6 and in 𝖿𝗅𝖺𝗀𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 of a coinbase transaction of version 6. By condition A8 of Definition 9.2, under Assumption 9.11, every Action of a coinbase transaction has, except with negligible probability, an extracted witness with v𝗈𝗅𝖽=0: a coinbase transaction consumes no note of non-zero value. The rule concerns coinbase transactions only; every other transaction may spend Ironwood-pool notes.

  3. (v)

    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 32 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)”).

The rules of ZIP 218, “Shielded pool action limits”, bound per block the number of Orchard-pool Actions and a shielded budget that counts them together with the descriptions of the other shielded protocols; they do not mention Ironwood-pool Actions, which a version-6 transaction counts in the separate field 𝗇𝖠𝖼𝗍𝗂𝗈𝗇𝗌𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 (ZIP 229, “Transaction Format”). These are block-level rules, outside the Action statement.

11.5 Construction of a transaction

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.

Construction 11.15 (Ironwood-pool bundle).

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.

  1. (1)

    Pairing. For s consumed and o created notes it forms n≥max⁡(s,o) Actions (§11.1). A dummy consumed note comes from a fresh uniformly random spending key, with value 0, a uniform 𝗋𝗌𝖾𝖾𝖽, ρ=𝖤𝗑𝗍𝗋𝖺𝖼𝗍ℙ of a uniform Pallas point and an arbitrary authentication path; a dummy created note has value 0 and a random address (Definition “Dummy notes”, §4.4).

  2. (2)

    Anchor. It takes as 𝑟𝑡 the root of the Ironwood tree’s final treestate at a recent block, at the depth that “Anchors” (§5.2) recommends, and computes the authentication path of each real consumed note from public data (Lemma 5.15).

  3. (3)

    Created notes. For each Action it computes 𝗇𝖿𝗈𝗅𝖽 of the consumed note by Definition 6.3, sets ρ𝗇𝖾𝗐:=𝗇𝖿𝗈𝗅𝖽 (“Nullifier chaining”, §6.3), draws a fresh uniform 32-byte 𝗋𝗌𝖾𝖾𝖽, derives 𝖾𝗌𝗄, ψ𝗇𝖾𝗐 and 𝗋𝖼𝗆𝗇𝖾𝗐 under lead byte 𝟶⁢𝚡⁢𝟶𝟹 as in “The note seed” (§4.3), redrawing 𝗋𝗌𝖾𝖾𝖽 when 𝖾𝗌𝗄=0 or 𝖼𝗆𝗑=⊥, and computes 𝖼𝗆𝗇𝖾𝗐 by Definition 4.4 and 𝖼𝗆𝗑:=𝖤𝗑𝗍𝗋𝖺𝖼𝗍ℙ⁢(𝖼𝗆𝗇𝖾𝗐).

  4. (4)

    Value commitments. For each Action it draws 𝗋𝖼𝗏 uniformly from 𝔽p𝖵𝖾𝗌𝗍𝖺 and sets 𝖼𝗏𝗇𝖾𝗍:=[v𝗈𝗅𝖽−v𝗇𝖾𝗐]⁢V𝖮𝗋𝖼𝗁𝖺𝗋𝖽+[𝗋𝖼𝗏]⁢R𝖮𝗋𝖼𝗁𝖺𝗋𝖽 (Definition 8.2).

  5. (5)

    Randomised keys. For each Action it draws α by 𝖦𝖾𝗇𝖱𝖺𝗇𝖽𝗈𝗆 and sets 𝗋𝗌𝗄:=𝖺𝗌𝗄+α and 𝗋𝗄:=𝖺𝗄ℙ+[α]⁢G𝖲𝗉𝖾𝗇𝖽𝖠𝗎𝗍𝗁 (“Randomised validating keys”, §7.2), with 𝖺𝗌𝗄 and 𝖺𝗄ℙ of the consumed note’s spending key, the dummy key for a dummy spend.

  6. (6)

    Flags and balance. It sets 𝖾𝗇𝖺𝖻𝗅𝖾𝖲𝗉𝖾𝗇𝖽𝗌=𝖾𝗇𝖺𝖻𝗅𝖾𝖮𝗎𝗍𝗉𝗎𝗍𝗌=1, and 𝖾𝗇𝖺𝖻𝗅𝖾𝖢𝗋𝗈𝗌𝗌𝖠𝖽𝖽𝗋𝖾𝗌𝗌=1 whenever some Action’s created note pays an expanded receiver other than that of its consumed note (condition A10 of Definition 9.2); it sets v𝖻𝖺𝗅𝖺𝗇𝖼𝖾:=∑(v𝗈𝗅𝖽−v𝗇𝖾𝗐) over the Actions, and chooses the created values so that the fee is the value left in the transparent transaction value pool (“The balancing value”, §8.2).

  7. (7)

    Proof. It computes one Halo 2 proof over the n instances

    (𝑟𝑡,𝖼𝗏𝗇𝖾𝗍,𝗇𝖿𝗈𝗅𝖽,𝗋𝗄,𝖼𝗆𝗑,𝖾𝗇𝖺𝖻𝗅𝖾𝖲𝗉𝖾𝗇𝖽𝗌,𝖾𝗇𝖺𝖻𝗅𝖾𝖮𝗎𝗍𝗉𝗎𝗍𝗌,1−𝖾𝗇𝖺𝖻𝗅𝖾𝖢𝗋𝗈𝗌𝗌𝖠𝖽𝖽𝗋𝖾𝗌𝗌)

    with the witnesses of Definition 9.2 (“The Action circuit and the Halo 2 proof”, §9.3). By Assumption 9.11 a prover of an accepted proof knows, for each Action, a witness satisfying A1 to A10; under Assumption 9.14 the proof reveals nothing beyond the instances.

  8. (8)

    Encryption. For each Action it computes 𝖾𝗉𝗄:=[𝖾𝗌𝗄]⁢𝗀𝖽, C𝖾𝗇𝖼 and C𝗈𝗎𝗍 as in “Encryption to the recipient” (§10.2) and “The outgoing ciphertext” (§10.3).

  9. (9)

    Header. It sets the version to 6, 𝗇𝖢𝗈𝗇𝗌𝖾𝗇𝗌𝗎𝗌𝖡𝗋𝖺𝗇𝖼𝗁𝖨𝖽 to the identifier of the consensus branch in force, and 𝗇𝖤𝗑𝗉𝗂𝗋𝗒𝖧𝖾𝗂𝗀𝗁𝗍 (§11.2).

  10. (10)

    Digest. It computes 𝖲𝗂𝗀𝖧𝖺𝗌𝗁 (“Transaction digests and signatures”, §11.3).

  11. (11)

    Spend authorisation. For each Action it computes the spend-authorisation signature under 𝗋𝗌𝗄 on 𝖲𝗂𝗀𝖧𝖺𝗌𝗁.

  12. (12)

    Binding signature. It sets 𝖻𝗌𝗄:=∑𝗋𝖼𝗏modp𝖵𝖾𝗌𝗍𝖺 and 𝖻𝗏𝗄:=∑𝖼𝗏𝗇𝖾𝗍−[v𝖻𝖺𝗅𝖺𝗇𝖼𝖾]⁢V𝖮𝗋𝖼𝗁𝖺𝗋𝖽, checks 𝖻𝗏𝗄=[𝖻𝗌𝗄]⁢R𝖮𝗋𝖼𝗁𝖺𝗋𝖽, which the protocol specification recommends to the signer, and computes the binding signature under 𝖻𝗌𝗄 on 𝖲𝗂𝗀𝖧𝖺𝗌𝗁 (“The binding signature”, §8.3).

(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 120 blocks above the current height (ZIP 203, “Specification”), which at the 25-second target spacing stated in “Anchors” (§5.2) is 120×25=3000 seconds, 50 minutes. The consensus rule is the expiry rule of “The transaction format” (§11.2).

Example 11.16 (A two-Action payment).

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 n1𝗈𝗅𝖽 of 7 ZEC, 700 000 000 zatoshi, and pays 5 ZEC, 500 000 000 zatoshi, to a recipient’s address 𝖺𝖽𝖽𝗋𝖱. One real consumed note and two created notes need max⁡(1,2)=2 Actions, hence two logical actions, and the conventional fee of “The balancing value” (§8.2) is 5000⋅max⁡(2,2)=10 000 zatoshi. The change is 700 000 000−500 000 000−10 000=199 990 000 zatoshi. The following table pairs the notes into Actions.

Action 1 Action 2
consumed note n1𝗈𝗅𝖽, the sender’s n2𝗈𝗅𝖽, a dummy
spending key the sender’s: 𝖺𝗌𝗄𝖲, 𝖺𝗄𝖲ℙ, 𝗇𝗄𝖲 the dummy key: 𝖺𝗌𝗄𝖣, 𝖺𝗄𝖣ℙ, 𝗇𝗄𝖣
vi𝗈𝗅𝖽 700 000 000 0
created note n1𝗇𝖾𝗐 to 𝖺𝖽𝖽𝗋𝖱 n2𝗇𝖾𝗐, the change, to 𝖺𝖽𝖽𝗋𝖲
vi𝗇𝖾𝗐 500 000 000 199 990 000
vi𝗈𝗅𝖽−vi𝗇𝖾𝗐 200 000 000 −199 990 000

The net values sum to 𝗏𝖺𝗅𝗎𝖾𝖡𝖺𝗅𝖺𝗇𝖼𝖾𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽=200 000 000+(−199 990 000)=10 000 zatoshi, the fee. The transaction has no transparent inputs or outputs, so the fee is the whole value remaining in its transparent transaction value pool.

Public fields. The recipient derives 𝖺𝖽𝖽𝗋𝖱=(d𝖱,𝗉𝗄𝖽),𝖱 from its incoming viewing key (“Diversified addresses”, §3.3) and gives it to the sender; 𝖺𝖽𝖽𝗋𝖲 is an address of the sender’s own key. Write (𝗀𝖽,,1𝗉𝗄𝖽),1 and (𝗀𝖽,,2𝗉𝗄𝖽),2 for the expanded receivers of 𝖺𝖽𝖽𝗋𝖱 and 𝖺𝖽𝖽𝗋𝖲, and 𝗇𝗄1:=𝗇𝗄𝖲, 𝗇𝗄2:=𝗇𝗄𝖣. For i=1,2 the sender computes, from the consumed note’s fields (ρi𝗈𝗅𝖽,ψi𝗈𝗅𝖽,𝖼𝗆i𝗈𝗅𝖽),

𝗇𝖿i𝗈𝗅𝖽 :=𝖣𝖾𝗋𝗂𝗏𝖾𝖭𝗎𝗅𝗅𝗂𝖿𝗂𝖾𝗋𝗇𝗄i⁢(ρi𝗈𝗅𝖽,ψi𝗈𝗅𝖽,𝖼𝗆i𝗈𝗅𝖽) (Definition 6.3),
ρi𝗇𝖾𝗐 :=𝗇𝖿i𝗈𝗅𝖽 (§6.3),

draws a uniform 𝗋𝗌𝖾𝖾𝖽i, derives 𝖾𝗌𝗄i, ψi𝗇𝖾𝗐 and 𝗋𝖼𝗆i𝗇𝖾𝗐 from 𝗋𝗌𝖾𝖾𝖽i under lead byte 𝟶⁢𝚡⁢𝟶𝟹 (“The note seed”, §4.3), and sets

𝖼𝗆i𝗇𝖾𝗐 :=𝖭𝗈𝗍𝖾𝖢𝗈𝗆𝗆𝗂𝗍𝗋𝖼𝗆i𝗇𝖾𝗐(𝗀𝖽∥,i⋆𝗉𝗄𝖽∥,i⋆LE64(vi𝗇𝖾𝗐)∥LE255(ρi𝗇𝖾𝗐)∥LE255(ψi𝗇𝖾𝗐)),
𝖼𝗆𝗑i :=𝖤𝗑𝗍𝗋𝖺𝖼𝗍ℙ⁢(𝖼𝗆i𝗇𝖾𝗐)

(Definition 4.4). With 𝗋𝖼𝗏i uniform on 𝔽p𝖵𝖾𝗌𝗍𝖺 and αi drawn by 𝖦𝖾𝗇𝖱𝖺𝗇𝖽𝗈𝗆,

𝖼𝗏1𝗇𝖾𝗍 :=[200 000 000]⁢V𝖮𝗋𝖼𝗁𝖺𝗋𝖽+[𝗋𝖼𝗏1]⁢R𝖮𝗋𝖼𝗁𝖺𝗋𝖽, 𝗋𝗄1 :=𝖺𝗄𝖲ℙ+[α1]⁢G𝖲𝗉𝖾𝗇𝖽𝖠𝗎𝗍𝗁,
𝖼𝗏2𝗇𝖾𝗍 :=[−199 990 000]⁢V𝖮𝗋𝖼𝗁𝖺𝗋𝖽+[𝗋𝖼𝗏2]⁢R𝖮𝗋𝖼𝗁𝖺𝗋𝖽, 𝗋𝗄2 :=𝖺𝗄𝖣ℙ+[α2]⁢G𝖲𝗉𝖾𝗇𝖽𝖠𝗎𝗍𝗁,

the negative difference read in 𝔽p𝖵𝖾𝗌𝗍𝖺 (Definition 8.2; “Randomised validating keys”, §7.2). The anchor 𝑟𝑡 is the anchor of a recent Ironwood-pool block, with the authentication path of 𝖤𝗑𝗍𝗋𝖺𝖼𝗍ℙ⁢(𝖼𝗆1𝗈𝗅𝖽); the path of the dummy is arbitrary, since A3 exempts v2𝗈𝗅𝖽=0. The flags are 𝖾𝗇𝖺𝖻𝗅𝖾𝖲𝗉𝖾𝗇𝖽𝗌=𝖾𝗇𝖺𝖻𝗅𝖾𝖮𝗎𝗍𝗉𝗎𝗍𝗌=𝖾𝗇𝖺𝖻𝗅𝖾𝖢𝗋𝗈𝗌𝗌𝖠𝖽𝖽𝗋𝖾𝗌𝗌=1, because both created notes pay expanded receivers other than those of their Actions’ consumed notes (A10). One proof π covers the instances (𝑟𝑡,𝖼𝗏i𝗇𝖾𝗍,𝗇𝖿i𝗈𝗅𝖽,𝗋𝗄i,𝖼𝗆𝗑i,1,1,0) for i=1,2. Finally 𝖾𝗉𝗄i:=[𝖾𝗌𝗄i]𝗀𝖽,i, C𝖾𝗇𝖼,i encrypts the plaintext of ni𝗇𝖾𝗐 to its receiver, and C𝗈𝗎𝗍,i is formed under the sender’s 𝗈𝗏𝗄 (“Encryption to the recipient”, §10.2; “The outgoing ciphertext”, §10.3).

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 σ1 under 𝗋𝗌𝗄1=𝖺𝗌𝗄𝖲+α1 and σ2 under 𝗋𝗌𝗄2=𝖺𝗌𝗄𝖣+α2, both on 𝖲𝗂𝗀𝖧𝖺𝗌𝗁. The binding signing key is 𝖻𝗌𝗄:=𝗋𝖼𝗏1+𝗋𝖼𝗏2modp𝖵𝖾𝗌𝗍𝖺, and

𝖻𝗏𝗄 =𝖼𝗏1𝗇𝖾𝗍+𝖼𝗏2𝗇𝖾𝗍−[10 000]⁢V𝖮𝗋𝖼𝗁𝖺𝗋𝖽
=[200 000 000−199 990 000−10 000]⁢V𝖮𝗋𝖼𝗁𝖺𝗋𝖽+[𝖻𝗌𝗄]⁢R𝖮𝗋𝖼𝗁𝖺𝗋𝖽=[𝖻𝗌𝗄]⁢R𝖮𝗋𝖼𝗁𝖺𝗋𝖽;

𝖻𝗂𝗇𝖽𝗂𝗇𝗀𝖲𝗂𝗀𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽 is the binding signature under 𝖻𝗌𝗄 on 𝖲𝗂𝗀𝖧𝖺𝗌𝗁. By Table 7 the Ironwood component has

1+2⋅820+1+8+32+3+(2720+2272⋅2)+2⋅64+64=9141

bytes: the count, the Action descriptions, the flags, the balancing value, the anchor, the proof length, the proof of 7264 bytes, the spend-authorisation signatures and the binding signature.

The two views. The verifier receives only the public data: for each i the Action description (𝖼𝗏i𝗇𝖾𝗍,𝗇𝖿i𝗈𝗅𝖽,𝗋𝗄i,𝖼𝗆𝗑i,𝖾𝗉𝗄i,C𝖾𝗇𝖼,i,C𝗈𝗎𝗍,i) and σi, and 𝑟𝑡, the flags byte with bits 0, 1 and 2 set, 𝗏𝖺𝗅𝗎𝖾𝖡𝖺𝗅𝖺𝗇𝖼𝖾𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽=10 000, π and 𝖻𝗂𝗇𝖽𝗂𝗇𝗀𝖲𝗂𝗀𝖨𝗋𝗈𝗇𝗐𝗈𝗈𝖽. It runs the procedure of “Verification of a transaction” (§11.6). What these data reveal is the subject of Theorem 12.12 in “Privacy” (§12.4). The recipient trial-decrypts every output with its incoming viewing key. On output 1 it recovers the plaintext (𝟶⁢𝚡⁢𝟶𝟹,d𝖱,500 000 000,𝗋𝗌𝖾𝖾𝖽1,𝗆𝖾𝗆𝗈), re-derives the note with ρ=𝗇𝖿1𝗈𝗅𝖽 of the same Action, checks 𝖾𝗉𝗄1 and 𝖼𝗆𝗑1, and records the leaf position of 𝖼𝗆𝗑1 (“Trial decryption and note acceptance”, §10.4); the sender recovers the change note of output 2 in the same way. Either note is later consumed by the procedure of this subsection.

11.6 Verification of a transaction

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 5.

Construction 11.17 (Verification).

Given the chain state of each pool, a transaction T in a block is accepted, as far as its Orchard-protocol components are concerned, if and only if the following checks pass.

  1. (1)

    Parsing. The version of T is 5 or 6, 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 6): 𝖼𝗏𝗇𝖾𝗍 and 𝗋𝗄 are points, 𝖾𝗉𝗄 is a non-identity point, and 𝗇𝖿 and 𝖼𝗆𝗑 are integers below p𝖯𝖺𝗅𝗅𝖺𝗌; 𝗋𝗄≠𝒪; every signature encoding is canonical as RedPallas validation requires (§7.1); and each component satisfies the rules of “The transaction format” (§11.2) on its count, its reserved flag bits, its flags, the range of its balancing value and the length of its proof. The transaction T has a transparent input, a Spend description in its Sapling component or an Orchard-protocol bundle with 𝖾𝗇𝖺𝖻𝗅𝖾𝖲𝗉𝖾𝗇𝖽𝗌=1, and it has a transparent output, an Output description in its Sapling component or an Orchard-protocol bundle with 𝖾𝗇𝖺𝖻𝗅𝖾𝖮𝗎𝗍𝗉𝗎𝗍𝗌=1, where Spend and Output descriptions are the Sapling component’s descriptions of a consumed and of a created note.

  2. (2)

    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

    (𝑟𝑡,𝖼𝗏𝗇𝖾𝗍,𝗇𝖿,𝗋𝗄,𝖼𝗆𝗑,𝖾𝗇𝖺𝖻𝗅𝖾𝖲𝗉𝖾𝗇𝖽𝗌,𝖾𝗇𝖺𝖻𝗅𝖾𝖮𝗎𝗍𝗉𝗎𝗍𝗌,1−𝖾𝗇𝖺𝖻𝗅𝖾𝖢𝗋𝗈𝗌𝗌𝖠𝖽𝖽𝗋𝖾𝗌𝗌),

    with 𝑟𝑡 and the flags read from the bundle. [R1 to R5, through A1 to A10.]

  3. (3)

    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.]

  4. (4)

    Nullifier rule. No nullifier repeats within T 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.]

  5. (5)

    Spend authorisation. Each Action’s spend-authorisation signature is valid under its 𝗋𝗄 on 𝖲𝗂𝗀𝖧𝖺𝗌𝗁 (“Randomised validating keys”, §7.2). [R5, with A6 and A7.]

  6. (6)

    Balance. For each pool with Actions, the verifier computes 𝖻𝗏𝗄:=∑𝖼𝗏𝗇𝖾𝗍−[v𝖻𝖺𝗅𝖺𝗇𝖼𝖾]⁢V𝖮𝗋𝖼𝗁𝖺𝗋𝖽 over the pool’s Actions and checks the binding signature under 𝖻𝗏𝗄 on 𝖲𝗂𝗀𝖧𝖺𝗌𝗁 (“The binding signature”, §8.3; Crypto Guide, §“Binding signatures as a proof of knowledge of a discrete logarithm”); and the fee, the value remaining in the transparent transaction value pool, is non-negative (“The balancing value”, §8.2), a coinbase transaction satisfying instead the coinbase rule of the protocol specification, §“Transaction Consensus Rules”, which balances its outputs against the block subsidy and the fees of the block’s other transactions. [R4, with A4.]

  7. (7)

    Pool rules. The rules of “Chain state and pool rules” (§11.4), the expiry rule of “The transaction format” (§11.2) and the capacity rule of each pool’s note commitment tree (“The Merkle hash and the tree”, §5.1) hold.

(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 T; the remaining rules of §“Transaction Consensus Rules” concern its other components.

Remark 11.18 (Division of the checks).

Under Assumption 9.11 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.

Construction 11.19 (State update).

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.12 in “Privacy” (§12.4).