Skip to content

ZIP 2005: Improve security argument; drop leadByte and AssetBase from H^{rcm,Orchard}; commit to deployment option 1 - #1275

Merged
daira merged 26 commits into
zcash:mainfrom
daira:zip-2005-drop-leadByte-from-hrcm
May 18, 2026
Merged

ZIP 2005: Improve security argument; drop leadByte and AssetBase from H^{rcm,Orchard}; commit to deployment option 1#1275
daira merged 26 commits into
zcash:mainfrom
daira:zip-2005-drop-leadByte-from-hrcm

Conversation

@daira

@daira daira commented May 16, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to merged PR #1264. This branch makes the following changes:

Security argument

  • Use note-tuple terminology consistently in the Spendability arguments, correcting pre-existing imprecisions in the $\mathsf{notetuple}$ framing.
  • Drop $\mathsf{leadByte}$ from the input to $\mathsf{H^{rcm,Orchard}}$. $\mathsf{leadByte}$ versions the note plaintext, not the note. The previous design created a layering violation between the handling of note plaintexts vs notes. The $\mathsf{leadByte} = \mathtt{0x02}$ case retains the existing protocol-spec derivation; the $\mathsf{leadByte} = \mathtt{0x03}$ case uses the new $\mathsf{H^{rcm,Orchard}}$ directly.
  • ZIP 2005 is now specified to activate without ZSAs, so drop $\mathsf{AssetBase}$ from the input to $\mathsf{H^{rcm,Orchard}}$.
  • Inline $\mathsf{H^{rcm,Sapling}}$ (it was a wrapper around $\mathsf{ToScalar^{Sapling}}(\mathsf{PRF^{expand}_{rseed}}([\mathtt{0x04}]))$ with unused args); reduce the signature of $\mathsf{H^{esk,Sapling}}$ from (_, _) to (_) matching its Canopy-onward call shape; replace if Sapling and leadByte = ... / if Orchard and leadByte = ... with the explicit if protocol = Sapling and ... / if protocol = Orchard and ... form in the prose dispatches.
  • Define Derive_rcm^{Sapling,Orchard} helpers that bundle the $\mathsf{leadByte}$ case-split for $\mathsf{rcm}$ derivation. Call sites in §4.7.2 / §4.7.3 / §4.8.2 / §4.8.3 / §4.20.2 / §4.20.3 invoke these helpers instead of dispatching inline. The §4.20.2 / §4.20.3 decryption $\mathsf{rcm}$ derivation collapses from a 4-case case-split to a 2-case protocol-conditional call.
  • Pin $\mathsf{ak}$ (up to $y$-sign of $\mathsf{ak}^{\mathbb{P}}$) for Spend Authorization key-binding, in addition to $\mathsf{qk}$. The spend-authorization verification key is randomized from $\mathsf{ak}^{\mathbb{P}}$; the previous motivation enumeration listed only $\mathsf{qk}$. The formal key-binding predicate already pinned $\mathsf{ak}$ via $\mathsf{ivk} = \mathsf{Commit^{ivk}_{rivk}}(\mathsf{ak}, \mathsf{nk})$; the enumeration was incomplete.
  • Make the key-binding algebraic setup explicit per §5.4.1.10 'Sinsemilla commitments': exhibit $\mathcal{S}$ as the rivk-randomization base, $M'$ as $\mathsf{SinsemillaHashToPoint}$ over the encoded $(\mathsf{ak}, \mathsf{nk})$, and the WLOG scalar-lift $M' = [h(\mathsf{ak}, \mathsf{nk})], \mathcal{S}$ for a Pedersen-like deterministic $h$. Resolves two duplicate TODOs.

Post-quantum analysis

  • Restructure the "Adaptation to the quantum setting" section: promote from ### (inside Security analysis) to ## (top-level, after the formal Spendability argument), so that all quantum analysis follows all classical analysis rather than being sandwiched between the informal and formal arguments. Trim the informal binding argument's quantum mentions and add a forward reference.
  • Define the collapsing property as the quantum analog of collision-resistance; survey collapsing for standard hash-function constructions (Unruh on Merkle–Damgård, Czajkowski et al. on sponge, ACMT 2025 on quantum-indifferentiability, Fehr 2018 on HAIFA, Gunsing and Mennink 2022 on tree hashes). Apply Fehr's theorem: modelling $\mathsf{H^{rcm}}$ as collapsing reduces to modelling BLAKE2b's compression function as collapsing.
  • State concrete QROM bounds (Zhandry's compressed-oracle technique, with CFHL 2021's classical-style derivation as a co-citation): the classical $q^2 / r_{\mathbb{P}}$ collision probability becomes $O(q^3 / r_{\mathbb{P}})$ in QROM. For Zcash-relevant parameters the worst-case QROM bound is $\sim 2^{-74}$; the practically achievable bound stays closer to the classical $\sim 2^{-134}$ since BHT-style attacks would need the $2^{92.3}$-bit quantum memory shown to be infeasible.
  • Resolve three prior TODOs in the security argument: $\mathsf{Extract}_{\mathbb{P}}$ / QROM composition, CBHSU2017 / Unruh literature discussion, and the QROM-lift technical conditions.

