    ZIP: TBD
    Title: Full Post-Quantum Privacy
    Owners: Jack Grigg <thestr4d@gmail.com>
    Credits: Daira-Emma Hopwood
    Status: Draft
    Category: Consensus / Wallet
    Created: 2026-10-07
    License: MIT


# Terminology

The key words "MUST", "MUST NOT", "SHOULD", and "MAY" in this document
are to be interpreted as described in BCP 14 [^BCP14] when, and only
when, they appear in all capitals.

The character § is used when referring to sections of the Zcash Protocol
Specification. [^protocol]

The terms "Mainnet" and "Testnet" in this document are to be interpreted
as defined in the Zcash Protocol Specification [^protocol-networks].

The term "network upgrade" is used as described in ZIP 200 [^zip-0200].

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}$.

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 [^xiphos], including
its key generation, encapsulation, composed decapsulation, and batch
semantics. Xiphos imports its PKE arithmetic and encodings from Kopis
[^kopis]; 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}$, derive its classical
incoming viewing key $\mathsf{ivk}_{c}$ as specified for that pool in the Zcash
Protocol Specification [^protocol-fvk-ivk]. Derive the 32-byte Xiphos
incoming viewing key $\mathsf{ivk}^{X}$ from the **same** $\mathsf{fvk}$:

$$
\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 [^protocol-fvk-encoding]. 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
[^zip-0032], then apply this function to it with $\mathsf{scope} = 0x01$.

The Zcash integration in this draft provisionally instantiates Xiphos
[^xiphos] with the Kopis-768 parameter set [^kopis] 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 [^xiphos] 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})$, use the
protocol's raw 11-byte diversifier $\mathsf{d}$ and derive
$\mathsf{pk}^{X}_{d} = \mathsf{XiphosSkToPk}(\mathsf{ivk}^{X}, \mathsf{d})$. Protocol and scope
separation are provided by the derivation of $\mathsf{ivk}^{X}$, not by Xiphos.

The following experimental ZIP 316 [^zip-0316] Receiver and IVK Types
are defined for each protocol:

- The hybrid Sapling Receiver Type has Typecode `0xFFFA`, and the hybrid
  Orchard Receiver Type has Typecode `0xFFFB`. 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}$.
- The hybrid Sapling IVK Type has Typecode `0xFFFC`, and the hybrid
  Orchard IVK Type has Typecode `0xFFFD`. Each 96-byte IVK Encoding is the
  corresponding protocol's 64-byte ZIP 316 IVK Encoding (containing $\mathsf{ivk}_{c}$)
  followed by the 32-byte $\mathsf{ivk}^{X}$ derived from the same full viewing key
  and scope as $\mathsf{ivk}_{c}$.

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})$.

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 [^zip-0326].

<div class="note"></div>

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.

<div class="note"></div>

A conventional pool IVK item alone does not carry $\mathsf{ivk}^{X}$; the hybrid IVK
item carries both the pool's IVK Encoding and $\mathsf{ivk}^{X}$.

## 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 [^xiphos],
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 [^zip-2005].

<div class="warning"></div>

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 [^protocol-inband]:

- $\mathsf{Sym}$, $\mathsf{Sym.Encrypt}$, $\mathsf{Sym.Decrypt}$, and $\mathsf{Sym.}\mathbf{K}$;
- $\mathsf{KA}$, $\mathsf{KA.DerivePublic}$, and $\mathsf{KA.Agree}$;
- $G$, $\ell_G$, $\mathsf{repr}_G$, $\mathsf{abst}_G$, $r_G$, and $\mathsf{Extract}_G$;
- $\mathsf{PRF}^{ock}$ and $\mathsf{PRF}^{expand}$;
- $\mathsf{DiversifyHash}$, $\mathsf{NoteCommitment}$, $\mathsf{ToScalar}$, and $\mathsf{ToBase}^{Orchard}$;
- $\mathsf{LEBS2OSP}$, $\mathsf{LEOS2IP}$, $\mathsf{I2LEBSP}$, and $\mathsf{I2LEOSP}$.

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 [^protocol-kdf].
- Let $\mathsf{XiphosEncap}$ and $\mathsf{XiphosDecap}$ be the functions
  defined in [^xiphos], 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}$.

