This section constructs the in-band delivery of a created note: its plaintext, its encryption to the recipient by one-shot Diffie–Hellman on the diversified base, the outgoing ciphertext keyed from and the Action’s own public fields, and the trial decryption and acceptance checks by which a recipient obtains a note consistent with the published . It states the two assumptions that note encryption adds, proves decryption correctness, confidentiality and key privacy of the encryption to the recipient, confidentiality of the outgoing ciphertext, and the consistency of accepted notes, and states what each key tier can decrypt.
Every Action carries, beside the extracted commitment of its created note, a note ciphertext . The component encrypts the plaintext of the created note so that the holder of the recipient’s incoming viewing key recovers the note and its memo from the chain alone (protocol specification, §“In-band secret distribution (Sapling and Orchard)” and §“Action Descriptions”). The component lets the sender, or any party that holds the outgoing viewing key under which it was formed, recover the same plaintext (§10.3). The fields , and are not inputs of the Action statement (Definition 9.2), which therefore does not constrain them; the checks that make a decrypted note consistent with are made by the recipient (§10.4).
Let a created note have recipient address and value . Its note plaintext is the tuple , encoded as the byte string
where is one byte, the format version of “The note seed” (§4.3), equal to for an Ironwood-pool output; is the -bit diversifier of the address ( bytes); occupies bytes; is the -byte note seed; and is a -byte string chosen by the sender, whose use is by agreement between sender and recipient (protocol specification, §“Note Plaintexts and Memo Fields” and §“Encodings of Note Plaintexts and Memo Fields”). The encoding has the fixed length bytes, so the length of a ciphertext carries no information about the plaintext.
The plaintext omits , , and . The recipient computes , takes from the same Action (“Nullifier chaining”, §6.3), and derives and from (§4.3).
For each output the sender draws uniformly from the -byte strings, independently of every other output. The ephemeral secret key of this section is
derived in “The note seed” (§4.3) together with and . The sender redraws when or , so (protocol specification, §“Sending Notes (Orchard)”; ZIP 2005, “Changes to the Protocol Specification”, §4.7.3).
Let be the recipient’s address, its diversified base (“Diversified addresses”, §3.3), and as in §10.1. A star encoding enters a byte string as the bytes (§2.1), with which it is identified below. The sender computes the ephemeral public key, the shared secret and the encryption key
with unkeyed BLAKE2b with a -byte output and the -byte personalisation , and the ciphertext . The pair , denotes ChaCha20-Poly1305 encryption and decryption under the -bit key with the all-zero -bit nonce and empty associated data; decryption returns when the tag does not verify (Crypto Guide, §“The ChaCha20-Poly1305 AEAD”, Construction “ChaCha20-Poly1305”). The Action publishes the -byte field and , of bytes, the plaintext and the -byte tag (protocol specification, §“Encryption (Sapling and Orchard)”, §“Orchard Key Agreement”, §“Orchard Key Derivation” and §“Symmetric Encryption”).
The key agreement is Diffie–Hellman on Pallas: public keys are non-identity points, private keys lie in , and both the derivation of a public key from a base and the agreement are scalar multiplication (protocol specification, §“Orchard Key Agreement”). A consensus rule requires to be the canonical encoding of a non-identity Pallas point (protocol specification, §“Action Descriptions”). The fixed nonce is safe because every key encrypts once: depends on the fresh of its output, and the key of is derived separately (§10.3). The scheme is the Crypto Guide’s Construction “DH-based hybrid public-key encryption” (§“Hybrid public-key encryption”) over the per-address base in place of a fixed generator, as the same volume records for deployed note delivery (§“Shielded-note delivery as deployed hybrid encryption”).
Let be an address of the incoming viewing key , so (§3.3), and let with . Then
Hence the holder of computes from the published and obtains , and a party that knows obtains the same shared secret as .
In the cyclic Pallas group , so . The recipient decodes , and because the star encoding is canonical (§2.1) it re-encodes to the published bytes. The function is deterministic and both parties apply it to , so they derive the same ; correctness of ChaCha20-Poly1305 gives . This is the Crypto Guide’s Theorem “Correctness of hybrid encryption” (§“Hybrid public-key encryption”) over the base . □
In security arguments the key-derivation function (BLAKE2b-256 personalised Zcash_OrchardKDF), the function (BLAKE2b-256 personalised Zcash_Orchardock, constructed in §10.3), and on inputs with leading byte , the derivation of from , are modelled as independent random oracles (Crypto Guide, §“The random oracle model”, Definition “Random oracle”). The PRF assumption (Assumption 2.12) does not suffice for the last: it requires a key unknown to the adversary, whereas the plaintext that encrypts contains , the key from which , and hence , is derived. On its other inputs is used only under Assumption 2.12. The assumption is a heuristic about BLAKE2b, not a theorem; every result that uses , or the derivation of names it.
For a uniform -bit key that encrypts a single plaintext, ChaCha20-Poly1305 with the all-zero nonce and empty associated data is
confidential: the encryptions of any two plaintexts of equal length are computationally indistinguishable; and
integral: no efficient adversary without the key outputs a ciphertext, other than one it was given, that decrypts to a value other than .
The Crypto Guide’s Theorem “Security of ChaCha20-Poly1305” (§“The ChaCha20-Poly1305 AEAD”) derives both, with explicit bounds, from the pseudorandomness of ChaCha20. The protocol specification requires one-time INT-CTXT and IND-CPA security of the scheme, properties (b) and (a) above (Crypto Guide, Definitions “Ciphertext integrity, INT-CTXT” and “CPA security”, §“Authenticated encryption with associated data” and §“Chosen-plaintext security”; protocol specification, §“Symmetric Encryption”). The scheme is not key-committing: a party that chooses two keys can construct one ciphertext that decrypts validly under both (Crypto Guide, §“The ChaCha20-Poly1305 AEAD”, Remark “Wrong-key rejection and key commitment”). No result of this volume relies on the tag against a sender who chooses the key.
Let a key be generated honestly with . An efficient adversary receives the address of the key at an index of its choice and data that an efficient algorithm computes independently of the key and of ; it chooses a value , a memo and . An output to with these values and is formed as in §10.1 and the construction above, with uniform, and is the extracted commitment of its note. Then the triple is computationally indistinguishable from , where is a uniform non-identity Pallas point and is the encryption of a fixed -byte string under an independent uniform key. The hypotheses are Assumptions 3.16, 10.4, 10.5, 2.8 (for ), 3.13 (for the joint distribution of and ) and 2.12 (for the dependence of on ), together with Assumption 2.22 for Lemma “Rejection in key generation” (§3.2).
Since and are computed from neither the plaintext nor the address, the pair reveals neither the plaintext, included, nor the recipient’s address: given two addresses of independent keys, the data may contain the second, and the ciphertext is indistinguishable from one independent of both. The value is included so that the result applies within an Action. Of the hypotheses only Assumption 3.16, used through the computational Diffie–Hellman problem that it implies, concerns the one-shot key agreement between and ; Assumptions 10.4 and 10.5 concern the hash functions and the cipher. The adversary is passive: the volume does not claim indistinguishability of encryptions against an adversary that may also obtain decryptions of ciphertexts of its choice other than the challenge, before and after receiving it (IND-CCA2), which the protocol specification, §“Key Derivation”, requires of the scheme.
The proof is a sequence of games (Crypto Guide, §“Security as a game”, Remark “Game-hopping”); each reduction below runs the adversary and the rest of the game. Let be the event that the adversary queries the oracle of Assumption 10.4 for at an input keyed by .
Preliminary step. As in the proof of Proposition 3.18, the key is replaced by a single draw without rejection and its triple by independent uniform elements (Lemma 2.15, Assumption 2.12; Lemma “Rejection in key generation”, §3.2, Assumptions 2.22 and 2.8). Then is replaced by (Assumption 3.13; the reduction draws and itself). Now , and is, independently of , with probability and otherwise uniform on the set of -coordinates of non-identity points, of elements, except on the negligible event (Lemma “Distribution of ”, §3.2). The redraw of is replaced by a single trial, at the cost of the redraw probability, negligible as in the proof of Proposition 4.8.
(1) By Assumption 10.4, is of a random-oracle output at an input keyed by . It is replaced by an independent uniform element of . The oracle’s value at that input is used nowhere else, so the games are identical until occurs; they differ by at most in the new game plus the reduction distance of , below , and for the value (Crypto Guide, §“Security as a game”, Remark “Game-hopping”; §2.3).
(2) The key is replaced by an independent uniform key. The games differ only on the event that the adversary queries the oracle at , and solves the computational Diffie–Hellman instance . This is the game hop of the Crypto Guide’s Theorem “Passive security of hybrid encryption” (§“Hybrid public-key encryption”), with loss factor the number of queries, run over . A distinguisher for Assumption 3.16 receives with uniform on and uniform. It answers each new query of under the domain z.cash:Orchard-gd with for a fresh uniform , recorded, a uniform point as in the model of Assumption 2.8, so that with known. It sets , which embeds as , and , which embeds as ; it draws and , computes , and under a uniform key itself, and answers the other oracles lazily. It then decodes the first bytes of a uniformly chosen query to a point and outputs exactly when . The simulation differs from the game only when in the game, or or in the simulation, of total probability at most . On a Diffie–Hellman triple therefore outputs with probability at least ; on a random triple the point is, for , uniform and independent of the view, and outputs with probability at most . An algorithm that computes Diffie–Hellman secrets on Pallas thus decides DDH, and for the advantage of . The exponent embedded as is uniform on in Assumption 3.16. Against the computational Diffie–Hellman problem with a uniform exponent on , which lies in with probability and on those instances gives an exact simulation, the same reduction loses a factor , about (proof of Proposition 3.18, part (d)).
(3) Now with uniform on is a uniform non-identity point for every generator , and the context contains no key of the recipient (Crypto Guide, §“Key privacy”, Remark “What key privacy buys upstairs”). The ciphertext is an encryption under a uniform key used once, and Assumption 10.5(a) replaces by the fixed string; the reduction obtains from its challenger and computes the rest. The last game outputs .
(4) In the last game enters the view only through , that is through under the leading bytes and . A distinguisher with oracle access to or to a random function computes from its oracle, runs the adversary, and outputs when some key of a query at a leading byte satisfies equal to its oracle’s answer at that input. It outputs with probability at least in the first case. In the second the view depends on that answer only through , and the trapdoor , of the independent answer at the input, is within of uniform; by Proposition 4.5(a), is therefore independent of that answer up to , for the probability that the hash point of is , negligible as in the proof of Proposition 4.8. The distinguisher thus outputs with probability at most , for such queries, and in the last game is negligible under Assumption 2.12 (with Lemma 2.15). Every reduction of hops (2) and (3) draws itself and detects , so each hop changes the probability of by at most its own cost. Hence is negligible in the game of hop (1) as well, and the sum of the costs of all hops is negligible.
The DDH hybrid of the Crypto Guide’s Theorem “ElGamal is key-private under DDH” (§“Key privacy”) is not used: as stated it embeds a uniform exponent of as the recipient’s key, whereas is not uniform on ; and the factor- argument above transfers a search problem such as computational Diffie–Hellman, not a decision problem, since on instances outside a distinguisher’s output is unconstrained. □
The sender chooses an outgoing viewing key of its own, such as that of the address whose note the Action consumes (“Viewing keys”, §3.2), or . If , the outgoing cipher key is
where is the Action’s net value commitment (Definition 8.2) and its extracted note commitment (Definition 4.4), and the outgoing plaintext is the -byte string . If , the sender draws uniformly from the -bit strings and uniformly from the -byte strings. In both cases , of bytes, and the Action publishes it; with no outgoing viewing key recovers it (protocol specification, §“Encryption (Sapling and Orchard)”, §“Sending Notes (Orchard)” and §“Pseudo Random Functions”).
For an Ironwood-pool output, the holder of
computes from and the Action’s public , and , and decrypts under to the outgoing plaintext , rejecting ;
parses as a -byte string followed by a -byte string , and reads as the integer , rejecting , and as the point , rejecting and ;
computes , and , rejecting ;
rejects unless ;
with of the same Action, rejects unless
computes , then , then under from , , , and , by steps (iv) and (v) of the derivation of §4.3;
rejects if the note commitment of (Definition 4.4) is or its -coordinate differs from , or if ;
otherwise returns the note and .
The order and , then , then is forced because depends on all three. The specification’s decryption sections still use the legacy derivation of ; ZIP 2005 specifies the reordered procedure (protocol specification, §“Decryption using an Outgoing Viewing Key (Sapling and Orchard)”; ZIP 2005, “Changes to the Protocol Specification”, §4.20.2 and §4.20.3). The specification’s further check that re-encodes holds for every string that decodes, the star encoding being canonical (§2.1). For the specification’s procedure rejects only ; the rejection of in step (ii) makes the returned a transmission key of Definition “Note” (§4.1).
The key is a function of the Action’s own , and . A ciphertext that a party without copies into an Action whose differ is decrypted by the holder of under a key that, by Assumption 10.4, is uniform and independent of the copied ciphertext; by Assumption 10.5(b) that decryption returns except with negligible probability. A copied is therefore rejected, not attributed to the other Action.
Let the sending key be generated honestly with . To an efficient party that holds neither its nor its , and may hold its , , and , each ciphertext that the holder of the key forms is computationally indistinguishable, jointly with every other public field of its Action, from the encryption of a fixed -byte string under an independent uniform key. The hypotheses are Assumptions 2.12, 3.13, 10.4, 10.5, 9.14, 2.22 and 2.8.
As in the preliminary step of the proof of Proposition 10.6, the key is replaced by a single draw without rejection and its triple by independent uniform elements (Lemma 2.15, Assumption 2.12; Lemma “Rejection in key generation”, §3.2, Assumptions 2.22 and 2.8). After this step, Assumption 3.13 makes indistinguishable from a uniform -byte string independent of and ; the reduction draws and itself, obtains from its challenger, computes every other field, and simulates the Action proof, whose witness contains , under Assumption 9.14. Then is a random-oracle output (Assumption 10.4) at an input that the party queries with negligible probability, hence uniform, and distinct Actions give distinct inputs, their differing except with negligible probability, so each encrypts once; Assumption 10.5(a) then applies. With , is uniform by construction. The ciphertext thus reveals nothing about . □
A holder of recovers, for every output sent under that , the pair , hence the shared secret (Proposition 10.3), , the note plaintext and the recipient’s address ; in this way the sender, or a party to whom the sender discloses , reads outgoing notes (protocol specification, §“Decryption using an Outgoing Viewing Key (Sapling and Orchard)”). By this route it reads only outputs sent under that . Detecting the notes sent to the key’s own addresses by trial decryption requires (§10.4), and yields no (Proposition 3.18, “Capability separation”, part (c), for keys generated with ).
No public field of an Action names its recipient, so the holder of an incoming viewing key attempts every output: it computes , rejecting , which consensus excludes, then , and (protocol specification, §“Decryption using an Incoming Viewing Key (Sapling and Orchard)”). A result other than is a candidate, not an accepted note.
The same serves the outputs of both pools, since keys and addresses are defined for the Orchard protocol, not for a pool (§3.4), and an address does not name a pool (ZIP 326, “Scanning for Ironwood-pool and Orchard-pool notes”); the pool of an output is that of the bundle that carries it. For an honestly produced ciphertext under a key independent of the trial key, decryption returns except with negligible probability (Assumption 10.5(b); Crypto Guide, §“The ChaCha20-Poly1305 AEAD”, Remark “Wrong-key rejection and key commitment”); against a sender who chooses the keys the tag gives no such guarantee.
Given a candidate of an Ironwood-pool output, the recipient accepts only if every check passes:
, the recipient’s enforcement of the lead-byte rule of “The note seed” (§4.3);
with of the same Action and , the note is re-derived in the order
with the -byte string of §4.3 formed from , , , and ;
the note commitment of the re-derived note (Definition 4.4) is not and .
The accepted note is , with (ZIP 2005, “Changes to the Protocol Specification”, §4.20.2 and §4.20.3; protocol specification, §“Decryption using an Incoming Viewing Key (Sapling and Orchard)” and §“Note Plaintexts and Memo Fields”).
The order in (ii) is forced because depends on , and ; the recovery with of §10.3 follows the same order. The specification’s decryption sections still use the legacy derivation of ; ZIP 2005 specifies both reordered procedures. The specification’s check holds for every output of .
The Action statement (Definition 9.2) does not constrain . Check (iii) makes the recipient accept only an formed on the base of the diversifier in the plaintext. Without it a sender could agree the key with one address of a recipient while naming the diversifier of another, and link the two addresses by observing whether the recipient accepts (ZIP 212, “Motivation”).
The Action statement takes and as witnesses and does not check their derivation from (Definition 9.2). An accepted Ironwood-pool note has, by checks (i), (ii) and (iv), and derived under and the commitment . For a coinbase output, consensus runs the recovery with of §10.3 under the all-zero (“Chain state and pool rules”, §11.4), which checks the lead byte and the whole derivation. For every other output, these recipient checks are the only check of the note format.
Orchard-pool outputs carry lead byte and use the legacy trapdoor derivation of the protocol specification, §“Sending Notes (Orchard)”; the recipient decrypts them with the same under that byte and derivation (§“Note Plaintexts and Memo Fields”), on which this volume does not rely.
Let the acceptance procedure accept an Ironwood-pool output with note .
The note is addressed to , an address of the recipient’s key; it has of the same Action; and its and are derived from its under .
The extracted commitment of satisfies .
For every efficient sender, which may choose , , and the keys under which they are formed, the probability that the recipient accepts while the sender outputs a note with is negligible, under the binding of note commitments (Proposition 4.5), hence under Assumptions 2.22 and 2.8. In particular, under Assumption 9.11, the committed values and the trapdoor of the created note that an extractor recovers from the Action proof, which satisfy condition A2 of the Action statement (Definition 9.2), are and modulo , those of , except with negligible probability.
Parts (a) and (b) hold by construction: acceptance requires checks (i), (ii) and (iv), and check (iv) recomputes the commitment of deterministically and compares its -coordinate with , whatever the ciphertext and whichever key decrypted it. The address is an address of the key because is a permutation of the -bit strings, so every is the diversifier of one index (§3.3).
(c) Consider the algorithm that generates the recipient’s key, runs the sender, runs the acceptance procedure on its output, and outputs and the sender’s . When the recipient accepts, opens by (b), so an with gives two distinct notes with equal extracted commitments other than , which Proposition 4.5(b) excludes except with negligible probability. For the particular case, the extractor of Assumption 9.11 run on the sender is such a sender-side algorithm, with an opening of the committed values and a trapdoor in place of a note. Outside the negligible -weakened case of condition A2, which yields an input on which returns (Proposition 2.24(iii)), its opening satisfies . Step 2 of the proof of Proposition 4.5(b), which uses Proposition 2.24(ii) and the fact that , then gives and except with negligible probability, and determines because the encoding is injective. The proof uses neither the integrity of ChaCha20-Poly1305 nor key commitment, which the scheme lacks (Assumption 10.5): a ciphertext valid under two keys yields under each a candidate that must still pass check (iv). □
On acceptance the recipient records with its note position, the index of among the leaves of the note commitment tree of the output’s pool, fixed by the order in which the chain appends extracted commitments (“The Merkle hash and the tree”, §5.1; protocol specification, §“Note Commitment Trees”). The position determines the authentication path, which the recipient computes from public data (Lemma 5.15) and which, with the opening of the leaf (Proposition 10.15), a later Action consuming requires (conditions A1 and A3 of Definition 9.2).
The key tiers of Proposition 3.18 (“Capability separation”) have the following powers over note ciphertexts, for keys generated with .
Incoming tier. A holder of the incoming viewing key , of which trial decryption and acceptance use only , detects and reads every note sent to any address of the key, value and memo included. It cannot compute the nullifiers of these notes, which require , and yields neither nor (Proposition 3.18(b)). It cannot link a published nullifier to one of them, for notes with pairwise distinct (Proposition 6.10), so the nullifier sets alone do not show it which are consumed; and it cannot authorise a spend.
Full-viewing tier. A holder of the full viewing key derives and (“Viewing keys”, §3.2). It detects and reads incoming notes as above, and reads the outputs sent under its (§10.3), not those sent under or another outgoing viewing key. With it computes the nullifier of each accepted note (Definition 6.3) and detects its consumption by the membership of in the nullifier set of the note’s pool (“Nullifier sets”, §6.2; protocol specification, §“Decryption using an Incoming Viewing Key (Sapling and Orchard)”, notes). It cannot spend, since it yields no (Proposition 3.18(a)). For each unspent note the owner thus holds the note, its position, its authentication path and its nullifier, the consumed-note inputs of an Action (Definition 9.2); spending authority is .