Threat analysis

  • Draft the "Effects of discrete-log-breaking attacks" sections (before / after the switch, and "Attacks addressed by the Recovery Protocol") — covering the threat across all of Zcash's primitives, what becomes permanently unspendable post-switch (Sapling, Sprout, and non-recoverable Orchard), the out-of-scope status of transparent funds, and the limits of the Recovery Protocol. Replaces a prior TBD; adds ZIP 209, ZIP 2003, and a 2025 Google paper on ECC-cryptocurrency quantum recovery to the references.

Deployment

  • Commit to deployment option 1 (deploy in v5 transactions before the next NU, with a $\mathsf{ZIP2005ActivationHeight}$); restructure $\mathsf{allowedLeadBytes}$ accordingly.
  • Add a "Proactive movement of funds to recoverable notes" section: wallets SHOULD sweep all non-recoverable funds they control into recoverable Orchard notes once this proposal is deployed. Wallet-internal sends use $\mathtt{0x03}$ immediately; external sends use $\mathtt{0x02}$ until there is wider support for receiving $\mathtt{0x03}$.
  • Decouple ZIP 2005 from OrchardZSA in framing prose.

Terminology and housekeeping

  • FROST multisignaturesFROST threshold multisignatures (a multisignature scheme is not necessarily a threshold scheme).
  • Update Credits and Pull-Request fields.

Bibliography

  • Annotate eprint citations with "Also published in …" when the paper also appears at a conference / in a journal, signalling that the linked revision may differ from the named published version. Applied to eleven entries (Unruh 2015/2016, CBHSU 2017, Fehr 2018, Zhandry 2018, CFHL 2021, CMSZ 2021, GM 2022, BHT 1997, Bernstein 2009, Maurer 2002).
  • New references introduced by the post-quantum analysis: Fehr 2018 (HAIFA collapsing), Zhandry 2018 (compressed-oracle technique), CFHL 2021 (classical-style derivation), Gunsing and Mennink 2022 (tree-hash collapsing).
  • Update the BLAKE3 reference to cite Zooko Wilcox's current name.

Cross-ZIP

  • ZIPs 226 / 230 / 231: replace explicit 0x03 references with placeholders ({{ZSALEADBYTE}} / {{LEADBYTE}} / {{MBLEADBYTE}}) since 0x03 is now reserved for ZIP 2005.
  • Withdraw ZIP 230 (obsoleted by ZIP 248).

Suggested checks

  • Spot-check that Derive_rcm^{Sapling} and Derive_rcm^{Orchard} dispatch correctly and cover the relevant leadByte values.
  • The $\mathsf{allowedLeadBytes}$ matrix covers all valid (protocol, height, txVersion) combinations.
  • The key-binding algebraic-setup paragraph matches §5.4.1.10 'Sinsemilla commitments' (domain strings, encoding).

🤖 Filed with Claude Code

@daira
daira requested review from a team and ValarDragon May 16, 2026 14:53
@daira
daira force-pushed the zip-2005-drop-leadByte-from-hrcm branch 5 times, most recently from c21c12d to d49b900 Compare May 16, 2026 16:23
Comment thread zips/zip-2005.md
Comment thread zips/zip-2005.md Outdated
Comment thread zips/zip-2005.md
Comment thread zips/zip-2005.md Outdated
@daira
daira force-pushed the zip-2005-drop-leadByte-from-hrcm branch 2 times, most recently from 0c07846 to 7c4702b Compare May 16, 2026 17:50
Comment thread zips/zip-2005.md Outdated
@daira
daira force-pushed the zip-2005-drop-leadByte-from-hrcm branch from 7c4702b to 8e73b4c Compare May 16, 2026 18:07
@ebfull
ebfull self-requested a review May 16, 2026 18:13
ValarDragon
ValarDragon previously approved these changes May 16, 2026

@ValarDragon ValarDragon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed, and it looks great to me! Thank you!

Really glad:

  • We are ZIP-cleared on using LeadByte 0x03
  • LeadByte is removed from the rcm hash
  • We have the deployment strategy were going for in the ZIP
  • We removed AssetBase from the rcm hash

aphelionz
aphelionz previously approved these changes May 16, 2026