### Encryption (Sapling and Orchard)

Let $\mathsf{g}_{d}$, $\mathsf{esk}$, $\mathsf{ovk}$, $\mathbf{np}$,
$\mathsf{cv}$, and $\mathsf{cm}$ be as defined for the corresponding
pool's encryption algorithm [^protocol-encrypt].

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}$.
- Let $\mathsf{epk} = \mathsf{KA.DerivePublic}(\mathsf{esk}, \mathsf{g}_{d})$.
- Let $\mathtt{ephemeralKey} = \mathsf{LEBS2OSP}_{\ell_G}(\mathsf{repr}_G(\mathsf{epk}))$.
- Let $\mathsf{sharedSecret} = \mathsf{KA.Agree}(\mathsf{esk}, \mathsf{pk}_{d})$.
- Choose random $\mathsf{m} \overset{R}{\leftarrow} \{0,1\}^{256}$, independently of the other random choices for this note.
- Let $(\mathsf{ss}^{X}, \mathsf{ct}^{X}) = \mathsf{XiphosEncap}(\mathsf{m}, \mathsf{pk}^{X}_{d})$.
- Let $\mathsf{K}^{enc} = \mathsf{KDF}(\mathsf{sharedSecret}, \mathtt{ephemeralKey}, \mathsf{ss}^{X})$.
- Let $\mathsf{C}^{enc} = \mathsf{Sym.Encrypt}_{\mathsf{K}^{enc}}(\mathsf{P}^{enc})$.
- If $\mathsf{ovk} = \bot$:
  - 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}))$.
  - Let $\mathsf{cmstarField} = \mathsf{LEBS2OSP}_{256}(\mathsf{Extract}_G(\mathsf{cm}))$.
  - Let $\mathsf{ock} = \mathsf{PRF}^{ock}_{\mathsf{ovk}}(\mathsf{cvField}, \mathsf{cmstarField}, \mathtt{ephemeralKey})$.
  - Let $\mathbf{op} = \mathsf{LEBS2OSP}_{\ell_G+256}(\mathsf{repr}_G(\mathsf{pk}_{d}) \mathbin\Vert \mathsf{I2LEBSP}_{256}(\mathsf{esk}))$.
- Let $\mathsf{C}^{out} = \mathsf{Sym.Encrypt}_{\mathsf{ock}}(\mathbf{op})$.

The payment note ciphertext is $(\mathtt{ephemeralKey}, \mathsf{C}^{enc}, \mathsf{C}^{out})$.
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}$,
$\mathsf{blockHeight}$, $\mathsf{txVersion}$, and
$\mathsf{allowedLeadBytes}^{pool}$ be as defined for the pool's
incoming-viewing-key decryption algorithm [^protocol-decryptivk].

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})$. If $\mathsf{epk} = \bot$, return $\bot$.
- Let $\mathsf{sharedSecret} = \mathsf{KA.Agree}(\mathsf{ivk}_{c}, \mathsf{epk})$.

Call $\mathsf{XiphosDecap}(\mathsf{ivk}^{X}, \mathsf{ct}^{X}, decrypt)$ with the closure
below, whose input is $(\mathsf{ss}^{X})'$. 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}$:
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})')$.
- Let $\mathsf{P}^{enc} = \mathsf{Sym.Decrypt}_{\mathsf{K}^{enc}}(\mathsf{C}^{enc})$. If $\mathsf{P}^{enc} = \bot$, return $\bot$.
- Extract $\mathbf{np} = (\mathsf{leadByte}, \mathsf{d}, \mathsf{v}, \mathsf{rseed}, \mathsf{memo})$ from $\mathsf{P}^{enc}$. If decoding fails, return $\bot$.
- If $\mathsf{leadByte} \notin \mathsf{allowedLeadBytes}^{pool}(\mathsf{blockHeight}, \mathsf{txVersion})$, return $\bot$.
- For Sapling, let $\mathsf{pre\_rcm} = [4]$ and $\mathsf{pre\_esk} = [5]$.
- For Ironwood, let $\mathsf{\rho} = \mathtt{nf^{old}}$ from the same action, let $\mathsf{\rhoBytes} = \mathsf{I2LEOSP}_{256}(\mathsf{\rho})$, and let $\mathsf{pre\_esk} = [4] \mathbin\Vert \mathsf{\rhoBytes}$.
- Let $\mathsf{g}_{d} = \mathsf{DiversifyHash}(\mathsf{d})$. For Sapling, if $\mathsf{g}_{d} = \bot$, return $\bot$.
- If $\mathsf{leadByte} \neq \mathtt{0x01}$:
  - Let $\mathsf{esk} = \mathsf{ToScalar}(\mathsf{PRF}^{expand}_{\mathsf{rseed}}(\mathsf{pre\_esk}))$.
  - If $\mathsf{LEBS2OSP}_{\ell_G}(\mathsf{repr}_G(\mathsf{KA.DerivePublic}(\mathsf{esk}, \mathsf{g}_{d}))) \neq \mathtt{ephemeralKey}$, return $\bot$.
