This page is the Simplified Technical English version of ZIP 256. The source ZIP is the normative text. Read the writing rules to understand the marked words.
ZIP 256: Deployment of Consensus Bug Fixes Between NU6.1 and NU6.2
ZIP: 256 Title: Deployment of Consensus Bug Fixes Between NU6.1 and NU6.2 Owners: Daira-Emma Hopwood <daira@jacaranda.org> Status: Final Category: Consensus / Network Created: 2026-06-09 License: MIT Discussions-To: <https://github.com/zcash/zips/issues/1294>
Terminology
On this page, STE words are in the place of the BCP 14 key words of the source. Refer to the key word table.
The term "network upgrade" in this document has the meaning in ZIP 200 [zip-0200].
The character § is the mark for a section of the Zcash Protocol Specification [protocol].
The terms "Mainnet" and "Testnet" have the meaning in § 3.12 ‘Mainnet and Testnet’ [protocol-networks].
Abstract
This ZIP is a retrospective record of the deployment and the specification of several bug fixes. These fixes are for consensus bugs and denial-of-service bugs. The fixes were applied to the Zcash node implementations after the activation of NU6.1 [zip-0255]. This period of fixes ends before the Orchard Temporary Vulnerability Mitigation and the NU6.2 network upgrade, and it does not include them. The Orchard Temporary Vulnerability Mitigation and NU6.2 are in ZIP 257 [zip-0257].
Motivation
Between the activation of NU6.1 and the activation of NU6.2, several consensus enforcement bugs and denial-of-service vulnerabilities were reported and mitigated. These bugs and vulnerabilities were in the zcashd and zebra full node implementations. In this period, the number of vulnerability reports increased suddenly. The cause of this increase was the widespread use of capable AI models for vulnerability discovery and mitigation.
The fixes for these vulnerabilities were deployed in zcashd releases v6.12.0 to v6.12.4 inclusive. They were also deployed in zebra releases v4.2.0 to v4.5.1 inclusive.
This ZIP contains a record of these items:
- The nature of these fixes.
- The releases that contain each fix.
- The specification changes and clarifications that relate to the fixes.
The purpose is that the behaviour of the network across this period is fully documented.
Specification
Consensus rule changes
The changes in this ZIP include the constricting consensus rule changes in this section. The related consensus changes in the Zcash Protocol Specification are in that section.
Orchard identity rk
An Orchard action with \(\mathtt{rk}\) that encodes the zero point on the Pallas curve caused a panic during proof verification. Now zcashd and zebra both reject \(\mathtt{rk}\) that encodes \(\mathcal{O}_{\mathbb{P}}\). This change is a constricting consensus rule change. The reason is that, in the earlier specification, an \(\mathtt{rk}\) that encodes the zero point was valid.
zcashd enforces this rule from v6.12.1. zebra enforces it from v4.3.1. The rule is also in the orchard crate from version 0.13.0 [ZODL-v6.12.1-fixes].
Changes to chain value balance accounting rules (ZIP 209)
The integer-overflow and value-range hardening for zcashd v6.12.1 is described below. As a result of this hardening, this change was made to ZIP 209.
In the Specification section of ZIP 209, replace this text:
This rule applies to these balances:
- The "Sprout chain value pool balance".
- The "Sapling chain value pool balance".
- The "Orchard chain value pool balance".
The acceptance of a block results in a new block chain. If one or more of these balances becomes negative in that block chain, then all nodes must reject the block as invalid.
Use this text in its place:
This rule applies to these balances:
- The Sprout chain value pool balance.
- The Sapling chain value pool balance.
- The Orchard chain value pool balance.
- The transparent chain value pool balance.
- The deferred development fund chain value pool balance.
The acceptance of a block results in a new block chain. If one or more of these balances becomes negative in that block chain, then all nodes must reject the block as invalid.
The sum of these chain value pool balances is the total supply (calculated with no possibility of overflow). The acceptance of a block results in a new block chain. If this sum becomes greater than \(\mathsf{MAX\_MONEY}\) zatoshis in that block chain, then all nodes must reject the block as invalid.
The non-negativity rule for the deferred development pool balance was already implemented for NU6 [zcashd-lockbox-PR] [zebra-lockbox-PR].
Two rules were implemented in zcashd v6.12.1 [zcashd-v6.12.1-PR]: the non-negativity rule for the transparent balance, and the rule on the total supply. These rules were a response to these weaknesses in the chain value pool balance accounting of zcashd [ZODL-v6.12.1-fixes]:
- Chain value pool balance-tracking reset.
-
With a duplicate block header, it was possible to reset the chain value pool balance-tracking fields silently. After such a reset, ZIP 209 [zip-0209] turnstile enforcement was effectively disabled. This effect applied to the versions of zcashd from v6.0.0 before v6.12.1. (With v6.0.0, it first became possible to trigger the bug on Mainnet.) With a variation of the attack, it was possible to make corrupted per-block chain value pool deltas persistent.
From v6.12.1, zcashd has these fixes:
- zcashd does the pool-value initialization after the duplicate-data check.
- zcashd adds a chain-supply checkpoint at NU6.1 activation. This checkpoint includes all value pools.
- On startup, zcashd calculates the shielded chain value pool deltas again from block data. These deltas are the deltas after the checkpoint.
- Chain value pool balance hardening.
- This hardening is a complement to the fixes above. From v6.12.1, zcashd has a stricter implementation of turnstile and lockbox accounting. This implementation applies overflow and underflow checks more rigorously. With these checks, local reasoning about the correctness of the accounting arithmetic is easier.
One intended effect of the chain value pool balance hardening was the enforcement of the stricter consensus rules above in zcashd. Zebra already used checked arithmetic consistently before this change. Zebra represented each chain value pool balance as an amount with a minimum of zero and a maximum of \(\mathsf{MAX\_MONEY}\). Zebra also limited each intermediate value to its correct range.
Consensus changes in the Zcash Protocol Specification
This section includes only consensus changes. Other clarifications to the Zcash Protocol Specification are in a later section.
Additional consensus node implementation conformance fixes
With each of these fixes, an implementation enforces a rule that is already in the protocol specification. Thus zcashd and zebra agree again with the specification and with each other.
There is no consensus rule change for these implementation flaws. Clarifications to the Zcash Protocol Specification for two of these flaws are in that section below.
- Sprout transaction verification.
- zcashd had a flaw in its verification of Sprout proofs on block connection. Because of this flaw, it was possible that zcashd accepted invalid Sprout transactions. This flaw was fixed in zcashd v6.12.0 [zcashd-v6.12.0-PR] [ZODL-v6.12.0-fixes].
- Orchard invalid \(\mathtt{ephemeralKey}\).
-
This flaw applied to an Orchard action with an \(\mathtt{ephemeralKey}\) that encodes the zero point. The flaw also applied when the \(\mathtt{ephemeralKey}\) is any other 32-byte string that does not encode a valid Pallas curve point. zcashd accepted such an action, but zebra rejected it. This rejection is mandatory in § 4.6 [protocol-actiondesc]. Thus this difference was a potential consensus split.
Now zcashd accepts an \(\mathtt{ephemeralKey}\) only if it is the encoding of a valid non-zero Pallas point. zcashd v6.12.1 had a partial fix [ZODL-v6.12.1-fixes]. (With this fix, zcashd rejected the encoding of the zero Pallas point.) In v6.12.2, the fix was extended to all invalid encodings [zcashd-v6.12.2-PR].
- Sapling v4 \(\mathtt{valueBalanceSapling}\) normalization.
-
The v4 transaction deserializer accepted a transaction that had no Spend descriptions and no Output descriptions, but had a \(\mathtt{valueBalanceSapling}\) that encoded a non-zero value. During deserialization, the value was normalized to zero. The consensus check for this case had to reject the transaction. But the check was applied to the normalized zero, and thus the rejection never occurred.
zebra rejected the encoding at deserialization. This rejection is mandatory in § 7.1.2 [protocol-txnconsensus]. Thus the malformed encoding was sufficient to cause a consensus split. Now zcashd rejects the encoding at deserialization, the same as zebra. This flaw was fixed in zcashd v6.12.2 [zcashd-v6.12.2-PR].
- NU5-onward block-body poisoning.
-
In NU5 and later, the commitment to the authorizing data of v5 transactions is in the \(\mathtt{hashBlockCommitments}\) field of the header (through \(\mathtt{hashAuthDataRoot}\)). This commitment is not in \(\mathtt{hashMerkleRoot}\). A rejection because of the block body was possible before the auth-commitment check. As a result, it was possible that zcashd marked an honest header as invalid permanently.
Now, on the active-tip path, zcashd checks \(\mathtt{hashBlockCommitments}\) before each body-mutable check. zcashd also treats the sidechain case as body-replaceable. With this change, the class of vulnerabilities is closed. The class includes these trigger paths:
bad-blk-sigopsbad-cb-lengthbad-blk-length
The initial fix was in zcashd v6.12.2 [zcashd-v6.12.2-PR]. The class was closed structurally in v6.12.4 [zcashd-v6.12.4-PR] [GHSA-ghc3-g8w4-whf9].
- P2SH input sigop count.
- The P2SH input signature-operation count of zebra did not match zcashd. This count was corrected to restore agreement. This flaw was fixed in zebra v4.5.1 [Zebra-v4.5.1-changelog].
- Input ordering.
- For transactions that spend a mix of chain outputs and mempool outputs, zebra did not keep the order of inputs in
spent_outputs. Thus during validation, it was possible that zebra matched an input against the wrong spent output. This flaw was fixed in zebra v4.2.0 [Zebra-v4.2.0-changelog]. - Other zebra validity fixes.
-
zebra had these validity flaws:
- zebra accepted coinbase transactions that contained Sapling spends.
- zebra did not validate transparent input/output alignment before script verification.
- It was possible for zebra to treat a v5 transaction as verified only on the basis of its mined transaction ID.
These flaws were corrected in zebra v4.4.0 [Zebra-v4.4.0-changelog].
Denial-of-service and node-crash hardening
Because of the issues that follow, remotely triggered crashes or unbounded resource use were possible. These issues have an effect on node liveness. But the set of valid blocks and transactions stays the same.
Zcashd
- Coinbase shielded value-balance crash.
- If a coinbase transaction had a positive Sapling or Orchard value balance, the chain-supply accounting became different from the pool balances in
ConnectBlock. The result was a node abort, and a crash loop on restart. This issue was fixed in zcashd v6.12.4 [GHSA-ghc3-g8w4-whf9]. - Out-of-range pool-value delta.
- This issue applied to a block with an aggregate per-pool value delta out of the monetary range. For such a block, the sending peer stayed unbanned. Also, zcashd wrote the body to disk again on each replay. This issue was fixed in zcashd v6.12.4 [GHSA-ghc3-g8w4-whf9].
- Use-after-free in
ConnectBlock. - CVE-2024-52911 is a use-after-free in the script verification path that zcashd inherited from Bitcoin Core [CVE-2024-52911]. This issue was fixed in zcashd v6.12.3.
- Integer-overflow and value-range hardening.
- The accumulation of chain value pool balances was hardened against undefined behaviour from signed integer overflow. Now zcashd catches value range exceptions as consensus rejections. This issue was fixed in zcashd v6.12.1 [ZODL-v6.12.1-fixes].
Zebra
- Unbounded preallocation and duplicate-delivery DoS.
-
The fix for this issue has these changes:
- Caps on
Vec::with_capacityreservations that depend on counts from peers. - Caps on
block::HashandCountedHeaderallocation. - The removal of rejected block hashes from
SentHashes. Thus honest re-deliveries are not short-circuited.
This issue was fixed in zebra v4.5.0 [Zebra-v4.5.0-changelog].
- Caps on
Clarifications to the Zcash Protocol Specification
The consensus rules stay the same with these clarifications.
§ 7.1.2 ‘Transaction Consensus Rules’
This clarification applies to this rule:
If \(\mathsf{effectiveVersion} = 4\) and there are no Spend descriptions or Output descriptions, then \(\mathtt{valueBalanceSapling}\) must be \(0\).
For this rule, add this note:
zcashd before v6.12.1 had an incorrect implementation of a rule. This rule is for a v4 transaction with no Spend descriptions and no Output descriptions. For this transaction, \(\mathtt{valueBalanceSapling} = 0\) is necessary.
When no Spend or Output descriptions were present, zcashd normalized the value to \(0\) incorrectly. As a result, the failure case for this rule was never reached.
For clarification, \(\mathtt{valueBalanceSapling}\) refers to the value as encoded in the transaction. This value is not normalized in this way. \(\mathtt{valueBalanceSapling}\) does not refer to \(\mathsf{v}^{\textit{SaplingPoolBalance}}\).
Various sections
In § 7.5, add a non-normative note about the invalid \(\mathsf{ephemeralKey}\) issue. In the note, give the versions of zcashd that had this issue.
At each other location where Pallas curve points are decoded, add cross-references to § 5.4.9.6 ‘Pallas and Vesta’. In that section, include implementation notes on validation. Also, at each location where points on other elliptic curves are decoded, add cross-references to the applicable sections.
Deployment
These fixes were enforced immediately on upgrade, in each release below. None of the fixes depended on a block height or on the activation of a network upgrade.
| Release | Date | Fixes |
|---|---|---|
| zcashd v6.12.0 | 2026-03-27 | Sprout transaction verification |
| zcashd v6.12.1 | 2026-04-17 | Orchard zero \(\mathtt{rk}\) / \(\mathtt{ephemeralKey}\); chain value-pool accounting; integer-overflow / value-range hardening |
| zcashd v6.12.2 | 2026-05-06 | Sapling valueBalanceSapling normalization; strengthened \(\mathtt{ephemeralKey}\) check; block-body poisoning (initial) |
| zcashd v6.12.3 | 2026-05-07 | CVE-2024-52911 use-after-free |
| zcashd v6.12.4 | 2026-06-01 | block-body poisoning (structural); coinbase value-balance crash; out-of-range pool-value delta |
| zebra v4.2.0 | 2026-03-12 | input-ordering validity fix |
| zebra v4.3.1 | 2026-04-17 | Orchard zero \(\mathtt{rk}\) / \(\mathtt{ephemeralKey}\) |
| zebra v4.4.0 | 2026-05-01 | coinbase Sapling spend; transparent input/output alignment; v5-verification |
| zebra v4.5.0 | 2026-05-28 | preallocation / duplicate-delivery DoS |
| zebra v4.5.1 | 2026-05-29 | P2SH input sigop count |
Backward compatibility
Most of these fixes are tighter validity checks or node hardening. With them, the nodes reject inputs that were already invalid under the specification. But before the fixes, one or both full node implementations accepted (or mishandled) these inputs. Honest blocks and transactions stay valid. Thus upgraded nodes do not diverge from each other.
In some cases, one implementation accepted a malformed encoding before the fix. In these cases, with the fix, that implementation agrees with the other implementation again. (Examples are the Sapling \(\mathtt{valueBalanceSapling}\) case and the Orchard \(\mathtt{ephemeralKey}\) case. In these cases, the rejection of the applicable encodings was already mandatory in the specification.)
The exclusion of Orchard \(\mathsf{rk}\) = \(\mathcal{O}_{\mathbb{P}}\) is a soft fork. With this exclusion, some transactions are removed from the valid set, and no transactions are added to it. Thus it cannot cause an upgraded node to reject a block that conforming miners produce.
\(\mathsf{rk}\) is the spend authorization validating key, randomized by \(\alpha\). When \(\alpha\) is generated uniformly at random as specified, \(\mathsf{rk}\) = \(\mathcal{O}_{\mathbb{P}}\) occurs only with negligible probability. Thus in practice, this exclusion has no effect on honest transactions.
The changes to chain value balance accounting have an effect on consensus only if there is another violation of the intended consensus security properties.
The denial-of-service hardening changes have no effect on block validity or transaction validity.
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"
- [protocol]
- Zcash Protocol Specification, Version 2025.6.3 or later
- [protocol-networks]
- Zcash Protocol Specification, Version 2025.6.3 [NU6.1]. Section 3.12: Mainnet and Testnet
- [protocol-txnconsensus]
- Zcash Protocol Specification, Version 2025.6.3 [NU6.1]. Section 7.1.2: Transaction Consensus Rules
- [protocol-actiondesc]
- Zcash Protocol Specification, Version 2025.6.3 [NU6.1]. Section 4.6: Action Descriptions
- [protocol-chainvalue]
- Zcash Protocol Specification, Version 2025.6.3 [NU6.1]. Section 4.17: Chain Value Pool Balances
- [protocol-actionencodingandconsensus]
- Zcash Protocol Specification, Version 2025.6.3 [NU6.1]. Section 7.5: Action Description Encoding and Consensus
- [zip-0200]
- ZIP 200: Network Upgrade Mechanism
- [zip-0201]
- ZIP 201: Network Peer Management for Overwinter
- [zip-0209]
- ZIP 209: Prohibit Out-of-Range Chain Value Pool Balances
- [zip-0255]
- ZIP 255: Deployment of the NU6.1 Network Upgrade
- [zip-0257]
- ZIP 257: Deployment of the Orchard Temporary Vulnerability Mitigation and NU6.2 Network Upgrade
- [GHSA-ghc3-g8w4-whf9]
- Urgent Zcash hotfixes v6.12.4 & v6.20.0 (zcashd, affected v5.0.0–v6.13.0)
- [zcashd-v6.12.0-PR]
- zcashd v6.12.0 post-release merge (zcash/zcash#7133)
- [zcashd-v6.12.1-PR]
- zcashd v6.12.1 post-release merge (zcash/zcash#7141)
- [zcashd-v6.12.2-PR]
- Hotfix v6.12.2 (zcash/zcash#7157)
- [zcashd-v6.12.4-PR]
- Zcashd release v6.20.0, which published the v6.12.4 security fixes (zcash/zcash#7174)
- [zcashd-lockbox-PR]
- Add lockbox funding streams and chain lockbox value pool tracking for NU6 (zcash/zcash#6912)
- [Zebra-v4.2.0-changelog]
- Zebra CHANGELOG — Zebra 4.2.0 (2026-03-12)
- [Zebra-v4.4.0-changelog]
- Zebra CHANGELOG — Zebra 4.4.0 (2026-05-01)
- [Zebra-v4.5.0-changelog]
- Zebra CHANGELOG — Zebra 4.5.0 (2026-05-28)
- [Zebra-v4.5.1-changelog]
- Zebra CHANGELOG — Zebra 4.5.1 (2026-05-29)
- [zebra-lockbox-PR]
- Track the balance of the deferred chain value pool (ZcashFoundation/zebra#8729)
- [ZODL-v6.12.1-fixes]
- Several Zcash Vulnerabilities Successfully Remediated (Zcash Open Development Lab, 2026-04-17; zcashd v6.12.1, zebra v4.3.1)
- [ZODL-v6.12.0-fixes]
- Zcash Vulnerability Successfully Remediated (Zcash Open Development Lab, 2026-03-31; zcashd v6.12.0)
- [CVE-2024-52911]
- Bitcoin Core disclosure of CVE-2024-52911