@aphelionz aphelionz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@daira
daira dismissed stale reviews from aphelionz and ValarDragon via b2a1a1c May 16, 2026 21:11
@daira
daira force-pushed the zip-2005-drop-leadByte-from-hrcm branch 5 times, most recently from e592d21 to c476a94 Compare May 17, 2026 00:14
Comment thread zips/zip-2005.md
Comment thread zips/zip-2005.md
@daira
daira force-pushed the zip-2005-drop-leadByte-from-hrcm branch 2 times, most recently from e3d9442 to 1d17005 Compare May 17, 2026 01:46
ebfull
ebfull previously approved these changes May 17, 2026
daira and others added 21 commits May 18, 2026 13:15
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
…ion.

Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
The 0x03 note plaintext format now does not include AssetBase. Drop
AssetBase from:

* the H^{rcm,Orchard} definition (signature and pre_rcm body) in §4.7.3
  and in the specialised import in the Spendability proof;
* the Sending Notes (Orchard) and Dummy Notes (Orchard) procedures: drop
  the "Let AssetBase = V^Orchard" preludes, the "AssetBase★ = ..."
  inline-let lines, and AssetBase★ from the H^{rcm,Orchard} call sites;
  also drop AssetBase★ from "use ... in the inputs to NoteCommit";
* the Decryption procedures (§4.20.2 and §4.20.3): drop the
  "Let AssetBase = V^Orchard" prelude, AssetBase★ from the inline let,
  and from the H^{rcm,Orchard} call sites;
* the Recovery Statement witness's noterepr;
* the rationale's "Repairing note commitments" noterepr;
* the flow diagram (drop AssetBase from the "v, AssetBase" pre_rcm input).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per the deployment-option-1 decision (ZIP 2005 deploys Orchard-only,
without ZSAs), reframe places that implied ZIP 2005's scope included
OrchardZSA:

* "It can optionally be done at the same time as changes necessary to
  implement ... ZSAs" -> "It is compatible with ... ZSAs".
* Rename "Flow diagram for the Orchard and OrchardZSA protocols" to
  "Flow diagram for the Orchard protocol" (the diagram shows the 0x03
  recoverable-note case, which is Orchard-only). Update the cross-reference
  to match.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
…-conditionalise dispatch.

Three follow-ups to the leadByte case-split refactoring:

* Remove the named H^{rcm,Sapling} function (it was a wrapper with two
  unused args around ToScalar^Sapling(PRF^expand_rseed([0x04]))) and
  inline the right-hand side at the call sites in §4.7.2, §4.8.2, §4.20.2,
  and §4.20.3.
* Reduce H^{esk,Sapling}'s signature from (_, _) to (_), matching its
  Canopy-onward call shape H^{esk,protocol}_{rseed}(ρ) at §4.20.2's
  decryption step.
* Replace prose conditions "if Sapling and leadByte = ..." /
  "if Orchard and leadByte = ..." with
  "if protocol = Sapling and leadByte = ..." /
  "if protocol = Orchard and leadByte = ..." in the §4.20.2 and §4.20.3
  rcm dispatches.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-derivation sites.

Define protocol-specific helpers that bundle the leadByte case-split for
rcm derivation:

* Derive_rcm^{Sapling}_{rseed}(leadByte) dispatches between
  LEOS2IP_{256}(rseed) (leadByte=0x01) and
  ToScalar^Sapling(PRF^expand_rseed([0x04])) (leadByte=0x02).
* Derive_rcm^{Orchard}_{rseed}(leadByte, g★_d, pk★_d, v, ρ, ψ) dispatches
  between the existing legacy derivation
  ToScalar^Orchard(PRF^expand_rseed([0x05] || ρ)) (leadByte=0x02) and
  the new H^{rcm,Orchard}_{rseed}(g★_d, pk★_d, v, ρ, ψ) (leadByte=0x03).

Update the call sites in §4.7.2 / §4.7.3 / §4.8.2 / §4.8.3 / §4.20.2 /
§4.20.3 to invoke the helpers. The §4.20.2 / §4.20.3 decryption dispatch
collapses from a 4-case rcm case-split to a 2-case protocol-conditional
call.