- Let $\mathsf{pk}_{d} = \mathsf{KA.DerivePublic}(\mathsf{ivk}_{c}, \mathsf{g}_{d})$.
- For Ironwood (lead byte `0x03`), derive the commitment randomness inputs as in ZIP 2005 [^zip-2005]:
  - Let $\mathsf{\psi} = \mathsf{ToBase}^{Orchard}(\mathsf{PRF}^{expand}_{\mathsf{rseed}}([9] \mathbin\Vert \mathsf{\rhoBytes}))$.
  - 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})$.
- Let $\mathsf{rcm} = \mathsf{LEOS2IP}_{256}(\mathsf{rseed})$ if $\mathsf{leadByte} = \mathtt{0x01}$; otherwise let $\mathsf{rcm} = \mathsf{ToScalar}(\mathsf{PRF}^{expand}_{\mathsf{rseed}}(\mathsf{pre\_rcm}))$. If $\mathsf{rcm} \geq r_G$, return $\bot$.
- For Sapling, let $\mathbf{n} = (\mathsf{d}, \mathsf{pk}_{d}, \mathsf{v}, \mathsf{rcm})$.
- For Ironwood, let $\mathbf{n} = (\mathsf{d}, \mathsf{pk}_{d}, \mathsf{v}, \mathsf{\rho}, \mathsf{\psi}, \mathsf{rcm})$.
- Let $\mathsf{cmstar}' = \mathsf{NoteCommitment}(\mathbf{n})$. For Ironwood, if $\mathsf{cmstar}' = \bot$, return $\bot$.
- If $\mathsf{I2LEOSP}_{256}(\mathsf{Extract}_G(\mathsf{cmstar}')) \neq \mathtt{cm*}$, return $\bot$.
- Return $\mathsf{Ok}((\mathsf{d}, (\mathbf{n}, \mathsf{memo})))$.

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})$, 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:

1. Prepare each output's public fields, retaining the original
   `ephemeralKey` bytes, 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.
2. 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 [^xiphos].
3. 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.
4. 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.
5. 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 [^zip-0248] 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 [^zip-0248]; 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.

