Zcash in Simplified Technical English

This page is the Simplified Technical English version of ZIP 209. The source ZIP is the normative text. Read the writing rules to understand the marked words.

ZIP 209: Prohibit Out-of-Range Chain Value Pool Balances

ZIP: 209
Title: Prohibit Out-of-Range Chain Value Pool Balances
Owners: Sean Bowe <ewillbefull@gmail.com>
        Daira-Emma Hopwood <daira@jacaranda.org>
Status: Final
Category: Consensus
Created: 2019-02-25
License: MIT

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 terms "block chain" and "network upgrade" have the definitions in [zip-0200].

The "Sprout chain value pool balance" for a block chain is the difference between two sums. The first sum is the sum of all vpub_old fields for transactions in the block chain. The second sum is the sum of all vpub_new fields for transactions in the block chain. The balance is the first sum minus the second sum.

The "Sapling chain value pool balance" for a block chain is the negation of a sum. This sum is the sum of all valueBalanceSapling fields for transactions in the block chain.

The "Orchard chain value pool balance" for a block chain is the negation of a sum. This sum is the sum of all valueBalanceOrchard fields for transactions in the block chain. (Before NU5 activation, the Orchard chain value pool balance is zero.)

The "Ironwood chain value pool balance" for a block chain is the negation of a sum. This sum is the sum of all valueBalanceIronwood fields for transactions in the block chain. (Before NU6.3 activation, the Ironwood chain value pool balance is zero.)

The terms "Testnet" and "Mainnet" have the definitions in section 3.12 of the Zcash Protocol Specification [protocol-networks].

Abstract

This ZIP contains a change to the consensus rules. With this change, blocks that result in a negative shielded chain value pool balance are prohibited. Blocks that result in a total supply greater than \(\mathsf{MAX\_MONEY}\) zatoshi are also prohibited.

Motivation

Nodes can monitor two values for each of these chain value pools:

The first value is the total value of notes that are shielded to the pool. The second value is the total value of notes that are unshielded from the pool. If, for a pool, the total value that is unshielded is greater than the total value that was shielded, a balance violation occurred. This violation is in the related shielded transaction protocol.

It is better if the nodes of the network reject the blocks that result in this balance violation. But at this time, nodes do nothing when such an event occurs. Thus chain rollbacks and other disruption can be necessary for remediation.

Specification

This section applies to the chain value pool balances of these pools:

The acceptance of a block results in a new block chain. If one or more of these balances becomes negative in that block chain, all nodes must reject the block as invalid.

The total supply is the sum of these chain value pool balances, calculated with no possibility of overflow. The acceptance of a block results in a new block chain. If the total supply becomes greater than \(\mathsf{MAX\_MONEY}\) zatoshis in that block chain, all nodes must reject the block as invalid.

Nodes can relay transactions even if one or more of them cannot be mined because of the restriction above.

Deployment

This consensus rule is not deployed as part of a network upgrade as defined in ZIP-200 [zip-0200]. There is no mechanism for the network to synchronize the enforcement of this rule. Instead, we recommend that all nodes start to enforce this consensus rule at the acceptance of this ZIP.

There is a risk in the time before all nodes on the network start to enforce this consensus rule. The risk is that miners mine one or more blocks that are prohibited by this rule. Such blocks can result in network fragmentation. This event is considered to be so unlikely that the benefits of earlier enforcement of this consensus rule are much larger than the risk.

This specification was deployed in zcashd v2.0.4 for Testnet, and in zcashd v2.0.5 for Mainnet. The application to the Orchard chain value pool balance is deployed from NU5 activation [zip-0252]. A change was deployed as described in [zip-0256]. With this change, the rules that zcashd applies are more strict. The application to the Ironwood chain value pool balance is deployed from NU6.3 activation [zip-0258].

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-networks]
Zcash Protocol Specification, Version 2021.2.16 or later. Section 3.12: Mainnet and Testnet
[zip-0200]
ZIP 200: Network Upgrade Mechanism
[zip-0252]
ZIP 252: Deployment of the NU5 Network Upgrade
[zip-0256]
ZIP 256: Deployment of Consensus Bug Fixes Between NU6.1 and NU6.2
[zip-0258]
ZIP 258: Deployment of the NU6.3 Network Upgrade