This section passes from the keys of an account to the addresses and viewing keys that a wallet hands out. It defines the diversifier index and the recovery of an index from an address, the raw encodings of receivers and keys, the unified container with its jumbled string encoding and its viewing-key form, the unified address at an index of a viewing key, the extensions of Revision 2 of ZIP 316, and the recipient addresses a sender handles.
The address layer meets two requirements.
Each payee receives an address unlinkable to every other address of the same holder, while all of them are spendable by one key and recoverable from one seed (protocol specification, §“ DiversifyHash Sapling and DiversifyHash Orchard Hash Functions”, security requirements; ZIP 32; ZIP 316, “Rationale for address derivation”). Each shielded protocol meets (R1) with diversified addresses.
Transparent, Sapling and Orchard receivers coexist, each with its own format. A recipient publishes one string, from which the sender selects the most preferred receiver type it supports, and whose characters a sender can check (ZIP 316, “Motivation” and “Requirements”). ZIP 316 meets (R2) above the protocols, with unified containers (§3.3) and their jumbled string encoding (§3.4).
The Ironwood Guide constructs the Orchard key tiers, the diversifier map and the diversified base (§“Viewing keys” and §“Diversified addresses”). This subsection adds the diversifier index, shared by Sapling and Orchard and used by transparent derivation.
The Orchard address at index j of an incoming viewing key (dk, ivk)
is that of the Ironwood Guide, §“Diversified addresses”,
Construction “Diversified address”, cited and not re-derived:
| PRFexpand LE 256 (r ivk s) ([0x82] ‖ I2LEOSP 256 (ak) ‖ I2LEOSP 256 (nk)) |
(Ironwood Guide, §“Viewing keys”), and ivk s is the incoming viewing key of the scope. The address at index 0 is the default address of the scope (protocol specification, §“Orchard Key Components”; ZIP 32, “Orchard diversifier and OVK derivation”).
For a 32 -byte diversifier key dk and an index
| d j := FF1 - AES256 . Encrypt (dk, "", LE 88 (j)) ∈ { 0, 1 } 88, |
the FF1 mode of NIST SP 800-38G over AES-256 with key dk , radix 2 , length 88 and the empty tweak (Crypto Guide, §“Format-preserving encryption and FF1”, Construction “The FF1 mode of NIST SP 800-38G”; protocol specification, §“Pseudo Random Permutations”). The map is the same in both shielded protocols; only the key differs.
For Orchard,
For Sapling, dk is the diversifier-key component of the account’s
Sapling extended spending key:
The diversifier d j , and the index j , are valid for a protocol if and only if that protocol’s DiversifyHash does not return ⊥ at d j .
Orchard: DiversifyHash Orchard is total, so every index is valid, a scope has exactly 2 88 addresses, and the default diversifier is d 0 (ZIP 32, “Orchard diversifier and OVK derivation”).
Sapling:
| DiversifyHash Sapling (d) := GroupHash URS J (r) ∗ (Zcash_gd, LEBS2OSP 88 (d)), |
a hash into the points of order r J of the Jubjub curve that returns ⊥ on some inputs (protocol specification, §“ DiversifyHash Sapling and DiversifyHash Orchard Hash Functions”, §“Jubjub” and §“Group Hash into Jubjub”, cited and not constructed). Approximately half of all indices are valid (ZIP 32, “Sapling diversifier derivation”); the probability under the specification’s random-oracle model is derived in §3.6. The default Sapling diversifier is d j for the least valid j (same section).
Totality of DiversifyHash Orchard removes the search for a valid index. The Sapling failure rate matters when one index must serve several protocols at once (§3.6).
Index-choice rules, specified (protocol specification, §“Orchard Key Components” and §“Sapling Key Components”, notes). Orchard diversifier indices SHOULD NOT be chosen at random; ZIP 32 specifies their use in hierarchical deterministic wallets. Address generators MAY encode information in the diversifier index, recoverable by a holder of dk (Lemma 3.3). For Sapling, generators MAY encode information in the diversifier itself, and it is RECOMMENDED to encode it in the ZIP 32 diversifier index instead, so that only a holder of dk reads it.
For every diversifier key dk the map
If instead k diversifiers are drawn independently and uniformly from { 0, 1 } 88 , the probability P that two coincide satisfies
| 1 − e − k (k − 1) / 2 89 ≤ P ≤ k (k − 1) 2 89, |
so a collision becomes likely once k is of order
(a) The map LE 88 is a bijection from
The specification notes that an 88 -bit diversifier is not unguessable at the 128 -bit security level and that randomly chosen diversifiers collide near 2 44 choices; the keyed permutation removes the collisions, provided indices do not repeat (protocol specification, §“ DiversifyHash Sapling and DiversifyHash Orchard Hash Functions”, notes). One further reason for a keyed permutation is ZIP 32’s: it makes the diversifier sequence of each account pseudorandom and uncorrelated with that of any other account, so issued diversifiers do not reveal how many addresses have been generated (ZIP 32, “Sapling diversifier derivation” and “Orchard diversifier and OVK derivation”). The Ironwood Guide supplies Assumption “FF1-AES256 as a pseudorandom permutation” (§“Diversified addresses”) and the unlinkability proposition only.
In Orchard, dk s is derived from the full viewing key of scope s , so a holder of the account’s Orchard full viewing key computes dk s for both scopes, hence the index of any diversifier of the account (Lemma 3.3; ZIP 32, “Orchard diversifier and OVK derivation”). In Sapling the same capability belongs to the extended full viewing key, of which dk is a component. A holder of the incoming viewing key (dk, ivk) of one scope has this capability for that scope only.
Let (d, pk d) be an Orchard address and (dk, ivk) the incoming viewing key of some scope.
The value
The address (d, pk d) is the address of (dk, ivk) at some index
if and only if
A holder of an account’s full viewing key decides whether (d, pk d)
belongs to the account, and at which scope and index, by applying (ii)
with (dk ext, ivk ext) and then with
(dk int, ivk int) . Both tests succeed only if
The Sapling case of (i) and (ii) is the same with DiversifyHash Sapling , the test of (ii) failing when it returns ⊥ . For (iii), both tests succeed only if the two Sapling incoming viewing keys are equal; this volume does not bound that probability for Sapling.
(i) FF1 decryption is the two-sided inverse of encryption under every key
and tweak (Crypto Guide, §“Format-preserving encryption and FF1”,
Proposition “FF1 is a keyed bijection on X ”), and
LE 88 is a bijection.
(ii) If (d, pk d) is the address at index j ′ , then
Unlinkability of the addresses of one key is cited with its assumptions.
For Orchard it is the Ironwood Guide, §“Diversified addresses”,
Proposition “Unlinkability of diversified addresses”: for two keys
generated independently with
Suppose that the holder of an incoming viewing key gives an adversary the address of that key at any diversifier the adversary chooses. The adversary then breaks unlinkability outright: given an address (d ′, pk d ′) , it requests the address at d ′ and compares the returned transmission key with pk d ′ . The two are equal if and only if the key is the same, the base g d ′ being a point other than the identity in a group of prime order. No other privacy property is affected. Implementations SHOULD avoid providing such a chosen-diversifier oracle (protocol specification, §“ DiversifyHash Sapling and DiversifyHash Orchard Hash Functions”, notes). An interface returning the address at a requested index gives no chosen diversifier (Lemma 3.5), but it returns the issued addresses themselves: it links every address whose index the requester queries, and under sequential issuance (Proposition 3.2) small indices reach every issued address.
Let dk be either diversifier key of an Orchard key with
Replace dk by a uniform 32 -byte string independent of the other keys;
by Assumption 2.16, applied after
Lemma 2.9, the probability changes by at most that
distinguishing advantage and the loss of that Lemma, the win event being
decidable. Then replace
FF1-AES256 keyed by dk with a uniform permutation of
{ 0, 1 } 88 ; the probability changes by at most the distinguishing
advantage. Repeated indices add nothing, so let the adversary query
| ∏ j = 1 i − 1 2 88 − j 2 88 − j + 1 ⋅ 1 2 88 − i + 1 = 2 − 88 ; |
summing over
The items of unified containers carry the byte encodings below. Each is stated with the validity condition that a decoder applies.
An Orchard raw payment address has 43 bytes,
LEBS2OSP 88 (d) ∥ pk d ⋆ , where
A Sapling raw payment address has 43 bytes,
| LEBS2OSP 88 (d) ∥ LEBS2OSP 256 (repr J (pk d)), |
with the compressed Jubjub encoding. It MUST be considered invalid if abst J returns ⊥ , if the encoding of pk d is non-canonical, or if pk d is not a point of order r J , the identity included (protocol specification, §“Sapling Payment Addresses”).
An Orchard raw full viewing key has 96 bytes,
| I2LEOSP 256 (ak) ‖ I2LEOSP 256 (nk) ‖ I2LEOSP 256 (r ivk) . |
It MUST be considered invalid if ak , nk or r ivk is not the canonical encoding of an element of its field ( F p Pallas , F p Pallas , F p Vesta ), if ak is not the x -coordinate of a point of E (F p Pallas) other than the identity, or if the external or the internal incoming viewing key derived from it is 0 or ⊥ (protocol specification, §“Orchard Raw Full Viewing Keys”).
An Orchard raw incoming viewing key has 64 bytes,
dk ∥ I2LEOSP 256 (ivk) . It MUST be considered invalid
unless
String forms. No Bech32 or Bech32m encoding exists for an individual Orchard payment address, incoming viewing key or full viewing key; the unified encodings of §3.4 are their only strings. A Sapling payment address keeps a standalone Bech32 string, with human-readable part zs on Mainnet and ztestsapling on Testnet (same sections).
Transparent receivers. A P2PKH (pay-to-public-key-hash) address pays to the 20 -byte hash160 of a 33 -byte compressed ECDSA validating key; a P2SH (pay-to-script-hash) address pays to the 20 -byte hash160 of a redeem script that the spender reveals and satisfies (Crypto Guide, §“The transparent layer’s hashes”). Their raw encoding prefixes two version bytes to the hash and is written in Base58Check (protocol specification, §“Transparent Addresses”). Inside a unified container a transparent receiver is the bare 20 -byte hash, without the two version bytes (ZIP 316, “Requirements for both Unified Addresses and Unified Viewing Keys”).
One Orchard raw address serves both pools of the Orchard protocol (§3.3).
ZIP 316 defines Revision 0 , the format of this subsection and of §3.4, and Revision 2 , which adds metadata items, splits the address prefix into a shielded-only and a transparent-enabled form, and renames the viewing-key prefixes (§3.7); Revision 1 is withdrawn (ZIP 316, “Revisions”). The revision of a container is read from its human-readable part. The status of ZIP 316 is that of Table 1; everything Revision 2 adds is specified in the sense of Definition 1.1.
For
| compactSize (n) := { [n] if n < 253, [0xFD] ∥ I2LEOSP 16 (n) if 253 ≤ n < 2 16, [0xFE] ∥ I2LEOSP 32 (n) if 2 16 ≤ n < 2 32, [0xFF] ∥ I2LEOSP 64 (n) otherwise, |
the range of n fixing the form. An item is a pair (τ, v) of a
typecode
| raw := ∥ i = 1 k compactSize (τ i) ‖ compactSize (length (v i)) ‖ v i . |
Both τ i and length (v i) MUST be at most
0x2000000 ; since
Typecodes 0x00 and 0x01 are transparent, 0x02 and 0x03 shielded, and 0xC0 to 0xFC designate metadata items, items that are neither receivers nor viewing keys (§3.7). A unified address (UA) is a container whose non-metadata items are receivers, in the raw encodings of Definition 3.6 under the typecodes of Table 3. A unified full viewing key (UFVK) and a unified incoming viewing key (UIVK) are containers whose non-metadata items are full, respectively incoming, viewing keys (§3.5); UVK denotes either. No typecode exists for Sprout.
Validity. Every container holds at least one non-metadata item. A Revision 0 UA, and a Revision 0 UVK, holds at least one shielded item. A Revision 2 shielded-only UA holds no transparent item; a Revision 2 transparent-enabled UA may consist of a single P2PKH receiver, and a Revision 2 UVK need hold no shielded item. A Consumer MUST reject a container
that violates the containment rule of its revision;
in which a typecode repeats, or which holds both 0x00 and 0x01 ;
which holds only metadata items;
whose items are not in ascending typecode order;
which has bytes after the last item;
A Consumer MUST ignore items with typecodes it does not recognise, with the exception stated in §3.7; a Consumer therefore parses a container that holds unrecognised items.
Same-account rule. Within one UA or UVK, all receivers, full viewing keys and incoming viewing keys derived hierarchically SHOULD belong to the same account at the ZIP 32 or BIP 44 account level, or, for ZIP 48 and FROST UVKs, to one set of signers able to generate independent addresses for that spending authority. FROST key material MUST be derived according to ZIP 312 and ZIP 2005, in particular ZIP 2005, “Usage with FROST”.
Sources: ZIP 316, “Encoding of Unified Addresses”, “Requirements for both Unified Addresses and Unified Viewing Keys” and “Receivers”.
The ascending order makes the raw encoding a function of the set of items, so a representation that discards the order reproduces the same encoding, provided it retains unrecognised items (ZIP 316, “Rationale for Item ordering”). This order is not the priority order below.
| Typecode | Item | Receiver | UFVK item | UIVK item |
|---|---|---|---|---|
| 0x00 | transparent P2PKH | 20 | 65 | 65 |
| 0x01 | transparent P2SH | 20 | — | — |
| 0x02 | Sapling | 43 | 128 | 64 |
| 0x03 | Orchard | 43 | 96 | 64 |
Receiver selection. The Sender of a payment to a UA MUST use the receiver of the most preferred type that it supports, by the Priority List Orchard ( 0x03 ), Sapling ( 0x02 ), then P2SH ( 0x01 ) or P2PKH ( 0x00 ); an unrecognised item is treated as absent, with the exception of §3.7. A wallet MAY let its users configure which receiver types it can send to, and MUST NOT let them change the order of the Priority List except by opting into an experiment, whose specification MAY add to the list and SHOULD keep the preference for more recent shielded protocols (ZIP 316, “Encoding of Unified Addresses”, “Transfers” and “Experimental Usage”). The Orchard receiver belongs to the Orchard protocol, not to a pool: one ivk trial-decrypts both Orchard-pool and Ironwood-pool note ciphertexts (ZIP 326, “Scanning for Ironwood-pool and Orchard-pool notes”), and the Ironwood pool changes no address structure or encoding (ZIP 229, “Abstract”). The pool in which a payment to an Orchard receiver is made is fixed by the routing rule of §11.2, which carries the prohibition of ZIP 326, “Wallet key-generation restrictions”, on paying external receivers in the Orchard pool; the Priority List is unchanged.
The Bech32m checksum does not cascade: a user who checks only the beginning and the end of a long string can miss an adversarial substitution of an inner receiver. ZIP 316 therefore passes the whole payload through F4Jumble, an unkeyed four-round Feistel construction that approximates a random permutation of the entire byte string, so that every output character depends on every input byte. It states two goals (ZIP 316, “Jumbling”).
Near second-preimage resistance. Given q honestly generated UAs or UVKs, an adversary does not produce a valid one that it controls, knowing at least one constituent private key, whose string matches one of the targets on a chosen set of characters, for concreteness the first n and the last m .
Nonmalleability. Without any private key, an adversary does not produce a valid UA or UVK usefully different from a target, for example with its shielded receiver removed, that matches the target on the checked characters.
Generic attacks bound what is achievable: about w c n + m / q for (i) and w / p for (ii), where w is the work to produce and verify one UA or UVK, c the size of the character set and p the probability that a random decoding is valid and useful (ZIP 316, “Discussion”). Jumbling is not authentication. F4Jumble is unkeyed, so anyone can jumble and checksum a wholly substituted address, and an address is still obtained or verified through a trusted channel; jumbling raises only the cost of partial-match and malleation attacks against a genuine string.
Let
| H i (u) | := BLAKE2b - (8 l L) (UA_F4Jumble_H ∥ [i, 0, 0], u), | ||
| G i (u) | := the first l R bytes of ∥ j = 0 ⌈ l R / l H ⌉ − 1 BLAKE2b - 512 (UA_F4Jumble_G ‖ [i] ‖ I2LEOSP 16 (j), u), |
an l L -byte hash and an extendable-output function in the sense of the
Crypto Guide, §“Hash functions and the random oracle model”,
Definition “Extendable-output function”, for the lengths l L and
l R below. For a byte string M of length l M with
| l L := min (l H, ⌊ l M / 2 ⌋), l R := l M − l L, |
split
| x | := b ⊕ G 0 (a), | y | := a ⊕ H 0 (x), | ||
| d | := x ⊕ G 1 (y), | c | := y ⊕ H 1 (d), |
and
Each personalisation has 16 bytes:
For every l M with
| y := c ⊕ H 1 (d), x := d ⊕ G 1 (y), a := y ⊕ H 0 (x), b := x ⊕ G 0 (a) . |
Well defined. From
Bijection. Each of the four steps replaces one half by its XOR with a
function of the other half, which it leaves unchanged, and
ZIP 316, “Heuristic analysis”, motivates the number of rounds.
Human-readable parts of Revision 0 : u for a UA, uview for a UFVK and uivk for a UIVK on Mainnet; on Testnet test is appended (utest, uviewtest, uivktest). Let raw be the raw encoding of Definition 3.7, hrp the human-readable part and padding the human-readable part in US-ASCII right-padded with zero bytes to 16 bytes.
Producer. It MUST ensure
| Bech32m (hrp, F4Jumble (raw ∥ padding)), |
the Bech32m encoding of BIP 350 with its length restriction ignored.
Consumer. It MUST decode as follows, rejecting the string at the first failure:
decode with Bech32m, rejecting an incorrect checksum;
reject a decoded byte string shorter than 38 or longer than l MAX bytes;
apply F4Jumble − 1 (Proposition 3.9);
reject a result that does not end in the 16 -byte padding of the string’s human-readable part, and remove that padding;
parse the rest as a raw encoding, rejecting the whole string if any rule of Definition 3.7 fails.
UFVKs and UIVKs use the same procedure under their own human-readable parts (ZIP 316, “Encoding of Unified Addresses”, “Encoding of Unified Full/Incoming Viewing Keys” and “Usage for Unified Addresses, UFVKs, and UIVKs”; BIP 350).
The padding supplies the redundancy that defeats the generic nonmalleability attack, since a random decoding must end in the exact 16 bytes, and gives the human-readable part the same protection against malleation as the payload, which may help against cross-network substitution and against confusion of an address with a viewing key (ZIP 316, “Usage for Unified Addresses, UFVKs, and UIVKs” and “Heuristic analysis”).
Length rules (ZIP 316, “Rationale for length restrictions” and
“Efficiency”). The 38 -byte minimum is Revision 2 ’s: one P2PKH item of
22 bytes and the padding. Revision 0 specified 48 bytes. Since only
typecodes 0x02 and 0x03 are shielded, no set of items
valid in Revision 0 has an encoding of 22 to 31 bytes (the smallest
Revision 0 input is
Display rule, specified (ZIP 316, “Requirements for both Unified Addresses and Unified Viewing Keys”). If the string of a UA or UVK is shown in an abridged form, at least its first 20 characters MUST be shown. The rationale is the ZIP’s (“Rationale for showing at least the first 20 characters”). After the longest Mainnet human-readable part of Revision 0 , uview, and the separator 1, 14 characters remain, 70 bits of jumbled data at 5 bits per character, below the target of 2 125 against classical attacks, and multi-target attacks are possible; 20 is an absolute minimum and a wallet may show more. Only a prefix counts, because displays that show different substrings let a user compare only the characters common to all of them, and because checksum characters complicate the analysis of partial matching.
Item sizes. A Sapling or Orchard receiver item has
Let the seed be the 32 bytes
Receiver. The diversifier key dk is the first half of the 0x82 expansion of the account’s full viewing key, and FF1 encryption of LE 88 (1) gives d 1 (Definition 3.1):
| dk | 82cc9d79742fe5ae9a142b9336a98677b154fe20401eb18998dbed915b0453ce |
|---|---|
| LEBS2OSP 88 (LE 88 (1)) | 0100000000000000000000 |
| d 1 | 3fadf8edb20a3301e8260a |
| pk d ⋆ | a311f4cbd54d7d6a76baac88c244b0b121c6dc22a8bcce15898e267829fc1e01 |
Decryption FF1 - AES256 . Decrypt (dk, "", d 1)
returns LE 88 (1) , so
Container. The UA has one item, so its raw encoding
(Definition 3.7) is the header
| a = M [0..30) | 032b3fadf8edb20a3301e8260aa311f4cbd54d7d6a76baac88c244b0b121 |
|---|---|
| b = M [30..61) | c6dc22a8bcce15898e267829fc1e0175000000000000000000000000000000 |
| x = b ⊕ G 0 (a) | e6f1529b03a0ad0a4209da8e4365ca14a5988bf1d03084a1c326f929c574ca |
| y = a ⊕ H 0 (x) | 37b358eb784bb2b315fd35c595628cfa9aa8045ef271728dd0cbf84dc81a |
| d = x ⊕ G 1 (y) | ad26d7fb043e09cbf18e8f4d80d2b423ecb01719170463d644be4c76daab6b |
| c = y ⊕ H 1 (d) | 98979f9a7d2dfce7b1616a8d2b9975f87878171b6fcf33b303f770b4aa64 |
The header, the diversifier and the padding are legible in a and b , and in neither c nor d .
String. The 61 bytes of c ∥ d regroup into 98 five-bit
symbols, the last padded with two zero bits. With the human-readable part
u, the separator 1 and the 6 -symbol checksum, the
string has
u1nztelxna9h7w0vtpd2xjhxt4lpu8s9cmdl8n8vcr7actf2ny45nd07cy8cyuhuvw3axcp545y0ktq9cezuzx84jyhex8dk4tdvwhu4dl
Decoding reverses each stage of Construction 3.10;
A UFVK and a UIVK are containers of Definition 3.7 under the string encoding of Construction 3.10 with their own human-readable parts; a Consumer MUST use the decoding procedure of Construction 3.10. Their items, at the receiver typecodes, are the following.
Orchard, 0x03 : the 96 -byte raw full viewing key, respectively the 64 -byte raw incoming viewing key, of Definition 3.6.
Sapling, 0x02 : in a UFVK the 128 bytes
| EncodeExtFVKParts (ak, nk, ovk, dk) | ||
| := LEBS2OSP 256 (repr J (ak)) ‖ LEBS2OSP 256 (repr J (nk)) ‖ ovk ∥ dk |
of ZIP 32, “Sapling helper functions”, which SHOULD be derived from the
account-level extended full viewing key; in a UIVK the 64 bytes
dk ∥ I2LEOSP 256 (ivk) , valid only if
Transparent P2PKH, 0x00 : the 65 bytes c ∥ ser P (pk) of a 32 -byte BIP 32 chain code and a 33 -byte compressed public key, the last 65 bytes of the BIP 32 extended public key serialisation (BIP 32, “Serialization format”). The UFVK item is the key at m / 44 ′ / coin _ type ′ / a ′ , the account level of BIP 44, and the UIVK item its external (non-change) child at m / 44 ′ / coin _ type ′ / a ′ / 0 .
The current viewing-key types reuse the receiver typecodes; future types MAY use others. The Priority List does not govern viewing keys: a Consumer normally takes the union of the information of all items (ZIP 316, “Encoding of Unified Full/Incoming Viewing Keys”).
The transparent item omits the BIP 32 depth, parent fingerprint and child number; the format is ZIP 316’s. That the child number of the account-level key would reveal the account index is this volume’s inference, not a statement of the ZIP. The Sapling UFVK item carries no chain code, so a UFVK supports no non-hardened Sapling child derivation below the account.
Item by item, with the typecode preserved:
a Sapling full viewing key to its incoming viewing key (protocol specification, §“Sapling Key Components”), with dk carried over;
an Orchard full viewing key (ak, nk, r ivk) to the external-scope incoming viewing key (dk, ivk) (Ironwood Guide, §“Viewing keys”);
a transparent P2PKH account key to its child at non-hardened index 0 by BIP 32 public-to-public derivation (BIP 32, “Public parent key → public child key”).
Items with unrecognised typecodes, and items of experiments the user has not opted into, MUST be dropped (ZIP 316, “Deriving a UIVK from a UFVK”). The treatment of metadata items is stated with them, in §3.7.
For a wallet seed S (Definition 2.1) and an account index a , the Orchard account key of Definition 2.7, the Sapling extended spending key at m Sapling / 32 ′ / coin _ type ′ / a ′ of ZIP 32 and the BIP 32 extended private key at m / 44 ′ / coin _ type ′ / a ′ are jointly computationally indistinguishable from three independently generated keys of the respective protocols: a uniform Orchard spending key with a uniform chain code, a uniform Sapling master-derived key and a uniform BIP 32 key.
The assumption has a heuristic basis and no proof. It follows if BLAKE2b-512 under ZcashIP32Sapling (the Sapling master key) and HMAC-SHA512 under the key Bitcoin seed (the BIP 32 master key) are modelled as random oracles independent of BLAKE2b-512 under ZcashIP32Orchard, and the Sapling and BIP 32 hardened child derivations as PRFs keyed by the parent chain code (HMAC as a PRF: Crypto Guide, §“PRFs from hash functions: length extension and keyed BLAKE2”; ZIP 32, “Sapling master key generation” and “Sapling child key derivation”; BIP 32, “Master key generation” and “Private parent key → private child key”). Lemma 2.5 proves the Orchard component and nothing more.
Let the keys of one account be generated from a seed, with
From a UFVK the following are computed: for Orchard, the incoming and outgoing viewing keys of both scopes and nk , hence receipt, spend and outgoing detection (Proposition 2.15); for Sapling, the same through ZIP 32’s internal key derivation; for transparent keys, every external and internal address and the transparent outgoing viewing keys (Construction 2.18). No secret that is infeasible to compute from its own component becomes feasible from the whole UFVK: in particular the Orchard ask (Ironwood Guide, §“Key capabilities and scope”, Proposition “Capability separation”, part (a)), the Sapling spend authorising key and a transparent private key.
A UIVK gives receipt detection for the external scope in each shielded protocol it carries, and no spend detection for its shielded items: nk is infeasible to compute from an Orchard (dk, ivk) (Ironwood Guide, §“Key capabilities and scope”, Proposition “Capability separation”, part (b)), and internal-scope receipt is neither detected (Proposition 2.17) nor derivable (Proposition 2.20). A transparent UIVK item yields the external addresses m / 44 ′ / coin _ type ′ / a ′ / 0 / j and not the internal ones. Spends of transparent funds are public on the transparent chain, so their visibility is a property of the chain, not of the key.
Metadata items confer no viewing authority (§3.7), so the statements hold for containers of either revision.
Componentwise. The computations of (a) and (b) are those of the cited constructions applied to each item. For the separations: by Assumption 3.14 the components are indistinguishable from independently generated keys, so a reduction given one component generates the others itself. An algorithm that outputs a secret of one protocol from the whole container thus yields an algorithm that outputs it from that protocol’s component alone, with the advantage of Assumption 3.14 added; the success of either is efficiently decidable, by recomputing the public key or viewing key from the output. The per-component statements are Propositions 2.15, 2.17 and 2.20 with the Ironwood Guide, §“Key capabilities and scope”, Proposition “Capability separation”, under the assumptions named there, for Orchard; ZIP 32 and the protocol specification, §“Sapling Key Components”, cited, for Sapling; and Assumption 2.19 with BIP 32, “Security”, for the transparent keys. The transparent spend clause is a property of transparent inputs, which name the outpoints they spend in the clear. □
Let U be a UIVK. Choose one index
for an Orchard item, always;
for a Sapling item, if and only if
for a transparent P2PKH item, if and only if
Each receiver is derived from its item at the same j : a Sapling or Orchard receiver as the address at index j of (dk, ivk) (protocol specification, §“Sapling Key Components” and §“Orchard Key Components”; Ironwood Guide, §“Diversified addresses”, Construction “Diversified address”), and a transparent P2PKH receiver as the hash160 of the non-hardened BIP 32 public child j of the external key, so that its path is m / 44 ′ / coin _ type ′ / a ′ / 0 / j (BIP 44). Items with unrecognised typecodes, and items of experiments the user has not opted into, MUST be dropped; metadata items are treated in §3.7 (ZIP 316, “Deriving a Unified Address from a UIVK”).
Let V (U) be the set of indices valid for every item of a UIVK U .
If U has only an Orchard item,
If U has a transparent item,
Let U have a Sapling item, and let BLAKE2s - 256 in GroupHash J (r) ∗ be modelled as a random oracle, the model of the protocol specification, §“Group Hash into Jubjub”, notes. The events that the indices are valid for the Sapling item are independent over distinct indices, each of probability
| π := h J (r J − 1) 2 256 = 8 (r J − 1) 2 256 ≈ 0.4528, |
with
With a Sapling and a transparent item, V (U) is the set of indices
below 2 31 that are Sapling-valid and at which BIP 32 derivation
succeeds; its expected size lies within
For the Sapling key of account 9 of the seed of
Example 3.11, 4527 of the indices
The set V (U) is the intersection of the per-item valid sets of Construction 3.16, which gives (a) and (b), distinct indices giving distinct receivers.
(c) Distinct indices give distinct diversifiers
(Proposition 3.2 (a)), hence distinct inputs to
BLAKE2s - 256 , whose outputs h are then independent and
uniform on { 0, 1 } 256 . The group hash returns a point if and only if
(d) Parts (b) and (c) and Construction 3.16 (3) combined by linearity of expectation over the 2 31 indices below 2 31 , each of which fails BIP 32 derivation with probability below 2 − 127 . □
ZIP 316 fixes neither an order in which a wallet searches for a valid index nor a default unified address. The only normative defaults are ZIP 32’s per-protocol default diversifiers: for Sapling d j with j the least valid index, for Orchard d 0 (ZIP 32, “Sapling diversifier derivation” and “Orchard diversifier and OVK derivation”). Issuing the unified address at the least index valid for every item is designed but unspecified (Definition 1.1).
Index 0 and recovery across wallets, specified (ZIP 316, “Deriving a
Unified Address from a UIVK”). Index 0 is invalid for a Sapling item with
probability
The following is Revision 2 of ZIP 316, specified (Definition 1.1).
Human-readable parts. A UA is either shielded-only, with human-readable part zu, which MUST NOT hold a transparent item (typecode 0x00 or 0x01 ), a Consumer rejecting any that does, or transparent-enabled, with tu. A UFVK uses uvf and a UIVK uvi; on Testnet test is appended. The human-readable part distinguishes a Revision 0 container (u, uview, uivk) from a Revision 2 one.
Metadata items, typecodes 0xC0 to 0xFC (Definition 3.7), MAY affect the interpretation of the container, MUST NOT be selected as receivers and MUST NOT confer viewing authority.
MUST-understand items. Typecodes 0xE0 to 0xFC are MUST-understand: a Consumer that does not recognise such an item MUST regard the whole container as unsupported and not process it further. This is the exception to the ignore rule of Definition 3.7.
Registry. Typecodes 0x04 to 0xBF are unassigned; 0xC0 to 0xDF are metadata that need not be understood, none assigned; 0xE0 is the Address Expiry Height and 0xE1 the Address Expiry Time, permitted in zu and tu addresses and not in Revision 0 ; 0xE2 to 0xFC are unassigned MUST-understand metadata; 0xFD to 0xFFF9 are unassigned; and 0xFFFA to 0xFFFF are experimental. Producers MUST NOT include items whose typecodes are unassigned or not permitted for the type of the container.
Address expiry items. An item of typecode 0xE0 holds the Address Expiry Height, an unsigned 32 -bit little-endian integer; a UA carrying it MUST be considered expired when the height of the chain exceeds that value. An item of typecode 0xE1 holds the Address Expiry Time, an unsigned 64 -bit little-endian Unix time; a UA carrying it MUST be considered expired when the current time is after that value. A Producer MAY include either, both or neither.
Retroactive rule. A Revision 0 container MUST NOT hold a MUST-understand metadata item, and a Consumer MUST reject one that does.
Derivation. To derive a UIVK from a UFVK, or a UA from a UFVK or UIVK, a Consumer MUST understand every MUST-understand item of the source. The derived container MUST be Revision 2 if the source holds any metadata item, and SHOULD be Revision 2 if the source is. A UIVK derived from a UFVK MUST retain its 0xE0 and 0xE1 items unmodified. A UA derived from a UFVK or UIVK that carries 0xE0 (respectively 0xE1 ) MUST carry 0xE0 (respectively 0xE1 ) with a value at most that of the viewing key. Metadata items that need not be understood and are unrecognised are dropped under Constructions 3.13 and 3.16.
Sources: ZIP 316, “Revisions”, “Metadata Items”, “Address Expiration Metadata”, “Typecode Registry”, “Requirements for both Unified Addresses and Unified Viewing Keys”, “Deriving a UIVK from a UFVK” and “Deriving a Unified Address from a UIVK”.
A Consumer that predates Revision 2 does not recognise the Revision 2 human-readable parts. Requiring MUST-understand items to appear only under those parts therefore enforces the MUST-understand rule even against such a Consumer (ZIP 316, “Rationale for making Revision 0 UA/UVKs with MUST-understand Typecodes invalid”).
Sender rules for expiring addresses, specified (ZIP 316, “Address Expiration Metadata” and its “Rationale”). The expiry height of a transaction is its field nExpiryHeight (Ironwood Guide, §“The transaction format”). A Sender supporting Revision 2 MUST set a nonzero nExpiryHeight in a transaction to a UA with an Address Expiry Height, and MUST NOT send the transaction if the nExpiryHeight it would otherwise construct exceeds that height; lowering nExpiryHeight to the address’s value instead would reveal the destination’s expiry on chain. With only an Address Expiry Time, it SHOULD choose nExpiryHeight so that the transaction expires no more than 24 hours after the current time. With both items both restrictions apply, and with several recipient UAs in one transaction all their constraints apply. A wallet MUST NOT send to an address it knows to have expired, and its error SHOULD suggest obtaining a current address. The choice of nExpiryHeight is stated in §9.3.
Linkability through metadata (ZIP 316, “Address Expiration Metadata”). Diversified UAs derived from one UIVK that hold only Sapling or Orchard receivers and no metadata are unlinkable (§3.1); with metadata items present this no longer holds, and it is RECOMMENDED that the expiry height and time of distinct derived addresses vary. Re-issuing the same receivers with different expiry metadata yields a visually distinct address that is directly linkable to the original, since the receivers are shared.
A recipient address is one of the following:
a transparent address, P2PKH or P2SH, in its Base58Check encoding (Definition 3.6 (f));
a Sapling payment address in its Bech32 encoding (Definition 3.6 (e));
a TEX address (transparent-source-only address): the Bech32m encoding, with human-readable part tex on Mainnet and textest on Testnet, of the 20 -byte validating-key hash of a P2PKH address. It is obtained from a Base58Check P2PKH address whose decoding has 22 bytes beginning with the lead bytes [0x1C, 0xB8] (Testnet [0x1D, 0x25] ) by removing them, and it is parsed by requiring the human-readable part and exactly 20 decoded bytes (ZIP 320, “Specification”).
Sprout addresses are not recipient addresses: no transaction adds value to the Sprout pool, and no typecode exists for them (§14.2; ZIP 316, “Requirements for both Unified Addresses and Unified Viewing Keys”). A Sender paying a TEX address, as any output of a transaction, MUST spend only transparent (P2SH or P2PKH) outputs in that transaction, and SHOULD send only to transparent outputs (ZIP 320, “Specification”; §11.3).
Two predicates on recipient addresses, defined here, are used by payment construction and by ZIP 321 (ZIP 321, “memo”; §14.2).
An address is memo-capable if and only if it is a Sapling payment address or a unified address that contains a Sapling or Orchard receiver, since a memo travels only in a note plaintext (Ironwood Guide, §“The note plaintext”). A memo reaches the recipient of a unified address only when the Sender selects a shielded receiver.
An address is transparent-only if and only if it is a transparent or TEX address, or a unified address whose non-metadata items are all transparent receivers, which is possible only as a Revision 2 tu address.