Drop the now-redundant parenthetical noting that H^{rcm,Orchard} is
defined only for the leadByte=0x03 case (H^{rcm,Orchard} is now only
referenced inside Derive_rcm^{Orchard}'s definition).

Update the "which define ..." cross-reference at the order-of-operations
note to name Derive_rcm^{\{Sapling,Orchard\}} rather than H^{rcm,Orchard},
since Derive_rcm is now the primary export of the affected sections.

Harmonize the notation for H^ψ in the rationale: ψ = H^ψ(rseed, ρ) becomes
ψ = H^ψ_{rseed}(ρ). The two forms are equivalent under the protocol-spec
convention; the subscripted form is preferred for consistency.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ing.

The Spend Authorization argument needs ak (up to y-sign of ak^P)
uniquely determined by ivk, because the verification key
rk = ak^P + [alpha] G depends on ak. The formal key-binding predicate
already pins ak via ivk = Commit^{ivk}_{rivk}(ak, nk); the motivation
enumeration in the key-binding section was incomplete.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the abstract ShortHash([h(ak,nk)+rivk] S) form with the
explicit Sinsemilla-commitment definition from § 5.4.1.10:
exhibit S as the rivk-randomization base via GroupHash^P, M' as
SinsemillaHashToPoint over LEBSP(ak) || LEBSP(nk), and the WLOG
scalar-lift M' = [h(ak,nk)] S using a Pedersen-like deterministic h.
Drops two duplicate "verify the exact form" TODOs.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…lift.

Extract_P is a deterministic 2-to-1 map on non-identity Pallas points
and does not query any random oracle, so it composes the same way
classically and quantumly. The factor of 2 from the 2-to-1 reduction
is already absorbed into the break-probability bound.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both forms render identically; \choose was already the dominant
notation in the proofs.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… section.

Readers may be unfamiliar with the stacked-fraction \choose form.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…splaymath, I2LEBSP).

* In § 4.7.2, define Derive_rcm^Sapling before H^esk,Sapling (rcm-then-esk
  ordering, matching § 4.7.3).
* In § 4.8.2, add an import preamble for Derive_rcm^Sapling.
* In § 4.8.3 and § 4.20.2/§ 4.20.3, replace the stale H^{rcm,Orchard} import
  with Derive_rcm^Orchard (and add Derive_rcm^Sapling to § 4.20.x), since
  the actual derivation goes through the helpers.
* In the key-binding algebraic setup, replace the non-existent LEBSP with
  I2LEBSP_{l^Orchard} and lift the three named formulas to display math
  for readability.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Cover the threat surface across Zcash's shielded and transparent
protocols; split into "before the switch", "after the switch", and
"attacks addressed by the Recovery Protocol" subsections; enumerate
attack classes (Balance, Spend authentication, Spendability,
Privacy). Add ZIP 209 (turnstile), ZIP 2003 (disable v4 transactions),
and the Google 2025 paper on quantum attacks against blockchains to
the references.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
…tocol QROM lift.

Cite Unruh on the collapsing property, Czajkowski et al. for sponge,
ACMT2025 for the sponge strengthening, Fehr 2018 for the unified
algebraic framework covering Merkle–Damgård and HAIFA (BLAKE2b's
construction), and Gunsing and Mennink 2022 for tree hashes
(relevant for the Recovery Protocol's note-commitment tree).

Modelling H^rcm as collapsing reduces, via Fehr's theorem, to
modelling BLAKE2b's compression function as collapsing — the
natural post-quantum analog of the random-oracle modelling
assumption underlying the classical-ROM analysis.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…technique.

By the standard BHT-style cubic-in-q quantum collision speed-up,
the classical-ROM bounds q²/r_P transfer to QROM with at most
O(q³/r_P) success probability. For Zcash-relevant parameters
(q << 2^60, r_P ≈ 2^254), the cubic ceiling is ~2^{-74}; the
practically achievable bound stays closer to the classical
~2^{-134} since BHT-style attacks need infeasible quantum memory
(per the 2^{92.3} argument earlier in the section) and the best
known generic quantum attack is the classical attack of [vOW1999].

Add [Zhandry2018] eprint 2018/276 to the references.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…for conference versions.

The eprint version of a paper may differ from the camera-ready
published at a conference / in a journal. "Also published in ..."
makes the multi-venue status explicit and signals to readers that
the linked revision may differ from the named conference version.
Applied to all bibliography entries that have both an eprint (or
similar) URL and a known conference / journal version.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The leadByte choice is operationally irrelevant for dummy notes
(plaintexts cannot be decrypted), but explicit guidance to use the
highest allowed leadByte avoids an ambiguity flagged in review by
@ebfull.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…or-of-2 absorption.

The Extract_ℙ composability paragraph asserted that the factor of 2 from
the 2-to-1 reduction is absorbed into the break-probability bound, but
didn't state the side-condition that makes this work: the fibres form a
uniform partition phi for non-identity points.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@daira
daira force-pushed the zip-2005-drop-leadByte-from-hrcm branch from 5512415 to 537c392 Compare May 18, 2026 12:18
@daira daira changed the title ZIP 2005: Drop leadByte and AssetBase from H^{rcm,Orchard}; commit to deployment option 1 ZIP 2005: Improve security argument; drop leadByte and AssetBase from H^{rcm,Orchard}; commit to deployment option 1 May 18, 2026

@ValarDragon ValarDragon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approve on assumption that its same as pre-rebase

@daira
daira merged commit bacdc71 into zcash:main May 18, 2026
3 checks passed
@daira
daira deleted the zip-2005-drop-leadByte-from-hrcm branch May 18, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants