This section fixes the encodings and the primitive instances on which the later constructions rest, each with its Orchard parameters and domain separators. The underlying constructions belong to the Math Guide and the Crypto Guide and are cited, not re-derived; each named assumption is stated at the first construction whose security needs it.
The Pallas group is the group of points of the curve over the prime field , with identity . It has prime order and cofactor , and is both its scalar field and the base field of the Vesta curve (Math Guide, §“Base fields, scalar fields, and the Pasta cycle” and §“Pallas and Vesta assembled”, Example “The Pasta curves”; Crypto Guide, §“Instantiation on elliptic curves; the Pasta curves”, Definition “The Pasta curves”). The group, its order and the cycle with Vesta are cited, not re-derived; the moduli are those of the protocol specification, §“Pallas and Vesta”. Table 1 maps this notation, once, to the names used by the specification and by the lower volumes. Those names appear in the table only; later text writes only the column headed “This volume”. Maps defined on the Pallas group carry the specification’s subscript , as in .
| Object | This volume | Specification | Lower volumes |
|---|---|---|---|
| Pallas base-field modulus | |||
| Pallas scalar-field modulus, Vesta base-field modulus, order of the Pallas group | |||
| Pallas base field and scalar field | , | , | , |
| Pallas group | |||
| -bit little-endian encoding of an integer | — | ||
| Encoding of a point | — | ||
| Sinsemilla short commitment | — | ||
| Spend validating key, as a point and as its -coordinate | , | , | — |
Scalar multiplication is written , for or an integer read modulo . The symbol denotes concatenation of bit strings or of byte strings, and the empty string. Byte-string literals and tags are set in monospace, as in z.cash:Orchard, and single bytes as . The symbol is the failure value of a partial map; a map that may fail takes values in for its codomain .
Both moduli have bit length , and :
Two consequences are used later. First, the integer representative of an element of either field lies in and has a -bit encoding, which leaves the top bit of a -bit string free. Second, the integer representative of an element of lies in ; reading it as a Pallas scalar is therefore an injective, not a surjective, map . This map is used wherever a base-field element multiplies a point (§3.3, §6.1).
For and an integer , the -bit little-endian encoding is the bit sequence with . The map is a bijection with inverse . A field element is encoded through its integer representative in , for the modulus. In the conversion names below, stands for integer, for little-endian, for bit string, and for octet string (a sequence of eight-bit bytes). The digit is read “to”, and stands for primitive, a basic conversion operation. The subscript counts bits, not bytes. Three maps relate integers, bit strings and byte strings:
the map sends to its -byte little-endian encoding;
for a multiple of , the map sends a -byte string to the integer ;
the map pads its input on the right with zero bits to a multiple of bits, packs each group of bits into a byte, least significant bit first, and keeps the order of the groups.
Hence . The byte form is needed wherever a bit string enters BLAKE2b or (protocol specification, §“Integers, Bit Sequences, and Endianness”).
The widths used later are (the Merkle layer tag, §5.1), (the note value, §4.2), (the diversifier index, §3.3), (field elements) and (the star encoding below; the key encoding of , §3.2).
The map is
Its lifting maps to and agrees with on points (protocol specification, §“Coordinate Extractor for Pallas”).
The map supplies a field element wherever a later construction needs one in place of a point: the field element (§3.1), the extracted note commitment (§4.2), the node values of the note commitment tree (§5.1) and the nullifier (§6.1). It is two-to-one on non-identity points, by Lemma 2.4 and because for in a group of odd order; every binding argument over an extracted coordinate treats the opposite point explicitly.
For , if and only if .
If , then by definition. A point would satisfy in , but is a quadratic non-residue modulo (Math Guide, §“Quadratic residues and the Euler criterion”, Example “ is a non-square in the Pallas base field”). Hence no point other than has extracted coordinate . □
For , if and only if or .
Negation is and (Math Guide, §“Explicit affine formulas”, Definition “Negation”), so for every , which is the reverse implication. For the forward implication let . If , then , and Lemma 2.3 gives . If , then by Lemma 2.3, so and with ; hence and . □
For the star encoding is
with and read as integer representatives: the -bit -coordinate fills the low bits and the parity of the top bit. The partial inverse reads the first bits of as and the last bit as the sign bit , and returns
the failure value if ; otherwise let ;
the identity if and ;
the failure value if is not a square in ;
otherwise the point with and
The encoding is canonical: for every point , and implies . For the first claim, decodes to at step 2. A point has (Lemma 2.3), and because a point with has order , which a group of odd order does not contain (Math Guide, §“Torsion, the cofactor, and prime-order subgroups”, Remark “No two-torsion on the Pasta curves”). The two square roots are therefore non-zero and, being odd, of opposite parities, so step 4 returns . For the second claim, a string decoded at step 2 is , and a string decoded at step 4 to has low bits and top bit , so it equals . Consequently is injective, each point has exactly one valid encoding, and every other string decodes to , among them (whose -part is and sign bit ) and every string whose -part is at least . The star encoding is the form in which a point enters a hash or a commitment as a bit string.
For byte strings (the domain separator) and (the message), the point is computed as follows.
The map expands by over BLAKE2b-512 into two -byte strings. BLAKE2b runs with zero personalisation; the string , followed by a byte carrying its length, is part of the hashed input. Each string is read as a big-endian integer and reduced modulo , giving .
The simplified Shallue–van de Woestijne–Ulas map sends each to a point of a curve -isogenous to Pallas.
The output is the image of under the -isogeny onto Pallas.
No cofactor is cleared, since the Pallas group has prime order. The isogenous curve, the isogeny coefficients and the constant of the map are those of the protocol specification, §“Group Hash into Pallas and Vesta”, and are not reproduced. The map is deterministic, public and efficiently computable (Crypto Guide, §“Hashing to a field element”, Construction “Expand-then-reduce”; §“Hashing to a curve point”, Constructions “Simplified Shallue–van de Woestijne–Ulas map” and “The hash-to-curve pipeline”, Remark “The isogeny detour forced by -invariant ”).
A domain separator is a fixed ASCII byte string naming a use site; it is the first argument of , so that distinct uses draw distinct generators. A fixed generator is the value of on a public, fixed pair . It is nothing-up-my-sleeve: the public pair determines it, and no party chose it (Crypto Guide, §“Hashing to a curve point”, Construction “Nothing-up-my-sleeve generators”). The strings are fixed by the protocol specification.
In security arguments is modelled as a random oracle on pairs with values in (Crypto Guide, §“The random oracle model”, Definition “Random oracle”, with the group in place of bit strings): distinct pairs receive independent uniform points. In particular the fixed generators of Table 2 are, in the model, independent uniform points. The assumption is a heuristic about the concrete map, supported by its design for indifferentiability from a random oracle (protocol specification, §“Group Hash into Pallas and Vesta”, note); it is not a theorem. Every later binding, collision, uniqueness or unlinkability result that needs it names it.
Table 2 lists every input of the Orchard protocol, with the object it defines and the section that uses it. The messages G, K, v and r are one-byte ASCII strings, and the Sinsemilla messages are the ASCII strings shown. The rows are those of the protocol specification, §“Spend Authorization Signature (Sapling and Orchard)”, §“Computing values and Nullifiers”, §“ and Hash Functions”, §“Sinsemilla Hash Function”, §“Sinsemilla commitments”, §“ Hash Function” and §“Homomorphic Pedersen commitments (Sapling and Orchard)”.
| Domain separator | Message | Object | Used in |
|---|---|---|---|
| z.cash:Orchard | G | , spend-authorisation base | §3.1, §7.1 |
| z.cash:Orchard | K | , nullifier base | §6.1 |
| z.cash:Orchard-gd | for a diversifier | §3.3 | |
| z.cash:Orchard-gd | if the row above gives | §3.3 | |
| z.cash:SinsemillaQ | z.cash:Orchard-NoteCommit-M | hash base of | §4.2 |
| z.cash:Orchard-NoteCommit-r | blinding base of | §4.2 | |
| z.cash:SinsemillaQ | z.cash:Orchard-CommitIvk-M | hash base of | §2.4 |
| z.cash:Orchard-CommitIvk-r | blinding base of | §2.4 | |
| z.cash:SinsemillaQ | z.cash:Orchard-MerkleCRH | hash base of | §5.1 |
| z.cash:Orchard-cv | v | , value base | §8.1 |
| z.cash:Orchard-cv | r | , randomness base | §8.1 |
| z.cash:SinsemillaS | table entry , | §2.4 |
The pairs of Table 2 are pairwise distinct, and the map from to the input hashed by is injective, because is closed by a byte carrying its length. Under Assumption 2.8 the table’s generators are therefore independent, and a relation found in one context transfers to no other (Crypto Guide, §“Domain separation and personalisation”, Proposition “Domain separation yields independent oracles”). The Crypto Guide’s inventory of Orchard tags and personalisations in the same section is cited, not repeated.
A keyed family of functions is a pseudorandom function (PRF) if no efficient adversary with adaptive oracle access distinguishes , for a secret uniform key , from a uniformly random function with the same domain and range, except with negligible advantage (Crypto Guide, §“Pseudorandom functions and permutations”, Definition “Pseudorandom function”).
For a key and a byte string ,
a -byte string, identified with ; here is unkeyed BLAKE2b with a -byte output, the -byte personalisation and the input . A key given as a -byte string enters as is. The key is thus carried in the message, not in BLAKE2b’s native keyed mode (protocol specification, §“Pseudo Random Functions”), so the Crypto Guide’s PRF argument for native keying (§“PRFs from hash functions: length extension and keyed BLAKE2”) does not cover this construction; Assumption 2.12 states the property directly. The key is written as a subscript; the leading byte of names the derived quantity (protocol specification, §“Pseudo Random Functions”).
For uniform on , the function from byte strings to is a PRF in the sense of the preceding definition. This is the security requirement that the protocol specification, §“Pseudo Random Functions”, places on .
For uniform on , the statistical distance of from the uniform distribution on is at most , and that of from the uniform distribution on at most (Math Guide, §“Uniform sampling and the bias of modular reduction”, Proposition “Bias of modular reduction”, with ). Both bounds are below .
Every later use of derives one quantity as
where the lead byte , the key , the remainder of the input and the reduction , or no reduction, form one row of Table 3. Each row’s objects are defined in the section it names (protocol specification, §“Orchard Key Components” for , , and ; §“Sending Notes (Orchard)” for , and ).
| Key | Remainder | Output | Section | ||
|---|---|---|---|---|---|
| §3.1 | |||||
| §3.1 | |||||
| §3.1 | |||||
| none | §3.2 | ||||
| §4.3 | |||||
| §4.3 | |||||
| §4.3 |
Let be uniform on and used only as a key. Let an efficient algorithm choose, possibly adaptively, pairwise distinct inputs , in particular inputs with pairwise distinct leading bytes, and receive the answers. Under Assumption 2.12, the answers are computationally indistinguishable from independent uniform elements of . Consequently, for reductions , the answers are computationally indistinguishable from independent uniform elements of the target fields, up to an additional statistical distance of at most the sum of the reduction distances. For a key within statistical distance of uniform, both conclusions hold with added.
One hybrid replaces by a uniformly random function; the distinguishing advantage changes by at most the PRF advantage of the algorithm that runs the given one and forwards its queries to its own oracle (Assumption 2.12; adaptive queries are within the definition, Crypto Guide, §“Pseudorandom functions and permutations”, Remark “Necessity of adaptivity”). A random function, sampled lazily, answers each new input with a fresh uniform value, so its answers on pairwise distinct inputs are independent and uniform, also when each input depends on earlier answers. For the reduced answers, replacing each of a fresh uniform string by a fresh uniform field element changes the distribution of the whole interaction by at most the reduction distance of ; summing over bounds the total by the triangle inequality, and the post-processing by the algorithm does not increase it (Math Guide, §“Statistical distance”, Theorem “Properties of statistical distance”). A key within statistical distance of uniform changes the interaction, a function of the key and the algorithm’s coins, by at most , by the same theorem. □
The hypothesis of Lemma 2.15 holds for the spending key , and for towards an adversary that sees only through outputs; the note plaintext, which contains , is treated in §10.2. It does not hold for the row , whose key encodes the trapdoor , which is also used in ; that row is covered by Assumption 3.13 in §3.2. The lemma is used in §3.1, in Lemma “Rejection in key generation” (§3.2), in Propositions 3.18, 3.17, 4.8, 6.10 and 10.6, in Proposition “Confidentiality of the outgoing ciphertext” (§10.3), in Theorems 12.9 and 12.12, and in Remark “Hypothesis (H) for honest keys” (§11.3).
Each hash is defined at its construction site. BLAKE2b-512 with personalisation Zcash_ExpandSeed serves (this subsection); BLAKE2b-512 without personalisation serves inside (§2.2); personalised BLAKE2b-512 serves the RedPallas hash (§7.1); BLAKE2b-256 serves the note-encryption key derivation and the outgoing cipher key (§10.2, §10.3); BLAKE2b serves the transaction and signature digests (§11.3); Sinsemilla serves , and (§2.4); Poseidon serves the nullifier PRF, constructed with the nullifier (§6.1). The personalisations of , the note-encryption key derivation and the outgoing cipher key are those of the Crypto Guide’s inventory (§“PRFs from hash functions: length extension and keyed BLAKE2”, Remark “Zcash’s use of keyed and personalised BLAKE2”); every personalisation is stated at its construction.
The Crypto Guide, §“Sinsemilla: an algebraic hash-based commitment”, Construction “Sinsemilla hash”, fixes the chunk width (written there, where counts the pieces), the table and the domain base
for a byte string , and the accumulator; it writes for the four-byte encoding . The Orchard instance adds the following (protocol specification, §“Sinsemilla Hash Function”).
The chunk bound is the largest integer with ; thus , and a message has at most bits.
Incomplete addition on returns if either operand is ; for points it returns in an exceptional case, when an operand is or the operands have equal -coordinates (equal or opposite points), and their group sum otherwise (Math Guide, §“Explicit affine formulas”, Remark “Complete versus incomplete addition”).
For a byte string and a bit string of length at most , let , pad with zero bits to bits, split the result into -bit pieces, and let be of the -th piece, . Then
and . The output is exactly when some incomplete addition meets an exceptional case.
The extracted hash is
For a byte string , a bit string of length at most and a trapdoor , let
Then, with complete group addition,
(protocol specification, §“Sinsemilla commitments”). The domain is routed to the hash as and to the blinding base as with the empty message. The Crypto Guide constructs the commitment with a generic independent blinding generator (§“Sinsemilla: an algebraic hash-based commitment”, Construction “SinsemillaCommit”); the routing and the case are the Orchard additions.
The unblinded is deterministic and therefore not hiding; is its blinded counterpart. Proposition 2.24 and Lemma 2.26 state the security of both.
| Instance | Form | Domain | Message bits | Chunks |
|---|---|---|---|---|
| z.cash:Orchard-MerkleCRH | ||||
| z.cash:Orchard-NoteCommit | ||||
| z.cash:Orchard-CommitIvk |
For and ,
a -bit message (protocol specification, §“Sinsemilla commitments”). Its output is exactly when returns ; it is exactly when the commitment point is (Lemma 2.3); otherwise it is the -coordinate of a non-identity point, an element of and hence, since , a non-zero Pallas scalar. The -coordinates of non-identity points form a set of elements, by Lemma 2.4 and because a group of odd prime order has no point with . The incoming viewing key of §3.2 is this instance applied to with trapdoor ; the exclusion of the outputs and by key generation is stated there.
Sinsemilla is used for its cost inside an arithmetic circuit with lookups, one table lookup and two incomplete additions over per -bit chunk (Crypto Guide, §“Sinsemilla: an algebraic hash-based commitment”, Remark “Why Sinsemilla exists: cost inside a proof”; Halo 2 Guide, §“The lookup argument” and §“From statement to circuit: arithmetisation in practice”), and its collision resistance reduces to discrete logarithms on Pallas together with modelled as a random oracle, not to discrete logarithms alone.
For every classical probabilistic polynomial-time algorithm, given a generator of and for uniform in , the probability of outputting is negligible (Crypto Guide, §“The discrete logarithm problem”, Definition “Discrete logarithm problem, DLP”, instantiated on Pallas; Math Guide, §“The elliptic-curve discrete logarithm problem”). Concretely, the best known classical attack costs about group operations (Crypto Guide, §“Instantiation on elliptic curves; the Pasta curves”, Proposition “The Pasta curves against the criteria”); the level is cited, not recomputed.
In the model of Assumption 2.8 a reduction receiving a challenge answers each new input with for fresh uniform , a uniform point and hence distributed as the oracle’s answer. For every value of exactly one is consistent with the answer, so the remain uniform and independent of the algorithm’s view. A relation gives with , which is non-zero except with probability , and then (Crypto Guide, §“Pedersen vector commitments”, Theorem “Properties of the vector commitment”, proof; §“Hashing to a curve point”, Remark “Why NUMS generators are binding-safe”). □
Every later argument that ends in a non-trivial discrete-logarithm relation among values of ends in this lemma.
Consider an Orchard instance of Table 4 with message length , hash domain (z.cash:Orchard-MerkleCRH for ; for a commitment instance with domain ) and, for a commitment instance, blinding base . Under Assumptions 2.22 and 2.8, no efficient algorithm outputs, except with negligible probability:
messages whose hash points and are not and satisfy with , or ; hence, by Lemma 2.4, no with equal values of the extracted form other than ;
for a commitment instance, openings and in whose commitments and are not and satisfy with , or ; hence no with equal values of other than ;
a message in on which returns , equivalently on which the or commitment form returns for every trapdoor.
Each such output yields efficiently a non-trivial discrete-logarithm relation among , , …, and, in (ii), .
The proof is by citation, with the Orchard steps made in place. The cited arguments are, in the Crypto Guide, §“Sinsemilla: an algebraic hash-based commitment”, Proposition “Collision resistance of Sinsemilla”, with the paragraph after it on the extracted coordinate and the fixed length, and Construction “SinsemillaCommit”; and the Security argument of the protocol specification, §“Sinsemilla Hash Function”: Lemma “An injectivity property for Sinsemilla”, the theorem “Collision resistance of SinsemillaHash and SinsemillaHashToPoint” with its note extending it to added terms with independent bases, which covers and , and the theorem that a output of yields a non-trivial discrete-logarithm relation. These arguments write a non- output on the pieces as
| (1) |
where with the Kronecker delta, and with added for a commitment. Equal outputs on distinct messages give
non-trivial because is injective. Opposite outputs give
non-trivial because its coefficient on is non-zero. An exceptional case at step has the form with ; substituting (1) for gives a relation with coefficient on . For the hash forms the terms in are absent.
Three steps are made in place. (1) Each instance hashes one fixed length per domain, and is admissible: , with , and (Table 4). Admissibility is exactly the hypothesis under which no coefficient wraps modulo . Because , each difference has absolute value below and vanishes modulo only if it vanishes as an integer, so uniqueness of binary expansions makes injective; and and keep the coefficient on non-zero. Padding to bits is injective on messages of the fixed length , so gives . (2) By the definition of incomplete addition, an instance returns exactly when some incomplete addition meets an exceptional case, the case the cited theorem treats. An operand arises only if or some is , itself a non-trivial relation, because an incomplete addition that meets no exceptional case never returns . The commitment forms return exactly when the point hash does, for every trapdoor, since the blinding addition is complete. (3) The generators and are values of on pairwise distinct inputs (Table 2), so the lemma on relations among fixed generators excludes each relation except with negligible probability. The consequences for the extracted forms follow from Lemma 2.4: equal extracted values other than come from equal or opposite points, which are the cases of (i) and (ii). □
The fixed-length hypothesis cannot be dropped. The point hash zero-pads its input to a multiple of bits, so for a message whose length is not a multiple of the messages and collide with no discrete-logarithm relation. The specification requires collision resistance only between inputs of one fixed length for a given domain (protocol specification, §“Sinsemilla Hash Function”), and every Orchard domain hashes a single length.
Let be a byte string and a message length.
Perfect hiding: if , then for every with hash point and uniform on and independent of , the commitment is uniform on ; hence the distribution of neither it nor , a fixed function of it, depends on .
The lemma is the Crypto Guide’s Construction “SinsemillaCommit” (§“Sinsemilla: an algebraic hash-based commitment”) for the Orchard blinding base. (i) Since and the group has prime order , the map is a bijection from onto the group, so is uniform, and so is its translate by the fixed point (Crypto Guide, §“The Pedersen commitment”, Theorem “Perfect hiding”). (ii) Two such openings give the first relation in the proof of Proposition 2.24, whose coefficient vector on the is non-zero for by step (1) of that proof. The only Orchard addition is the blinding base , whose input differs from those of and of every , since its domain separator ends in -r; the lemma on relations among fixed generators excludes the relation. The specification states the same properties, with hiding conditional on no output (protocol specification, §“Sinsemilla commitments”). □