<div class="note"></div>

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 [^xiphos]. 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 [^kopis].
If that public key depends on $\mathsf{d}$, a wallet cannot calculate the key until
after decrypting the note, which is where it learns $\mathsf{d}$. Xiphos instead
derives a provisional note secret from $\mathsf{m}$ and a hash of the ciphertext,
without $\mathsf{d}$, and still binds re-encryption randomness to the diversified
public key. After authenticated
note decryption exposes $\mathsf{d}$, 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)$.
$(\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 [^zip-2005] 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 [^protocol-decryptivk].
Summarising the details here: the note plaintext decrypted with $\mathsf{ivk}_{c}$ only contains $\mathsf{d}$;
$\mathsf{pk}_{d}$ is re-derived from $\mathsf{d}$ and $\mathsf{ivk}_{c}$. 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
[^zip-0248].


# 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

[^BCP14]: [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"](https://www.rfc-editor.org/info/bcp14)

[^protocol]: [Zcash Protocol Specification, Version 2025.6.3 [NU6.1] or later](protocol/protocol.pdf)

[^protocol-networks]: [Zcash Protocol Specification, Version 2025.6.3 [NU6.1]. Section 3.12: Mainnet and Testnet](protocol/protocol.pdf#networks)

[^protocol-inband]: [Zcash Protocol Specification, In-band secret distribution (Sapling and Orchard)](protocol/protocol.pdf#saplingandorchardinband)

[^protocol-encrypt]: [Zcash Protocol Specification, Encryption (Sapling and Orchard)](protocol/protocol.pdf#saplingandorchardencrypt)

[^protocol-decryptivk]: [Zcash Protocol Specification, Version 2026.8.0 [NU6.3] or later. Decryption using an Incoming Viewing Key (Sapling and Orchard)](protocol/protocol.pdf#decryptivk)

[^protocol-kdf]: [Zcash Protocol Specification, Sapling and Orchard key agreement and KDFs](protocol/protocol.pdf#concretesaplingkdf)

[^protocol-fvk-ivk]: [Zcash Protocol Specification, Sapling and Orchard key components and incoming viewing-key derivation](protocol/protocol.pdf#saplingkeycomponents)

[^protocol-fvk-encoding]: [Zcash Protocol Specification, Sapling and Orchard full viewing-key encodings](protocol/protocol.pdf#saplingfullviewingkeyencoding)

[^zip-0032]: [ZIP 32: Shielded Hierarchical Deterministic Wallets, internal key derivation](zip-0032.rst)

[^protocol-sym]: [Zcash Protocol Specification, Symmetric Encryption](protocol/protocol.pdf#concretesym)

[^zip-0316]: [ZIP 316: Unified Addresses and Unified Viewing Keys, Experimental Usage](zip-0316.rst#experimental-usage)

[^kopis]: [C2SP: Kopis KEM, version 1.0.0](https://c2sp.org/kopis@v1.0.0)

[^xiphos]: [Xiphos: Diversifiable Kopis](draft-str4d-xiphos.md)

[^zip-0200]: [ZIP 200: Network Upgrade Mechanism](zip-0200.rst)

[^zip-0248]: [ZIP 248: Extensible Transaction Format](zip-0248.rst)

[^zip-0326]: [ZIP 326: NU6.3 Consequences for Wallets. Restrictions on sending](zip-0326.md#restrictions-on-sending)

[^zip-2005]: [ZIP 2005: Ironwood Quantum Recoverability](zip-2005.md)

[^mike]: [MIKE: a fast and compact post-quantum NIKE](https://mike.isogeni.es/mike.pdf)

[^zip-0218]: [ZIP 218: 25-second Block Target Spacing. Shielded sync bandwidth analysis](zip-0218.md#shielded-sync-bandwidth-analysis)

[^zip-0231]: [ZIP 231: Memo Bundles. Rationale](zip-0231.md#rationale)

[^protocol-pallas-security]: [Zcash Protocol Specification. Group Hash into Pallas and Vesta](protocol/protocol.pdf#concretegrouphashpallasandvesta)

[^fips-203]: [NIST FIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard, § 8 and Table 3](https://doi.org/10.6028/NIST.FIPS.203)

[^mike-performance]: [MIKE: Performance and parameter-selection notes](https://mike.isogeni.es/)

[^pq-bench]: [Rust ECDH and hybrid benchmark harness, methodology, and results](https://github.com/zcash/zips/tree/main/zips/draft-str4d-full-pq-privacy/bench)

[^batch-decryption]: [zcash_note_encryption 0.5.1: Batch compact note decryption](https://docs.rs/zcash_note_encryption/0.5.1/zcash_note_encryption/batch/fn.try_compact_note_decryption.html)

[^mlkem-batching]: [ML-KEM batching derivation and experimental factoring](https://github.com/zcash/zips/blob/main/zips/draft-str4d-full-pq-privacy/bench/mlkem-analysis.md)

[^mike-batching]: [MIKE receiver batching derivation and stage measurements](https://github.com/zcash/zips/blob/main/zips/draft-str4d-full-pq-privacy/bench/mike-analysis.md)
