2019-02-25 14:08:38 -08:00
|
|
|
::
|
|
|
|
|
2019-03-14 21:00:00 -07:00
|
|
|
ZIP: 209
|
2020-11-05 16:29:07 -08:00
|
|
|
Title: Prohibit Negative Shielded Chain Value Pool Balances
|
2019-08-01 01:18:23 -07:00
|
|
|
Owners: Sean Bowe <sean@electriccoin.co>
|
2021-06-15 08:43:40 -07:00
|
|
|
Daira Hopwood <daira@electriccoin.co>
|
2019-05-22 17:33:01 -07:00
|
|
|
Status: Final
|
2019-08-01 01:18:23 -07:00
|
|
|
Category: Consensus
|
2019-02-25 14:08:38 -08:00
|
|
|
Created: 2019-02-25
|
|
|
|
License: MIT
|
|
|
|
|
2019-08-01 01:18:23 -07:00
|
|
|
|
2019-02-25 14:08:38 -08:00
|
|
|
Terminology
|
|
|
|
===========
|
|
|
|
|
2020-11-05 16:29:07 -08:00
|
|
|
The key words "MUST", "SHOULD", and "MAY" in this document are to be interpreted as described in
|
2019-02-25 14:08:38 -08:00
|
|
|
RFC 2119. [#RFC2119]_
|
|
|
|
|
2019-03-26 14:55:17 -07:00
|
|
|
The term "block chain" and "network upgrade" are to be interpreted as defined in [#zip-0200]_.
|
|
|
|
|
2020-11-05 16:29:07 -08:00
|
|
|
The "Sprout chain value pool balance" for a given block chain is the sum of all ``vpub_old``
|
|
|
|
fields for transactions in the block chain, minus the sum of all ``vpub_new`` fields for
|
|
|
|
transactions in the block chain.
|
2019-03-26 14:55:17 -07:00
|
|
|
|
2020-11-05 16:29:07 -08:00
|
|
|
The "Sapling chain value pool balance" for a given block chain is the negation of the sum of all
|
2021-06-15 08:43:40 -07:00
|
|
|
``valueBalanceSapling`` fields for transactions in the block chain.
|
|
|
|
|
|
|
|
The "Orchard chain value pool balance" for a given block chain is the negation of the sum of all
|
|
|
|
``valueBalanceOrchard`` fields for transactions in the block chain. (Before NU5 has activated,
|
|
|
|
the Orchard chain value pool balance is zero.)
|
2020-11-05 16:29:07 -08:00
|
|
|
|
|
|
|
The terms "Testnet" and "Mainnet" are to be interpreted as described in section 3.11 of the
|
|
|
|
Zcash Protocol Specification [#protocol-networks]_.
|
2019-02-25 14:08:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
Abstract
|
|
|
|
========
|
|
|
|
|
2020-11-05 16:29:07 -08:00
|
|
|
This proposal defines how the consensus rules are altered such that blocks that produce negative
|
|
|
|
shielded chain value pool balances are prohibited.
|
|
|
|
|
2019-02-25 14:08:38 -08:00
|
|
|
|
|
|
|
Motivation
|
|
|
|
==========
|
|
|
|
|
2019-03-26 16:47:42 -07:00
|
|
|
It is possible for nodes to monitor the total value of notes that are shielded to, or unshielded from,
|
2021-06-15 08:43:40 -07:00
|
|
|
each of the Sprout, Sapling, and Orchard value pools. If the total value that is unshielded exceeds the
|
|
|
|
total value that was shielded for a given pool, a balance violation has occurred in the corresponding
|
|
|
|
shielded transaction protocol.
|
2019-02-25 14:08:38 -08:00
|
|
|
|
2020-11-05 16:29:07 -08:00
|
|
|
It would be preferable for the network to reject blocks that result in the aforementioned balance violation.
|
|
|
|
However, nodes do not currently react to such an event. Remediation may therefore require chain rollbacks
|
|
|
|
and other disruption.
|
|
|
|
|
2019-02-25 14:08:38 -08:00
|
|
|
|
|
|
|
Specification
|
|
|
|
=============
|
|
|
|
|
2021-06-15 08:43:40 -07:00
|
|
|
If any of the "Sprout chain value pool balance", "Sapling chain value pool balance", or
|
|
|
|
"Orchard chain value pool balance" would become negative in the block chain created as a result of
|
|
|
|
accepting a block, then all nodes MUST reject the block as invalid.
|
2020-11-05 16:29:07 -08:00
|
|
|
|
|
|
|
Nodes MAY relay transactions even if one or more of them cannot be mined due to the aforementioned
|
|
|
|
restriction.
|
2019-03-14 18:32:12 -07:00
|
|
|
|
2019-02-25 14:08:38 -08:00
|
|
|
|
|
|
|
Deployment
|
|
|
|
==========
|
|
|
|
|
2020-11-05 16:29:07 -08:00
|
|
|
This consensus rule is not deployed as part of a network upgrade as defined in ZIP-200 [#zip-0200]_
|
|
|
|
and there is no mechanism by which the network will synchronize to enforce this rule. Rather, all
|
|
|
|
nodes SHOULD begin enforcing this consensus rule upon acceptance of this proposal.
|
|
|
|
|
|
|
|
There is a risk that before all nodes on the network begin enforcing this consensus rule that block(s)
|
|
|
|
will be produced that violate it, potentially leading to network fragmentation. This is considered
|
|
|
|
sufficiently unlikely that the benefits of enforcing this consensus rule sooner are overwhelming.
|
2019-02-25 14:08:38 -08:00
|
|
|
|
2020-11-05 16:29:07 -08:00
|
|
|
This specification was deployed in zcashd v2.0.4 for Testnet, and in zcashd v2.0.5 for Mainnet.
|
2021-06-15 08:43:40 -07:00
|
|
|
The application to the Orchard chain value pool balance will be deployed from NU5 activation
|
|
|
|
[#zip-0252]_.
|
2019-02-25 14:08:38 -08:00
|
|
|
|
2019-08-06 07:45:47 -07:00
|
|
|
|
|
|
|
References
|
|
|
|
==========
|
|
|
|
|
2020-11-09 07:59:51 -08:00
|
|
|
.. [#RFC2119] `RFC 2119: Key words for use in RFCs to Indicate Requirement Levels <https://www.rfc-editor.org/rfc/rfc2119.html>`_
|
2020-11-05 16:29:07 -08:00
|
|
|
.. [#protocol-networks] `Zcash Protocol Specification, Version 2020.1.15 or later. Section 3.11: Mainnet and Testnet <protocol/protocol.pdf#networks>`_
|
2019-11-07 12:28:29 -08:00
|
|
|
.. [#zip-0200] `ZIP 200: Network Upgrade Mechanism <zip-0200.rst>`_
|
2021-06-15 08:43:40 -07:00
|
|
|
.. [#zip-0252] `ZIP 252: Deployment of the NU5 Network Upgrade <zip-0252.rst>`_
|