23 - The complete key catalog
1. Why this chapter exists
Every chapter of this course names keying-material symbols (, and so on). A reader who needs the exact derivation, type, or code location for any of these should not have to recover it from prose. This chapter is the authoritative reference: every Zcash key is listed with its domain, derivation formula, role, and the source file that defines its Rust type. It also points at the related catalog of circuit clauses in chapter 24 and at chapter 06 for HD derivation.
2. Definitions
This chapter assumes the cryptographic primitives defined in chapter 03 (groups, fields, PRFs, commitments, signatures). Specific to this chapter:
Definition 2.1 (Field notation). Let denote the prime field of order . We use for the Jubjub prime-order subgroup order; for the BLS12-381 scalar field (equal to the Jubjub base field); for the Pallas scalar field; for the Pallas base field. The Pallas and Vesta cofactors are ; the Jubjub cofactor is . The prime-order Jubjub subgroup is with ; the Pallas prime-order group is with .
Definition 2.2 (Generator notation). A fixed generator of a prime-order subgroup , derived deterministically from a personalisation string via a hash-to-curve construction, is denoted by with a superscript tag. For example, is the Sapling spend-authority base point.
Definition 2.3 (Scalar multiplication). For and (the scalar field of ), denotes the scalar multiple of by .
Definition 2.4 (Canonical encoding ). For a target codomain (either a field or a group), the symbol denotes the canonical encoding into . For instance, for a Jubjub point , is its -coordinate encoded as a little-endian field element.
Definition 2.5 (To-scalar and to-base reduction). For a 64-byte string ,
both interpret as a little-endian integer and reduce modulo the relevant prime. The -bit input width ensures the bias introduced by modular reduction is negligible (statistical distance ).
Definition 2.6 (Expand-from-seed PRF). Let and let be a purpose tag. Define
Used identically by Sapling and Orchard with different purpose tags.
Definition 2.7 (Catalog entry). A catalog entry below formalises a Zcash key symbol by recording, where applicable:
- The symbol and its short name.
- The type signature, i.e. the codomain (a field, a group, or a byte-string space).
- The derivation: an explicit function from prior keys or randomness to .
- The role: who learns and what capability it confers.
- The Rust type in this workspace (or upstream crate) that carries .
Each entry below is therefore a Definition fixing in the form with a derivation rule.
3. The code
The catalog is organised by pool. Within each pool, keys are listed in derivation order: spending key first, then derived material, then per-transaction ephemerals.
3.1 Sprout (legacy)
Sprout is closed for new outputs but historical notes still exist.
Definition 2.8 (Sprout ). , sampled uniformly (a_{\mathsf{sk}} \stackrel{\}{\leftarrow} {0,1}^{252}$). The Sprout spending key. Holder can spend Sprout notes.
Definition 2.9 (Sprout ). , defined by
The Sprout paying key, published as part of the Sprout address.
Definition 2.10 (Sprout ). , derived from with the Curve25519 clamping operation. Used as a Curve25519 secret for in-band note encryption.
Definition 2.11 (Sprout ). , defined by with the standard Curve25519 base point. Public, part of the Sprout address.
Definition 2.12 (Sprout ). , chosen per-note to be unique within the JoinSplit. The nullifier seed stored in the note plaintext.
Definition 2.13 (Sprout , commitment randomness). , r \stackrel{\}{\leftarrow} {0,1}^{256}$ per note. Used as the randomness in the Sprout note commitment.
Definition 2.14 (Sprout ). , \phi \stackrel{\}{\leftarrow} {0,1}^{252}\rho$ values for the JoinSplit's output notes.
Definition 2.15 (Sprout ). , equal to a BLAKE2b hash of the transaction context and the JoinSplit signing public key. Binds the JoinSplit to its signature.
Definition 2.16 (Sprout nullifier). , defined by
Sprout PRFs are SHA-256 with 4-bit tag prefixes; exact tags are in protocol spec section 5.4.2.
The Sprout circuit definition lives in
zcash_proofs/src/circuit/sprout/mod.rs:
loading...
3.2 Sapling
The Sapling key tree implementation lives in the external
sapling-crypto
crate; this workspace consumes it via
zcash_keys/src/keys.rs.
Root spending key
Definition 2.17 (Sapling ). , derived along the ZIP 32 hardened path
from the wallet seed. Holder
can do everything: spend, view, derive. Code:
sapling-crypto::keys::SpendingKey. Sometimes called the
"expanded spending key" or, with a chain code, the "extended
spending key" (ZIP 32, Extended).
Spend-authorisation private key
Definition 2.18 (Sapling ). , defined by
Signs Sapling spend-auth signatures after re-randomisation by
. Code: sapling-crypto::keys::ExpandedSpendingKey::ask.
Nullifier private key
Definition 2.19 (Sapling ). , defined by
Derives and, inside the circuit, the nullifier.
Code: sapling-crypto::keys::ExpandedSpendingKey::nsk.
Outgoing viewing key
Definition 2.20 (Sapling ). , defined by
where takes the first 32 bytes of the
64-byte BLAKE2b output. Decrypts outputs sent by the holder via
. Code:
sapling-crypto::keys::ExpandedSpendingKey::ovk.
Diversifier key
Definition 2.21 (Sapling ). , defined by
Used as the FF1-AES key that enumerates the account's
diversifiers. Code: sapling-crypto::zip32::DiversifierKey.
Spend-authorisation public key
Definition 2.22 (Sapling ). , defined by
with the fixed
Sapling spend-authority base point
(SpendAuthSig.BasePoint). Public spend-authority key,
published after re-randomisation as . Code:
sapling-crypto::keys::ProofGenerationKey::ak.
Nullifier deriving key
Definition 2.23 (Sapling ). , defined by
with the fixed
nullifier generator (ProvingPublicKey.BasePoint). Keys the
nullifier PRF; part of the full viewing key. Code:
sapling-crypto::keys::ProofGenerationKey::nk.
Incoming viewing key
Definition 2.24 (Sapling ). , defined by
extracting each point's -coordinate as a 255-bit little-
endian field-element encoding; the top bit is cleared before
reducing modulo to ensure uniform reduction. Decrypts
outputs received by this account. Code:
sapling-crypto::keys::SaplingIvk.
Full viewing key
Definition 2.25 (Sapling ). . With the diversifier key
included (per ZIP 316), the extended full viewing key is
. The full viewing key can compute
and decrypt incoming notes; decrypt outgoing notes via
; enumerate diversified addresses via
. It cannot spend or authorise (no
). Code:
sapling-crypto::keys::FullViewingKey.
Proof generation key
Definition 2.26 (Sapling ). . The witness the prover supplies for the
Sapling Spend circuit: public and private
. A hardware-wallet flow that delegates proving
hands this pair (and the per-spend ) to the prover
without sending , which signs only. Code:
sapling-crypto::keys::ProofGenerationKey.
Diversifier
Definition 2.27 (Sapling diversifier ). For diversifier index ,
Eleven bytes. Not every produces a valid prime-order
generator ; the probability is approximately per
, and invalid indices are skipped. Code:
sapling-crypto::keys::Diversifier, DiversifierIndex.
Diversified base
Definition 2.28 (Sapling ). , defined by
where is a try-and-increment hash-to-
curve into using BLAKE2s with personalisation
"Zcash_gd". The output is multiplied by the cofactor
to land in .
Diversified transmission key
Definition 2.29 (Sapling ). , defined by
Public key tied to diversifier ; combined with to form a payment address.
Sapling payment address
Definition 2.30 (Sapling address ).
, encoded as
bytes and bech32-encoded with HRP zs (mainnet) or
ztestsapling (testnet).
Note plaintext
Definition 2.31 (Sapling note). A Sapling note is the tuple
where is a 32-byte seed (post-ZIP 212) from which and are derived. Pre-Canopy notes used directly.
Commitment randomness
Definition 2.32 (Sapling , post-ZIP 212). , defined by
Hides the note in (Definition 2.36).
Ephemeral secret key
Definition 2.33 (Sapling , post-ZIP 212). , defined by
Sender's secret for ECDH note encryption. Code: local to builder; not part of any persisted key type.
Ephemeral public key
Definition 2.34 (Sapling ). , defined by
Published in the OutputDescription and Action.
Note commitment
Definition 2.35 (Sapling ). , defined by
The published value is the -coordinate
. Code: sapling-crypto::primitives::NoteCommitment.
Value commitment randomness and value commitment
Definition 2.36 (Sapling ). , \mathsf{rcv} \stackrel{\}{\leftarrow} \mathbb{F}_{\ell_J}$ per spend or output.
Definition 2.37 (Sapling ). , defined by
with the
fixed value and randomness bases
(ValueCommitValueBase, ValueCommitRandomnessBase).
Position and rho
Definition 2.38 (Sapling ). For a note at position in the commitment tree, is defined by
Nullifier
Definition 2.39 (Sapling nullifier ). , defined by
Published in the SpendDescription.
Re-randomisation
Definition 2.40 (Sapling ). , \alpha \stackrel{\}{\leftarrow} \mathbb{F}_{\ell_J}$ per spend.
Definition 2.41 (Sapling re-randomised keys ).
stays private; is published.
Spend-authorisation signature
Definition 2.42 (Sapling ). A RedJubjub signature under over the sighash:
Verified under .
Outgoing cipher key
Definition 2.43 (Sapling ). , defined by
Also written in chapter 08. AEAD key for ; recovers from .
Note encryption key
Definition 2.44 (Sapling ). , defined by
where . AEAD key encrypting the note plaintext to the recipient.
Binding signature keys
Definition 2.45 (Sapling binding keys ). For inputs and outputs in a Sapling bundle,
If the bundle balances, ; the spender holds and signs the
sighash under it. Code:
sapling-crypto::bundle::Bundle::binding_signature.
Internal vs external addresses
Definition 2.46 (Sapling internal sub-tree). ZIP 316 specifies an internal full-viewing-key sub-tree for change addresses, distinct from the user-facing external one. The internal sub-tree has its own , , and diversifier index space. An external observer cannot link change outputs to user-visible addresses. The internal keys derive from the external ones via further hardened ZIP-32 children with index .
3.3 Orchard
The Orchard key tree is implemented in the external
orchard crate; this
workspace consumes it via
zcash_keys/src/keys.rs.
Structurally parallel to Sapling with several simplifications.
Root spending key
Definition 2.47 (Orchard ).
, derived via ZIP 32 from the
wallet seed analogously to Sapling. Code:
orchard::keys::SpendingKey.
Spend-authorisation private key
Definition 2.48 (Orchard ). , defined by
Nullifier deriving key
Definition 2.49 (Orchard ). , defined by
Unlike Sapling, Orchard's is a field element, not a curve point. This is a key Orchard simplification: the nullifier PRF feeds directly into a Poseidon hash inside the circuit, avoiding the cost of decoding a point.
Randomiser for ivk commitment
Definition 2.50 (Orchard ). , defined by
Used as the randomness in the Sinsemilla-based .
Outgoing viewing key and diversifier key
Definition 2.51 (Orchard ). and , jointly defined by the concatenation
The 64-byte output is split: the first 32 bytes are , the next 32 are . The dependence on and binds these to the rest of the tree.
Spend-authorisation public key
Definition 2.52 (Orchard ). , defined by
Incoming viewing key
Definition 2.53 (Orchard ). , defined by
with "z.cash:Orchard-CommitIvk".
is a randomised commitment, Sinsemilla
hash plus a randomness term. Sapling's is a hash;
Orchard's is a randomised commitment. The commitment form lets
the circuit prove derivation more efficiently.
Full viewing key
Definition 2.54 (Orchard ). . and are derived from deterministically.
Diversifier, diversified base, transmission key
Definition 2.55 (Orchard ). is derived from as in Sapling. Then
Orchard payment address
Definition 2.56 (Orchard address ). , encoded in 43 bytes and packaged inside a Unified Address (no standalone bech32 form).
Note plaintext
Definition 2.57 (Orchard note). An Orchard note is the tuple
The additional fields and are uniqueness nonces that chain across the bundle: each new note's equals the nullifier of the spent note in the same Action. is derived from and :
Commitment randomness
Definition 2.58 (Orchard ). , defined by
Note commitment
Definition 2.59 (Orchard ). , defined by
The published value is the -coordinate .
Ephemeral keys for note encryption
Definition 2.60 (Orchard ). and , defined by
Value commitment
Definition 2.61 (Orchard ). , defined by
where is the net value of the Action (positive when the old note was larger than the new one). The bundle balance equation aggregates these commitments.
Nullifier
Definition 2.62 (Orchard nullifier ). , defined by
with a fixed Pallas generator and a Poseidon-based PRF keyed by .
Re-randomisation, binding sig, OCK, K_enc
Definition 2.63 (Orchard re-randomisation ). For \alpha \stackrel{\}{\leftarrow} \mathbb{F}_{q_P}$,
Definition 2.64 (Orchard ). , defined by
Definition 2.65 (Orchard ). , defined by
The binding signature is RedPallas; ZIP 224 spells out the constants.
Issuance keys (ZSA, NU7-track)
Definition 2.66 (ZSA ). . The issuer's spending- authority root for issuance. Future-only.
Definition 2.67 (ZSA ). , the public issuance key derived from analogously to .
Definition 2.68 (ZSA ). , a 64-byte digest binding an asset to its issuer. See chapter 21 for ZSA context.
3.4 Transparent
Standard BIP-32 / SLIP-10 over secp256k1. Path .
Definition 2.69 (Transparent ). , the BIP-32 extended private key, consisting of a 32-byte private scalar and a 32-byte chain code.
Definition 2.70 (Transparent ). , the BIP-32 extended public key, consisting of a secp256k1 point and the chain code.
Definition 2.71 (Transparent ). , the secp256k1 scalar private key extracted from a non-hardened .
Definition 2.72 (Transparent ). , defined by .
Definition 2.73 (Transparent ). , defined by
the address payload of P2PKH outputs.
The transparent key implementation:
loading...
ZIP 48 account-level keys live alongside in
zcash_transparent/src/zip48.rs.
3.5 Unified
Defined by ZIP 316. Encoded via F4Jumble in
components/f4jumble/src/lib.rs
and bech32m in
components/zcash_address/src.
Unified spending key
Definition 2.74 (Unified spending key ).
where each component is optional and present
per the account's policy. Code:
zcash_keys::keys::UnifiedSpendingKey.
loading...
Unified full viewing key
Definition 2.75 (Unified full viewing key ). . The Sapling component includes the diversifier key .
Unified incoming viewing key
Definition 2.76 (Unified incoming viewing key ). . Decrypts incoming but not outgoing notes; a weaker capability than , suitable for read-only services.
Unified address
Definition 2.77 (Unified address ). is a bundle of receivers indexed by typecodes:
with typecodes per ZIP 316. Encoded as
and then bech32m with HRP u.
3.6 Note encryption keys at a glance
For both Sapling and Orchard:
| Key | Sender knows | Recipient knows | Purpose |
|---|---|---|---|
| yes | no | ECDH secret | |
| yes (publishes) | yes (sees on-chain) | ECDH public | |
| DH output | |||
| yes | yes | AEAD key (recipient side) | |
| yes (via ) | no | AEAD key (sender side) |
3.7 Cross-pool relationships
Every Zcash account in this codebase has:
- One transparent extended key per account (ZIP 48).
- One Sapling extended spending key per account.
- One Orchard spending key per account.
These are independent: knowing one does not reveal the others. The wallet stitches them together via the Unified containers. The same seed deterministically produces all three (via different ZIP 32 paths). Backing up the seed phrase backs up the full account.
3.8 Privacy hierarchy
Per pool, the capability ladder (top: most powerful):
- - can spend.
- , - jointly authorise and prove a spend; cannot derive the address (need ).
- - view incoming and outgoing; enumerate addresses; cannot spend.
- - decrypt incoming; cannot view outgoing.
- - public receiver; only sendable-to.
The PCZT design respects this hierarchy: each role gets the minimum capability it needs.
3.9 Lifetime: where each key lives
| Phase | Stored | Notes |
|---|---|---|
| At rest | Seed (encrypted), USK and UFVK in wallet DB | USK should be encrypted in DB or held in a hardware signer |
| Scanning | UIVK, nullifier set | No spending capability needed |
| Building (single key) | USK, proving parameters, Merkle paths | Local proving |
| PCZT constructor | Read-only wallet state | No private keys |
| PCZT prover | + per-spend | No |
| PCZT signer | + sighash | No proving |
3.10 Code reference table
| Type | Crate :: Module |
|---|---|
SpendingKey (Sapling) | sapling-crypto::keys::SpendingKey |
ExpandedSpendingKey (Sapling) | sapling-crypto::keys::ExpandedSpendingKey |
ProofGenerationKey (Sapling) | sapling-crypto::keys::ProofGenerationKey |
FullViewingKey (Sapling) | sapling-crypto::keys::FullViewingKey |
SaplingIvk | sapling-crypto::keys::SaplingIvk |
OutgoingViewingKey (Sapling) | sapling-crypto::keys::OutgoingViewingKey |
DiversifierKey (Sapling) | sapling-crypto::zip32::DiversifierKey |
Diversifier (Sapling) | sapling-crypto::keys::Diversifier |
PaymentAddress (Sapling) | sapling-crypto::PaymentAddress |
SpendingKey (Orchard) | orchard::keys::SpendingKey |
FullViewingKey (Orchard) | orchard::keys::FullViewingKey |
IncomingViewingKey (Orchard) | orchard::keys::IncomingViewingKey |
DiversifierKey (Orchard) | orchard::keys::DiversifierKey |
Address (Orchard) | orchard::Address |
| Transparent extended key | zcash_transparent::keys |
UnifiedSpendingKey | zcash_keys::keys::UnifiedSpendingKey |
UnifiedFullViewingKey | zcash_keys::keys::UnifiedFullViewingKey |
UnifiedAddressRequest | zcash_keys::keys |
UnifiedAddress | zcash_keys::address::UnifiedAddress |
3.11 Derivation graphs
Sapling derivation:
seed (32 B)
| ZIP 32: m / 32' / 133' / acct'
v
sk (Sapling, 32 B)
|
|---- PRF^expand(.,0x00) -> ask (F_l)
|---- PRF^expand(.,0x01) -> nsk (F_l)
|---- PRF^expand(.,0x02) -> ovk (32 B)
|---- PRF^expand(.,0x10) -> dk (32 B)
|
v v
ak = [ask]G^ak nk = [nsk]G^nk
\_____________ ______/
\/
ivk = CRH^ivk(ak, nk) mod l
|
dk -- FF1 --> d (per index)
|
g_d = DiversifyHash(d)
|
pk_d = [ivk] g_d
|
address = (d, pk_d)
Orchard derivation:
sk_O
|
|---- PRF^expand(.,0x06) -> ask (F_q)
|---- PRF^expand(.,0x07) -> nk (F_p, field elt!)
|---- PRF^expand(.,0x08) -> rivk (F_q)
|
v v
ak = [ask]G^ak_O (nk is a scalar; no point op)
\_____________ ______/
\/
ivk = Extract(SinsemillaCommit^rivk(ak, nk))
|
ovk || dk = PRF^expand(., 0x82, ak, nk)
|
dk -- FF1 --> d
|
g_d = DiversifyHash(d)
|
pk_d = [ivk] g_d
|
receiver = (d, pk_d)
Per-transaction ephemerals (both pools):
rseed rcv alpha
| | |
v v v
rcm, esk (used in rsk = ask + alpha
| cv = [v]V |
v + [rcv]R) rk = ak + [alpha] G^ak
epk = [esk]g_d |
sigma_spendAuth =
RedSig.Sign_rsk(sighash)
5. Spec pointers
- Zcash Protocol Specification, section 4: high-level definitions for every key in this catalog.
- Zcash Protocol Specification, section 5: concrete formulas for , , , and the nullifier PRFs.
- ZIP 32: HD derivation paths feeding the per-pool root spending key.
- ZIP 212: the
rseed-derived and that this catalog records. - ZIP 224: Orchard key tree.
- ZIP 316: Unified Addresses, full viewing keys, and the internal/external split for change addresses.
- ZIP 48: transparent account- level keys included in a UFVK.
6. Exercises
- Look up a symbol. A PR comments references
without context. Use this catalog to identify
which pool the key belongs to, its derivation, and the line
in
zcash_keys/src/keys.rsor the externalorchardcrate where the type is defined. - Diversifier count. Compute the maximum number of diversifiers a Sapling account can produce and the expected fraction of valid ones (where lies in the prime-order subgroup). Cite the protocol spec section that gives the numbers.
- Trace a derivation in code. Open
zcash_keys/src/keys.rsand follow the call path from a seed to aUnifiedSpendingKeyto aUnifiedAddress. Cite the file and line of each intermediate type. - Cross-pool capability. A user shares their UFVK with a read-only auditor. Which keys in this catalog does the auditor gain access to? Which do they not? Answer per pool.
Answers in the code
- Sapling expanded-key type:
sapling-crypto::keys::ExpandedSpendingKey(external crate). - Orchard spending-key type:
orchard::keys::SpendingKey(external crate). - Transparent ZIP 48:
zcash_transparent/src/zip48.rs. - Unified containers:
zcash_keys/src/keys.rs. - F4Jumble encoding:
components/f4jumble/src/lib.rs.
7. Further reading
- chapter 06: the HD derivation layer that produces the root spending keys this catalog itemises.
- chapter 24: the circuits that consume these keys as witnesses.
- Hopwood, Bowe, Hornby, Wilcox, Sapling design notes: the original treatment of the Sapling key tree.