Terminology§
The key words “MUST”, “MUST NOT”, “SHOULD”, and “MAY” in this document are to be interpreted as described in BCP 14 1 when, and only when, they appear in all capitals.
The character § is used when referring to sections of the Zcash Protocol Specification. 2
The terms “Mainnet” and “Testnet” in this document are to be interpreted as defined in the Zcash Protocol Specification 3.
The term “network upgrade” is used as described in ZIP 200 4.
The terms below are to be interpreted as follows:
KEM
:Key exchange mechanism. A method of securely conveying a symmetric key from a sender to a recipient.
Hybrid receiver
:A ZIP 316 experimental Sapling or Orchard Receiver containing the protocol’s \((\mathsf{d}, \mathsf{pk}_{d})\) together with the Xiphos-768 public key diversified by \(\mathsf{d}\kern-0.05em\textsf{.}\)
Payment output
:An ordinary shielded output whose note ciphertext is encrypted with the hybrid note key.
Abstract§
A publicly shared shielded address lets a quantum adversary recover its classical incoming viewing key and recognize payments to it. This draft proposes hybrid note encryption using the existing Sapling or Orchard ECDH shared secret and Xiphos, a diversifiable variant of Kopis. The resulting note key depends on both secrets; the note commitment and spending circuit remain unchanged. Hybrid Sapling payments use the Sapling pool; hybrid Orchard payments use the Ironwood pool.
In the proposed network-upgrade format, each hybrid payment output carries a Xiphos ciphertext alongside its ephemeral public key, allowing the wallet to trial-decrypt that output directly. The wallet uses one long-lived Xiphos secret key to scan payments to multiple diversified public keys without recording issued addresses.
Motivation§
The Zcash shielded protocols hide the link between a sender and recipient via two mechanisms:
- Zero-knowledge proofs: privately enforcing transaction correctness.
- In-band secret distribution: encrypting the note given to the recipient on-chain.
With the looming threat of quantum computers, it is necessary to update the Zcash protocol to preserve privacy in the face of quantum adversaries. The zero-knowledge proofs were designed from the start to favour privacy over correctness; the witness data is unrecoverable to a quantum adversary.
For in-band secret distribution, post-quantum privacy is possible in the current protocols, by design, but only for a subset of use cases. There was a known design limitation due to a lack of suitable cryptographic primitives at the time: if a recipients' address is known to the quantum adversary (for instance, it is posted publicly as a donation address, revealed in an interaction with a different transparent chain, or leaked by a sender), the quantum adversary can recover the incoming viewing key and gain visibility of that account’s externally-incoming transactions.
This does not reveal spends from the account (because learning the IVK does not reveal the full viewing key), nor does it reveal wallet-internal transactions for wallets using internal IVKs (because addresses derived from these are never revealed). However, it means that in practice, users cannot achieve full post-quantum privacy for many common Zcash use cases. Only users who give out addresses privately will have post-quantum privacy, and only as long as their out-of-band communications (over which they give out those addresses, or over which they send notes instead of using in-band secret distribution) are post-quantum private (and not eventually revealed).
TODO: Fill in missing paragraphs here.
The latter of these imposes a requirement on the recipient to trial-decrypt every output on the chain, in order to find the outputs sent to them. This imposes a scanning cost that is linear in the number of spend authorities the recipient controls. Using standard encryption techniques, a user that wished to give out multiple independent recipient addresses would be required to generate independent spend authorities, significantly increasing the scanning cost. The solution to this in the Zcash ecosystem is diversification: the ability to derive multiple recipient addresses from the same spend authority.
Privacy Implications§
If the hybrid construction is secure and wallets do not expose a classical-only recognition signal, it aims to hide recipient note contents and ownership even when a quantum adversary knows the published receiver. It does not make the underlying spending authorization post-quantum secure, nor protect old outputs.
Classical diversified addresses are not unlinkable to quantum adversaries.
As long as the classical receiver is present in recipient addresses, addresses will not be unlinkable to quantum adversaries: the classical IVK can be recovered and then used for linking. This hybrid approach still provides value by enabling post-quantum privacy of on-chain transactions, and the use of Xiphos means that scanning efficiency is maintained for multiple addresses. But a further change will be necessary to replace the classically-diversified receiver in circuits with a post-quantum diversified receiver, in order to recover post-quantum unlinkability. At that time, the post-quantum receiver should be migrated to remove the classical component, and remove the hybrid encryption from on-chain transactions.
Requirements§
A publicly shared hybrid receiver can be used to receive payments without exposing those payments to an adversary who can break the existing ECDH mechanism but not Xiphos or the hybrid note-encryption construction.
A wallet can detect payments to multiple diversified hybrid receivers using one incoming viewing key and one associated Xiphos secret key, without keeping a list of the receivers or recognizing payments by ECDH alone.
Each hybrid payment output includes the Xiphos ciphertext needed to trial-decrypt its note.
Non-requirements§
Existing addresses do not gain post-quantum privacy; address rotation is expected.
No circuit changes to the existing pools or spending proofs are part of this proposal.
Specification§
Xiphos construction§
This draft uses the Xiphos construction specified in 5, including its key generation, encapsulation, composed decapsulation, and batch semantics. Xiphos imports its PKE arithmetic and encodings from Kopis 6; its functions and cryptographic definitions are not redefined here. The Zcash-specific parameter selection, key derivation, receivers, and ciphertext placement are specified below.
PQ-private key trees§
For each Sapling or Orchard full viewing key \(\mathsf{fvk}\kern-0.05em\textsf{,}\) derive its classical incoming viewing key \(\mathsf{ivk}_{c}\) as specified for that pool in the Zcash Protocol Specification 7. Derive the 32-byte Xiphos incoming viewing key \(\mathsf{ivk}^{X}\) from the same \(\mathsf{fvk}\kern-0.05em\textsf{:}\)
$$ \mathsf{ivk}^{X} = \mathsf{BLAKE2b\text{-}256}(\mathtt{“Zcash_XiphosIVK1”},; \mathtt{0x01} \mathbin\Vert \mathsf{protocol_id} \mathbin\Vert \mathsf{scope} \mathbin\Vert \mathsf{raw_fvk}) $$
Here \(\mathsf{raw\_fvk}\) is the canonical 96-byte raw FVK encoding for the selected
protocol 8. The key-derivation tag \(\mathsf{protocol\_id}\)
is 0x01 for Sapling or 0x02 for Orchard (including its use in the Ironwood
pool); it is not a ZIP 248 bundle type. \(\mathsf{scope}\) is 0x00 for the
external FVK or 0x01 for its internal FVK. The leading 0x01 is the
version of this Xiphos key derivation. BLAKE2b-256 uses a 32-byte output
and the 16-byte ASCII personalization shown above. The input is exactly
99 bytes. Derive the internal FVK first using the existing pool rules
9, then apply this function to it with \(\mathsf{scope} = 0x01\kern-0.05em\textsf{.}\)
The Zcash integration in this draft provisionally instantiates Xiphos
5 with the Kopis-768 parameter set 6 and
DIVERSIFIER_SIZE = 11. This selects Xiphos-768, with SK_SIZE = 32,
PK_SIZE = 992, and CT_SIZE = 1088 bytes. The receiver and transaction
byte lengths below assume this choice; the final integration parameters
remain to be selected. Use XiphosSkToPk, XiphosEncap, and
XiphosDecap as specified in 5 with these parameters. For
key derivation and decapsulation, use the 32-byte \(\mathsf{ivk}^{X}\) as the
Xiphos secret key. For a valid ordinary \((\mathsf{d}, \mathsf{pk}_{d})\kern-0.05em\textsf{,}\) use the
protocol’s raw 11-byte diversifier \(\mathsf{d}\) and derive
\(\mathsf{pk}^{X}_{d} = \mathsf{XiphosSkToPk}(\mathsf{ivk}^{X}, \mathsf{d})\kern-0.05em\textsf{.}\) Protocol and scope
separation are provided by the derivation of \(\mathsf{ivk}^{X}\kern-0.05em\textsf{,}\) not by Xiphos.
The following experimental ZIP 316 10 Receiver and IVK Types are defined for each protocol:
- The hybrid Sapling Receiver Type has Typecode
0xFFFA, and the hybrid Orchard Receiver Type has Typecode0xFFFB. Each 1,035-byte Receiver Encoding is the corresponding protocol’s 43-byte raw \((\mathsf{d}, \mathsf{pk}_{d})\) payment address followed by the 992-byte \(\mathsf{pk}^{X}_{d}\kern-0.05em\textsf{.}\) - The hybrid Sapling IVK Type has Typecode
0xFFFC, and the hybrid Orchard IVK Type has Typecode0xFFFD. Each 96-byte IVK Encoding is the corresponding protocol’s 64-byte ZIP 316 IVK Encoding (containing \(\mathsf{ivk}_{c}\kern-0.03em\textsf{)}\) followed by the 32-byte \(\mathsf{ivk}^{X}\) derived from the same full viewing key and scope as \(\mathsf{ivk}_{c}\kern-0.05em\textsf{.}\)
To derive a hybrid Receiver from such an IVK, derive \((\mathsf{d}, \mathsf{pk}_{d})\) from the pool IVK Encoding at the selected diversifier index as in ZIP 316, then compute \(\mathsf{pk}^{X}_{d} = \mathsf{XiphosSkToPk}(\mathsf{ivk}^{X}, \mathsf{d})\kern-0.05em\textsf{.}\)
Consumers MUST reject a Unified Address containing a hybrid Receiver whose encoding is not 1,035 bytes, or whose \((\mathsf{d}, \mathsf{pk}_{d})\) or \(\mathsf{pk}^{X}_{d}\) encoding is invalid. A sender that supports hybrid payments MUST prefer a hybrid Receiver Type to the conventional Receiver Type for the same protocol. A hybrid-only UA contains exactly one hybrid Receiver. A sender paying a hybrid Orchard Receiver MUST use the Ironwood pool, consistent with ZIP 326 11.
These Typecodes are experimental; none is permanently allocated.
For incoming scanning, the wallet derives or retains the pool IVK and \(\mathsf{ivk}^{X}\) from the same full viewing key and scope; it need not retain issued diversifiers.
A conventional pool IVK item alone does not carry \(\mathsf{ivk}^{X}\kern-0.05em\textsf{;}\) the hybrid IVK item carries both the pool’s IVK Encoding and \(\mathsf{ivk}^{X}\kern-0.05em\textsf{.}\)
Hybrid in-band secret distribution§
Hybrid note encryption uses the Xiphos-768 instantiation selected in
PQ-private key trees above, with Xiphos’s operations defined in 5,
and the existing protocol’s ECDH and note-plaintext rules: Sapling for the
Sapling pool and Orchard for the Ironwood pool. Note creation and validation
use the lead byte and note commitment of the payment’s pool. In particular,
Ironwood uses the recoverable note plaintext (lead byte 0x03) specified in
ZIP 2005 12.
The hybrid KDF has not received security analysis. This construction has no audited post-quantum privacy claim.
For both encryption and decryption, let the following be as defined for the corresponding pool in the protocol specification’s in-band secret distribution algorithms 13:
- \(\mathsf{Sym}\kern-0.05em\textsf{,}\) \(\mathsf{Sym.Encrypt}\kern-0.05em\textsf{,}\) \(\mathsf{Sym.Decrypt}\kern-0.05em\textsf{,}\) and \(\mathsf{Sym.}\mathbf{K}\kern-0.05em\textsf{;}\)
- \(\mathsf{KA}\kern-0.05em\textsf{,}\) \(\mathsf{KA.DerivePublic}\kern-0.05em\textsf{,}\) and \(\mathsf{KA.Agree}\kern-0.05em\textsf{;}\)
- \(G\kern-0.05em\textsf{,}\) \(\ell_G\kern-0.05em\textsf{,}\) \(\mathsf{repr}_G\kern-0.05em\textsf{,}\) \(\mathsf{abst}_G\kern-0.05em\textsf{,}\) \(r_G\kern-0.05em\textsf{,}\) and \(\mathsf{Extract}_G\kern-0.05em\textsf{;}\)
- \(\mathsf{PRF}^{ock}\) and \(\mathsf{PRF}^{expand}\kern-0.05em\textsf{;}\)
- \(\mathsf{DiversifyHash}\kern-0.05em\textsf{,}\) \(\mathsf{NoteCommitment}\kern-0.05em\textsf{,}\) \(\mathsf{ToScalar}\kern-0.05em\textsf{,}\) and \(\mathsf{ToBase}^{Orchard}\kern-0.05em\textsf{;}\)
- \(\mathsf{LEBS2OSP}\kern-0.05em\textsf{,}\) \(\mathsf{LEOS2IP}\kern-0.05em\textsf{,}\) \(\mathsf{I2LEBSP}\kern-0.05em\textsf{,}\) and \(\mathsf{I2LEOSP}\kern-0.05em\textsf{.}\)
For both algorithms, define the following hybrid-specific parameters and functions:
- Let \(enc32(\mathsf{sharedSecret})\) denote the first 32 bytes of the corresponding pool’s ordinary KDF input 14.
- Let \(\mathsf{XiphosEncap}\) and \(\mathsf{XiphosDecap}\) be the functions defined in 5, with the parameters selected in PQ-private key trees.
- Let \(\mathsf{KDF}\) be \(\mathsf{KDF}^{XSapling}\) or \(\mathsf{KDF}^{XOrchard}\) for the corresponding pool, replacing its ordinary KDF.
Define the hybrid Sapling KDF as:
$$ \mathsf{KDF}^{XSapling}(\mathsf{sharedSecret}, \mathtt{ephemeralKey}, \mathsf{ss}^{X}) = \mathsf{BLAKE2b\text{-}256}(\mathtt{ZcashXSaplingKDF},; \mathsf{enc32}(\mathsf{sharedSecret}) \mathbin\Vert \mathtt{ephemeralKey} \mathbin\Vert \mathsf{ss}^{X}). $$
Define the hybrid Orchard KDF as:
$$ \mathsf{KDF}^{XOrchard}(\mathsf{sharedSecret}, \mathtt{ephemeralKey}, \mathsf{ss}^{X}) = \mathsf{BLAKE2b\text{-}256}(\mathtt{ZcashXOrchardKDF},; \mathsf{enc32}(\mathsf{sharedSecret}) \mathbin\Vert \mathtt{ephemeralKey} \mathbin\Vert \mathsf{ss}^{X}). $$
Here \(\mathsf{BLAKE2b\text{-}256}\) uses a 32-byte output. Each KDF uses its 16-byte personalization string exactly as shown, without padding. Each KDF input is 96 bytes: the concatenation of three 32-byte values, with no pool identifier byte. The KDF uses the original \(\mathtt{ephemeralKey}\) field bytes, not a re-encoding of \(\mathsf{epk}\kern-0.05em\textsf{.}\)
Encryption (Sapling and Orchard)§
Let \(\mathsf{g}_{d}\kern-0.05em\textsf{,}\) \(\mathsf{esk}\kern-0.05em\textsf{,}\) \(\mathsf{ovk}\kern-0.05em\textsf{,}\) \(\mathbf{np}\kern-0.05em\textsf{,}\) \(\mathsf{cv}\kern-0.05em\textsf{,}\) and \(\mathsf{cm}\) be as defined for the corresponding pool’s encryption algorithm 15.
Let \(\mathsf{pk}_{d}\) and \(\mathsf{pk}^{X}_{d}\) be the classical and Xiphos keys in the hybrid Receiver, respectively.
Then to encrypt:
- Let \(\mathsf{P}^{enc}\) be the raw encoding of \(\mathbf{np}\kern-0.05em\textsf{.}\)
- Let \(\mathsf{epk} = \mathsf{KA.DerivePublic}(\mathsf{esk}, \mathsf{g}_{d})\kern-0.05em\textsf{.}\)
- Let \(\mathtt{ephemeralKey} = \mathsf{LEBS2OSP}_{\ell_G}(\mathsf{repr}_G(\mathsf{epk}))\kern-0.05em\textsf{.}\)
- Let \(\mathsf{sharedSecret} = \mathsf{KA.Agree}(\mathsf{esk}, \mathsf{pk}_{d})\kern-0.05em\textsf{.}\)
- Choose random \(\mathsf{m} \overset{R}{\leftarrow} \{0,1\}^{256}\kern-0.05em\textsf{,}\) independently of the other random choices for this note.
- Let \((\mathsf{ss}^{X}, \mathsf{ct}^{X}) = \mathsf{XiphosEncap}(\mathsf{m}, \mathsf{pk}^{X}_{d})\kern-0.05em\textsf{.}\)
- Let \(\mathsf{K}^{enc} = \mathsf{KDF}(\mathsf{sharedSecret}, \mathtt{ephemeralKey}, \mathsf{ss}^{X})\kern-0.05em\textsf{.}\)
- Let \(\mathsf{C}^{enc} = \mathsf{Sym.Encrypt}_{\mathsf{K}^{enc}}(\mathsf{P}^{enc})\kern-0.05em\textsf{.}\)
- If \(\mathsf{ovk} = \bot\kern-0.05em\textsf{:}\)
- Choose random \(\mathsf{ock} \overset{R}{\leftarrow} \mathsf{Sym.}\mathbf{K}\) and \(\mathbf{op} \overset{R}{\leftarrow} \{0,1\}^{\ell_G+256}\) independently.
- Otherwise:
- Let \(\mathsf{cvField} = \mathsf{LEBS2OSP}_{\ell_G}(\mathsf{repr}_G(\mathsf{cv}))\kern-0.05em\textsf{.}\)
- Let \(\mathsf{cmstarField} = \mathsf{LEBS2OSP}_{256}(\mathsf{Extract}_G(\mathsf{cm}))\kern-0.05em\textsf{.}\)
- Let \(\mathsf{ock} = \mathsf{PRF}^{ock}_{\mathsf{ovk}}(\mathsf{cvField}, \mathsf{cmstarField}, \mathtt{ephemeralKey})\kern-0.05em\textsf{.}\)
- Let \(\mathbf{op} = \mathsf{LEBS2OSP}_{\ell_G+256}(\mathsf{repr}_G(\mathsf{pk}_{d}) \mathbin\Vert \mathsf{I2LEBSP}_{256}(\mathsf{esk}))\kern-0.05em\textsf{.}\)
- Let \(\mathsf{C}^{out} = \mathsf{Sym.Encrypt}_{\mathsf{ock}}(\mathbf{op})\kern-0.05em\textsf{.}\)
The payment note ciphertext is \((\mathtt{ephemeralKey}, \mathsf{C}^{enc}, \mathsf{C}^{out})\kern-0.05em\textsf{.}\) The transaction encoding specifies where \(\mathsf{ct}^{X}\) is placed.
Decryption using an Incoming Viewing Key (Sapling and Orchard)§
Let \((\mathtt{ephemeralKey}, \mathsf{C}^{enc}, \mathsf{C}^{out})\) be the note ciphertext, \(\mathtt{cm*}\) the commitment field, and \(\mathsf{pool}\kern-0.05em\textsf{,}\) \(\mathsf{blockHeight}\kern-0.05em\textsf{,}\) \(\mathsf{txVersion}\kern-0.05em\textsf{,}\) and \(\mathsf{allowedLeadBytes}^{pool}\) be as defined for the pool’s incoming-viewing-key decryption algorithm 16.
Let \((\mathsf{ivk}_{c}, \mathsf{ivk}^{X})\) be paired keys of the same full viewing key and scope, with \(\mathsf{ivk}_{c}\) taking the place of the pool’s incoming viewing key in that algorithm. Let \(\mathsf{ct}^{X}\) be the Xiphos ciphertext associated with the output.
To decrypt:
- Let \(\mathsf{epk} = \mathsf{abst}_G(\mathtt{ephemeralKey})\kern-0.05em\textsf{.}\) If \(\mathsf{epk} = \bot\kern-0.05em\textsf{,}\) return \(\bot\kern-0.05em\textsf{.}\)
- Let \(\mathsf{sharedSecret} = \mathsf{KA.Agree}(\mathsf{ivk}_{c}, \mathsf{epk})\kern-0.05em\textsf{.}\)
Call \(\mathsf{XiphosDecap}(\mathsf{ivk}^{X}, \mathsf{ct}^{X}, decrypt)\) with the closure below, whose input is \((\mathsf{ss}^{X})'\kern-0.05em\textsf{.}\) Map its single error to \(\bot\) and return its successful value. Within the closure, each instruction to return \(\bot\) means closure failure, not an early return from \(\mathsf{XiphosDecap}\kern-0.05em\textsf{:}\) re-encryption validation still runs. These are logical rejection conditions; implementations MUST accumulate failures and use constant-time selections and dummy intermediates rather than secret-dependent early exits, including after failed authenticated decryption.
- Let \(\mathsf{K}^{enc} = \mathsf{KDF}(\mathsf{sharedSecret}, \mathtt{ephemeralKey}, (\mathsf{ss}^{X})')\kern-0.05em\textsf{.}\)
- Let \(\mathsf{P}^{enc} = \mathsf{Sym.Decrypt}_{\mathsf{K}^{enc}}(\mathsf{C}^{enc})\kern-0.05em\textsf{.}\) If \(\mathsf{P}^{enc} = \bot\kern-0.05em\textsf{,}\) return \(\bot\kern-0.05em\textsf{.}\)
- Extract \(\mathbf{np} = (\mathsf{leadByte}, \mathsf{d}, \mathsf{v}, \mathsf{rseed}, \mathsf{memo})\) from \(\mathsf{P}^{enc}\kern-0.05em\textsf{.}\) If decoding fails, return \(\bot\kern-0.05em\textsf{.}\)
- If \(\mathsf{leadByte} \notin \mathsf{allowedLeadBytes}^{pool}(\mathsf{blockHeight}, \mathsf{txVersion})\kern-0.05em\textsf{,}\) return \(\bot\kern-0.05em\textsf{.}\)
- For Sapling, let \(\mathsf{pre\_rcm} = [4]\) and \(\mathsf{pre\_esk} = [5]\kern-0.05em\textsf{.}\)
- For Ironwood, let \(\mathsf{\rho} = \mathtt{nf^{old}}\) from the same action, let \(\mathsf{\rhoBytes} = \mathsf{I2LEOSP}_{256}(\mathsf{\rho})\kern-0.05em\textsf{,}\) and let \(\mathsf{pre\_esk} = [4] \mathbin\Vert \mathsf{\rhoBytes}\kern-0.05em\textsf{.}\)
- Let \(\mathsf{g}_{d} = \mathsf{DiversifyHash}(\mathsf{d})\kern-0.05em\textsf{.}\) For Sapling, if \(\mathsf{g}_{d} = \bot\kern-0.05em\textsf{,}\) return \(\bot\kern-0.05em\textsf{.}\)
- If \(\mathsf{leadByte} \neq \mathtt{0x01}\kern-0.05em\textsf{:}\)
- Let \(\mathsf{esk} = \mathsf{ToScalar}(\mathsf{PRF}^{expand}_{\mathsf{rseed}}(\mathsf{pre\_esk}))\kern-0.05em\textsf{.}\)
- If \(\mathsf{LEBS2OSP}_{\ell_G}(\mathsf{repr}_G(\mathsf{KA.DerivePublic}(\mathsf{esk}, \mathsf{g}_{d}))) \neq \mathtt{ephemeralKey}\kern-0.05em\textsf{,}\) return \(\bot\kern-0.05em\textsf{.}\)
- Let \(\mathsf{pk}_{d} = \mathsf{KA.DerivePublic}(\mathsf{ivk}_{c}, \mathsf{g}_{d})\kern-0.05em\textsf{.}\)
- For Ironwood (lead byte
0x03), derive the commitment randomness inputs as in ZIP 2005 12: - Let \(\mathsf{\psi} = \mathsf{ToBase}^{Orchard}(\mathsf{PRF}^{expand}_{\mathsf{rseed}}([9] \mathbin\Vert \mathsf{\rhoBytes}))\kern-0.05em\textsf{.}\)
- Let \(\mathsf{pre\_rcm} = [\mathtt{0x0B}] \mathbin\Vert \mathsf{LEBS2OSP}_{256}(\mathsf{repr}_G(\mathsf{g}_{d})) \mathbin\Vert \mathsf{LEBS2OSP}_{256}(\mathsf{repr}_G(\mathsf{pk}_{d})) \mathbin\Vert \mathsf{I2LEOSP}_{64}(\mathsf{v}) \mathbin\Vert \mathsf{\rhoBytes} \mathbin\Vert \mathsf{I2LEOSP}_{256}(\mathsf{\psi})\kern-0.05em\textsf{.}\)
- Let \(\mathsf{rcm} = \mathsf{LEOS2IP}_{256}(\mathsf{rseed})\) if \(\mathsf{leadByte} = \mathtt{0x01}\kern-0.05em\textsf{;}\) otherwise let \(\mathsf{rcm} = \mathsf{ToScalar}(\mathsf{PRF}^{expand}_{\mathsf{rseed}}(\mathsf{pre\_rcm}))\kern-0.05em\textsf{.}\) If \(\mathsf{rcm} \geq r_G\kern-0.05em\textsf{,}\) return \(\bot\kern-0.05em\textsf{.}\)
- For Sapling, let \(\mathbf{n} = (\mathsf{d}, \mathsf{pk}_{d}, \mathsf{v}, \mathsf{rcm})\kern-0.05em\textsf{.}\)
- For Ironwood, let \(\mathbf{n} = (\mathsf{d}, \mathsf{pk}_{d}, \mathsf{v}, \mathsf{\rho}, \mathsf{\psi}, \mathsf{rcm})\kern-0.05em\textsf{.}\)
- Let \(\mathsf{cmstar}' = \mathsf{NoteCommitment}(\mathbf{n})\kern-0.05em\textsf{.}\) For Ironwood, if \(\mathsf{cmstar}' = \bot\kern-0.05em\textsf{,}\) return \(\bot\kern-0.05em\textsf{.}\)
- If \(\mathsf{I2LEOSP}_{256}(\mathsf{Extract}_G(\mathsf{cmstar}')) \neq \mathtt{cm*}\kern-0.05em\textsf{,}\) return \(\bot\kern-0.05em\textsf{.}\)
- Return \(\mathsf{Ok}((\mathsf{d}, (\mathbf{n}, \mathsf{memo})))\kern-0.05em\textsf{.}\)
The wallet MUST NOT expose provisional outputs from failed trials.
Batch trial decryption§
For the direct ciphertext encoding defined below, each output supplies its
own ct_x field. A wallet scans a batch of \(B\) outputs with \(V\) paired incoming
viewing keys \((\mathsf{ivk}_{c}, \mathsf{ivk}^{X})\kern-0.05em\textsf{,}\) including each account and scope being scanned.
The logical trials are the \(B \times V\) output/key pairs. Each trial has the result
of the single-output incoming-viewing-key decryption algorithm above.
A wallet MAY implement these trials in the following stages:
- Prepare each output’s public fields, retaining the original
ephemeralKeybytes, commitment, ciphertext, and pool-specific context. Compute its Xiphos ciphertext hash and PKE ciphertext preparation once for reuse across incoming viewing keys. Publicly invalid ephemeral keys may be rejected as in single-output decryption. - Prepare the incoming viewing keys. Batch the pool’s ECDH operations where supported, and perform the first phase of Xiphos decapsulation for each eligible output/key pair. Retain an opaque pending state for each pair as described in the Batch Decapsulation section of 5.
- For each pair, combine its ECDH secret and provisional Xiphos secret with the hybrid KDF. Run the note-decryption closure, including plaintext, ephemeral-key, and commitment checks, in batches where supported. Each logical closure returns either the recovered diversifier and note data or failure without a diversifier.
- Complete Xiphos decapsulation for every pending trial, using its matching closure result. Failed closures use the fallback matrix seed and zero diversifier; they MUST NOT be filtered out before final validation.
- Only after completion, release successful notes and memos with their output and viewing-key associations. Deduplicate wallet records where multiple trials identify the same output.
The batch implementation MUST preserve the single-trial constant-time and provisional-result confidentiality requirements. Public-field preparation can be shared across keys; ECDH secrets, recovered messages, and provisional Xiphos secrets are specific to their output/key pairs and MUST NOT be mixed. Key preparation MAY be retained across batches. Batch boundaries and work limits MUST NOT silently omit trials from the wallet’s scan.
Conventional note scanning proceeds independently. Neither success nor failure of conventional decryption permits skipping a hybrid trial. This describes full note decryption; compact-prefix scanning requires a separately specified integration and MUST NOT be treated as authenticated full-ciphertext decryption.
Transaction format changes§
The direct encoding uses a new ZIP 248 V7 bundle variant 17 for
each participating pool: Sapling (bundle type 2) and Ironwood (bundle type 4).
It does not change variant 0 of either type or define a variant for the Orchard
pool (bundle type 3). All outputs/actions in a bundle of the new
variant have a 1,088-byte ct_x field immediately after ephemeralKey
and before encCiphertext in each output’s effecting-data encoding. It is
present for every output/action in that variant and does not replace any
existing field or add note-commitment proof constraints.
For a hybrid payment, the ct_x field contains its \(\mathsf{XiphosEncap}\) ciphertext. For a
conventional output of the new variant, the sender fills ct_x with
1,088 fresh random bytes and encrypts the note conventionally. A wallet
scans each output with its paired \((\mathsf{ivk}_{c}, \mathsf{ivk}^{X})\) and ordinary viewing keys,
without using conventional decryption to gate the hybrid attempt. Legacy
transactions and variant 0 have no ct_x field.
In this bundle variant, ct_x is effecting data. Insert its 1,088 bytes
after ephemeralKey and before encCiphertext[..52] in each output/action
compact digest of ZIP 248 17; other digest inputs and
personalizations follow variant 0. The authorized bundle includes the
chosen ct_x bytes. Pool value-balance, note-commitment, proof, nullifier,
and other rules are inherited from variant 0. Compact scanning data contains
ct_x in addition to the existing commitment, ephemeralKey, and 52-byte
encCiphertext prefix.
The V7 bundle variant identifiers, branch ID, Mainnet and Testnet activation heights, and compact-sync transport format are not assigned here.
Rationale§
Diversifying the post-quantum public key§
The construction-level rationale for Xiphos is in 5. For this Zcash integration, a sender can check the length and encoding of a supplied Xiphos public key, but cannot establish its relationship to \(\mathsf{d}\) without the recipient’s secret key. A receiver derives its own public key from \(\mathsf{d}\) before re-encryption.
Ordinary Kopis derives both the encapsulated key and re-encryption randomness from the decrypted message and a hash of the public key 6. If that public key depends on \(\mathsf{d}\kern-0.05em\textsf{,}\) a wallet cannot calculate the key until after decrypting the note, which is where it learns \(\mathsf{d}\kern-0.05em\textsf{.}\) Xiphos instead derives a provisional note secret from \(\mathsf{m}\) and a hash of the ciphertext, without \(\mathsf{d}\kern-0.05em\textsf{,}\) and still binds re-encryption randomness to the diversified public key. After authenticated note decryption exposes \(\mathsf{d}\kern-0.05em\textsf{,}\) the wallet reconstructs the public key and checks the ciphertext by re-encryption. This separates trial decryption from final validation; it is a new cryptographic construction, not merely a new scheduling of ordinary Kopis decapsulation.
Not changing note commitments§
Notes in existing shielded protocols are conceptually the tuple \((\mathsf{d}, \mathsf{pk}_{d}, \mathsf{value}, \ldots)\kern-0.05em\textsf{.}\) \((\mathsf{d}, \mathsf{pk}_{d})\) in these notes serves two separate purposes:
- It constrains who is permitted to spend the note.
- It defines who can correctly receive the note via in-band secret distribution.
The former of these already has post-quantum privacy via the zero-knowledge proofs (which have statistical privacy, not computational), and thus does not need to be amended by this ZIP. For Ironwood-pool notes, ZIP 2005 12 supports recovery under a potential future protocol; it does not make current spend authorization post-quantum secure.
The latter of these is checked implicitly during trial decryption 16. Summarising the details here: the note plaintext decrypted with \(\mathsf{ivk}_{c}\) only contains \(\mathsf{d}\kern-0.05em\textsf{;}\) \(\mathsf{pk}_{d}\) is re-derived from \(\mathsf{d}\) and \(\mathsf{ivk}_{c}\kern-0.05em\textsf{.}\) Then if the resulting computed note commitment does not match the public note commitment in the transaction, the note is rejected.
A successful hybrid note decryption still verifies the ordinary \((\mathsf{d}, \mathsf{pk}_{d})\) note commitment. The Xiphos public key is not included in that commitment. Whether the hybrid encryption’s authenticated ciphertext and transaction binding are enough to prevent recipient-key substitution or replay across receiver contexts requires separate analysis; this draft does not infer that result solely from the commitment’s existing spending constraints.
Deployment§
This ZIP is proposed for a network upgrade alongside, or after, ZIP 248 17.
Reference implementation§
TBD
Open issues§
- Independent analysis of the Xiphos key derivation, hybrid KDF, receiver privacy, and cross-protocol use.
- Test the hybrid ZIP 316 IVK items and FVK restoration. Prepare independent Xiphos, KDF, and transaction round-trip test vectors.
- Analyse same-secret diversified Xiphos public keys and deferred validation, including multi-target privacy and potential related-key attacks.
References§
-
Information on BCP 14 — “RFC 2119: Key words for use in RFCs to Indicate Requirement Levels” and “RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words” ↩︎
-
Zcash Protocol Specification, Version 2025.6.3 [NU6.1] or later ↩︎
-
Zcash Protocol Specification, Version 2025.6.3 [NU6.1]. Section 3.12: Mainnet and Testnet ↩︎
-
Zcash Protocol Specification, Sapling and Orchard key components and incoming viewing-key derivation ↩︎
-
Zcash Protocol Specification, Sapling and Orchard full viewing-key encodings ↩︎
-
ZIP 32: Shielded Hierarchical Deterministic Wallets, internal key derivation ↩︎
-
ZIP 316: Unified Addresses and Unified Viewing Keys, Experimental Usage ↩︎
-
ZIP 326: NU6.3 Consequences for Wallets. Restrictions on sending ↩︎
-
Zcash Protocol Specification, In-band secret distribution (Sapling and Orchard) ↩︎
-
Zcash Protocol Specification, Sapling and Orchard key agreement and KDFs ↩︎
-
Zcash Protocol Specification, Encryption (Sapling and Orchard) ↩︎
-
Zcash Protocol Specification, Version 2026.8.0 [NU6.3] or later. Decryption using an Incoming Viewing Key (Sapling and Orchard) ↩︎