diff --git a/README.rst b/README.rst index 94d9db3a4..d377de233 100644 --- a/README.rst +++ b/README.rst @@ -57,14 +57,16 @@ Index of ZIPs 203 Transaction Expiry Final 205 Deployment of the Sapling Network Upgrade Final 206 Deployment of the Blossom Network Upgrade Final - 207 Split Founders' Reward Withdrawn + 207 Funding Streams Draft 208 Shorter Block Target Spacing Final 209 Prohibit Negative Shielded Value Pool Final 210 Sapling Anchor Deduplication within Transactions Draft 213 Shielded Coinbase Implemented (zcashd) + 214 Consensus rules for a Zcash Development Fund Draft 221 FlyClient - Consensus-Layer Changes Proposed 243 Transaction Signature Verification for Sapling Final 250 Deployment of the Heartwood Network Upgrade Draft + 251 Deployment of the ${NU4} Network Upgrade Draft 308 Sprout to Sapling Migration Final 310 Security Properties of Sapling Viewing Keys Draft 401 Addressing mempool denial-of-service Final diff --git a/css/style.css b/css/style.css index 36c73f23f..251f03863 100644 --- a/css/style.css +++ b/css/style.css @@ -122,7 +122,7 @@ div.math { margin: 0 1rem 1rem 1rem; text-align: center; padding: 0; - font-size: 0.9375rem; + font-size: 0.75rem; } a, a:visited { @@ -170,15 +170,6 @@ table { border: 0 none transparent; } -@media (max-width: 576px) { - table:not(.footnote) { - display: block; - } - pre, div.math, table { - font-size: 0.6rem; - } -} - th, td { border: 1px solid #212529; } @@ -221,12 +212,27 @@ td:first-child { content: "]"; } +@media (max-width: 576px) { + table:not(.footnote) { + display: block; + } + pre, div.math { + font-size: 0.5rem; + } + table { + font-size: 0.6rem; + } +} + @media (min-width: 576px) { body > section { max-width: initial; width: 510px; } - pre, div.math, table { + pre, div.math { + font-size: 0.5rem; + } + table { font-size: 0.6rem; } } @@ -235,7 +241,10 @@ td:first-child { body > section { width: 690px; } - pre, div.math, table { + pre, div.math { + font-size: 0.55rem; + } + table { font-size: 0.7rem; } } @@ -244,7 +253,10 @@ td:first-child { body > section { width: 770px; } - pre, div.math, table { + pre, div.math { + font-size: 0.6rem; + } + table { font-size: 0.8rem; } } @@ -254,8 +266,11 @@ td:first-child { max-width: initial; width: 920px; } - pre, div.math, table { - font-size: 0.9375rem; + pre, div.math { + font-size: 0.68rem; + } + table { + font-size: 0.85rem; } } @@ -265,7 +280,7 @@ td:first-child { width: 1200px; } pre, div.math { - font-size: 0.9375rem; + font-size: 0.75rem; } table { font-size: 1rem; diff --git a/index.html b/index.html index 76d4d4861..6da551a04 100644 --- a/index.html +++ b/index.html @@ -36,14 +36,16 @@ 203 Transaction Expiry Final 205 Deployment of the Sapling Network Upgrade Final 206 Deployment of the Blossom Network Upgrade Final - 207 Split Founders' Reward Withdrawn + 207 Funding Streams Draft 208 Shorter Block Target Spacing Final 209 Prohibit Negative Shielded Value Pool Final 210 Sapling Anchor Deduplication within Transactions Draft 213 Shielded Coinbase Implemented (zcashd) + 214 Consensus rules for a Zcash Development Fund Draft 221 FlyClient - Consensus-Layer Changes Proposed 243 Transaction Signature Verification for Sapling Final 250 Deployment of the Heartwood Network Upgrade Draft + 251 Deployment of the ${NU4} Network Upgrade Draft 308 Sprout to Sapling Migration Final 310 Security Properties of Sapling Viewing Keys Draft 401 Addressing mempool denial-of-service Final diff --git a/protocol/protocol.tex b/protocol/protocol.tex index 91a83d954..8aaa8041c 100644 --- a/protocol/protocol.tex +++ b/protocol/protocol.tex @@ -8644,6 +8644,9 @@ \heartwood{The specifications of the \Heartwood upgrade are described in this document, \cite{ZIP-250}, \cite{ZIP-213}, and \cite{ZIP-221}.} +\nufour{The specifications of the \Nufour upgrade are described in this document, +\cite{ZIP-251}, \cite{ZIP-207}, and \cite{ZIP-214}.} + \vspace{1ex} \introlist Each \networkUpgrade is introduced as a @@ -9225,8 +9228,8 @@ \item There are no changes to the \blockVersionNumber or format for \Blossom. } \heartwood{ - \item The $\hashFinalSaplingRoot$ field is renamed to $\hashLightClientRoot$, and - its semantics changed according to \cite{ZIP-221}. + \item For \Heartwood, the $\hashFinalSaplingRoot$ field is renamed to $\hashLightClientRoot$. + Once \Heartwood activates, the meaning of this field changes according to \cite{ZIP-221}. } \end{pnotes} @@ -10386,6 +10389,19 @@ \intropart \lsection{Change History}{changehistory} +\historyentry{2020.1.3}{} + +\begin{itemize} + \item No changes to \Sprout, \Sapling, or \Blossom. +\heartwood{ + \item Minor wording clarifications. +} +\nufour{ + \item Reference \cite{ZIP-251}, \cite{ZIP-207}, and \cite{ZIP-214} for the \Nufour upgrade. +} +\end{itemize} + + \historyentry{2020.1.2}{2020-03-20} \begin{itemize} diff --git a/protocol/zcash.bib b/protocol/zcash.bib index 2693ad7c6..4538337b8 100644 --- a/protocol/zcash.bib +++ b/protocol/zcash.bib @@ -927,6 +927,15 @@ @misc{ZIP-213 urldate={2020-03-20} } +@misc{ZIP-214, + presort={ZIP-0214}, + author={Daira Hopwood}, + title={Consensus rules for a Zcash Development Fund}, + howpublished={Zcash Improvement Proposal 214. Created February~28, 2020.}, + url={https://zips.z.cash/zip-0214}, + urldate={2020-03-24} +} + @misc{ZIP-221, presort={ZIP-0221}, author={Jack Grigg}, @@ -954,6 +963,15 @@ @misc{ZIP-250 urldate={2020-03-20} } +@misc{ZIP-251, + presort={ZIP-0251}, + author={Daira Hopwood}, + title={Deployment of the \$\{NU4\} Network Upgrade}, + howpublished={Zcash Improvement Proposal 251. Created February~28, 2020.}, + url={https://zips.z.cash/zip-0251}, + urldate={2020-03-24} +} + @misc{ZIP-302, presort={ZIP-0302}, author={Jay Graber and Jack Grigg}, diff --git a/zip-0207.html b/zip-0207.html index 877790522..84d08007c 100644 --- a/zip-0207.html +++ b/zip-0207.html @@ -1,367 +1,210 @@ - ZIP 207: Split Founders' Reward + ZIP 207: Funding Streams +
ZIP: 207
-Title: Split Founders' Reward
+Title: Funding Streams
 Owners: Jack Grigg <str4d@electriccoin.co>
+        Daira Hopwood <daira@electriccoin.co>
 Category: Consensus
-Status: Withdrawn
+Status: Draft
 Created: 2019-01-04
 License: MIT

Terminology

The key words "MUST", "SHOULD", "SHOULD NOT", and "MAY" in this document are to be interpreted as described in RFC 2119. 1

+

The terms "block subsidy" and "halving" in this document are to be interpreted as described in sections 3.9 and 7.7 of the Zcash Protocol Specification. 3 5

+

The terms "consensus branch" and "network upgrade" in this document are to be interpreted as described in ZIP 200. 8

+

The terms below are to be interpreted as follows:

+
+
${NU4}
+
Code-name for the fifth Zcash network upgrade, also known as Network Upgrade 4.
+
Testnet
+
The Zcash test network, as defined in the Zcash Protocol Specification. 2
+
Mainnet
+
The Zcash production network, as defined in the Zcash Protocol Specification. 2
+

Abstract

-

This Withdrawn proposal would have altered consensus rules to split the original Founders' Reward across several recipient addresses per block instead of one, corresponding to the several funding streams contained within it.

+

This proposal specifies a mechanism to support funding streams, distributed from a portion of the block subsidy for a specified range of block heights.

+

This is intended as a means of implementing the Zcash Development Fund, using the funding stream definitions specified in ZIP 214 11. It should be read in conjunction with ZIP 1014 13, which describes the high-level requirements for that fund.

Motivation

-

Since the launch of the Zcash network, the consensus rules have required that until the first block reward halving (at block 850,000), each block must send 20% of the block subsidy to a hard-coded transparent address. 2 This funding stream is referred to as the Founders' Reward.

-

This stream of 2.5-ZEC outputs (the value after the mining slow-start was completed) can be split into several logical funding streams (for background, see 3). Modifying the consensus rules to allocate the 2.5 ZEC across separate recipient addresses decouples these funding streams organizationally, legally, and operationally. It further reinforces transparency as to the structure of the original Founders' Reward.

+

Motivation for the Zcash Development Fund is considered in ZIP 1014 13.

+

This ZIP 207 was originally proposed for the Blossom network upgrade, as a means of splitting the original Founders' Reward into several streams. It was then withdrawn when such splitting was judged to be unnecessary at the consensus level. Since the capabilities of the funding stream mechanism match the requirements for the Zcash Development Fund, the ZIP is being reintroduced for that purpose in order to reuse specification, analysis, and implementation effort.

+
+

Requirements

+

The primary requirement of this ZIP is to provide a mechanism for specifying the funding streams that are used in ZIP 214 11 to implement the Zcash Development Fund. It should be sufficiently expressive to handle both the main three "slices" (ECC, ZF, and MG) defined in ZIP 1014 13, and also (with additional funding stream definitions) the "direct grant option" described in that ZIP.

+

As for the original Founders' Reward, addresses for a given funding stream are changed on a roughly-monthly basis, so that keys that are not yet needed may be kept off-line as a security measure.

Specification

Definitions

-

We use the following constants and functions defined in 4:

+

We use the following constants and functions defined in 4, 5, and 6:

    -
  • BlossomActivationHeight
  • -
  • PostBlossomHalvingInterval
  • -
  • Halving(height)
  • +
  • + \(\mathsf{BlossomActivationHeight}\) +
  • +
  • + \(\mathsf{PostBlossomHalvingInterval}\) +
  • +
  • + \(\mathsf{Halving}(\mathsf{height})\) +
  • +
  • + \(\mathsf{BlockSubsidy}(\mathsf{height})\) +
  • +
  • + \(\mathsf{RedeemScriptHash}(\mathsf{height})\) + .
-

We also define the following constants and functions:

+

We also define the following function:

    -
  • SlowStartShift as-defined in 2.
  • -
  • HeightForHalving(halving): Smallest height such that Halving(height) = halving
  • +
  • + \(\mathsf{HeightForHalving}(\mathsf{halving})\) + : Smallest + \(\mathsf{height}\) + such that + \(\mathsf{Halving}(\mathsf{height}) = \mathsf{halving}\) +

Funding streams

-

A funding stream is defined by a block reward fraction (represented as a numerator and a denominator), a start height (inclusive), and an end height (exclusive).

-

By defining the issuance as a proportion of the total block issuance, rather than absolute zatoshis, this ZIP dovetails with any changes to both block target times and issuance-per-block rates while maintaining an unchanged target-time-based issuance schedule. We anticipate such target-time / issuance rate changes in other ZIPs (for example, 4).

+

A funding stream is defined by a block subsidy fraction (represented as a numerator and a denominator), a start height (inclusive), and an end height (exclusive).

+

By defining the issuance as a proportion of the total block subsidy, rather than absolute zatoshis, this ZIP dovetails with any changes to both block target spacing and issuance-per-block rates. Such a change occurred at the Blossom network upgrade, for example. 9

The value of a funding stream at a given block height is defined as:

-
FundingStream[FUND].Value(height) =
-    floor((
-        BlockReward(height) * FundingStream[FUND].ValueNumerator
-    ) / FundingStream[FUND].ValueDenominator)
+
\(\mathsf{FundingStream[FUND].Value}(\mathsf{height}) = + \mathsf{floor}\left( + \frac{\mathsf{BlockSubsidy}(\mathsf{height}) \,\cdot\, \mathsf{FundingStream[FUND].ValueNumerator}}{\mathsf{FundingStream[FUND].ValueDenominator}} + \right)\)

An active funding stream at a given block height is defined as a funding stream for which the block height is less than its end height, but not less than its start height.

-

Each funding stream has an associated set of recipient addresses. Each address is used for at most 1/48th of a halving interval, creating a roughly-monthly sequence of funding periods. The address to be used for a given block height is defined as follows:

-
AddressChangeInterval = PostBlossomHalvingInterval / 48
-AddressPeriod(height) =
-    floor((
-        height + PostBlossomHalvingInterval - HeightForHalving(1)
-    ) / AddressChangeInterval)
-FundingStream[FUND].AddressIndex(height) =
-    AddressPeriod(height) - AddressPeriod(FundingStream[FUND].StartHeight)
-Address(height) = FundingStream[FUND].Addresses[FundingStream[FUND].AddressIndex(height)]
+

Each funding stream has an associated sequence of recipient addresses, each of which MUST be either a transparent P2SH address or a Sapling address.

+

Each address is used for at most 1/48th of a halving interval, creating a roughly-monthly sequence of funding periods. The address to be used for a given block height is defined as follows:

+
\(\begin{eqnarray*} + \mathsf{AddressChangeInterval} &=& \mathsf{PostBlossomHalvingInterval} / 48 \\ + \mathsf{AddressPeriod}(\mathsf{height}) &=& + \mathsf{floor}\left( + {\small\frac{\mathsf{height} + \mathsf{PostBlossomHalvingInterval} - \mathsf{HeightForHalving}(1)}{\mathsf{AddressChangeInterval}}} + \right) \\ + \mathsf{FundingStream[FUND].AddressIndex}(\mathsf{height}) &=& + \mathsf{AddressPeriod}(\mathsf{height}) - \\&&\hspace{2em} \mathsf{AddressPeriod}(\mathsf{FundingStream[FUND].StartHeight}) \\ + \mathsf{Address}(\mathsf{height}) &=& \mathsf{FundingStream[FUND].Addresses[} \\&&\hspace{2em} \mathsf{FundingStream[FUND].AddressIndex}(\mathsf{height})\mathsf{]} +\end{eqnarray*}\)

This has the property that all active funding streams change the address they are using on the same block height schedule, aligned to the height of the first halving so that 48 funding periods fit cleanly within a halving interval. This can be leveraged to simplify implementations, by batching the necessary outputs for each funding period.

Below is a visual representation of how stream addresses align with funding periods:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Example heightStream AStream BStream C
AddressChangeInterval - 2A0
AddressChangeInterval - 1A0
AddressChangeIntervalA1B0C0
AddressChangeInterval + 1A1B0C0
...
2*AddressChangeInterval - 2A1B0C0
2*AddressChangeInterval - 1A1B0C0
2*AddressChangeIntervalA2C1
2*AddressChangeInterval + 1A2C1
...
PostBlossomHalvingInterval - 2A2C1
PostBlossomHalvingInterval - 1A2C1
PostBlossomHalvingIntervalC2
PostBlossomHalvingInterval + 1C2
-

Note that this is not intended to align with the end of a pre-Blossom Founders' Reward address period (as defined by FounderAddressChangeInterval in 5). There will be a shortened Founders' Reward address period prior to Blossom activation.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Example heightStream AStream BStream C
AddressChangeInterval - 2A0
AddressChangeInterval - 1A0
AddressChangeIntervalA1B0C0
AddressChangeInterval + 1A1B0C0
...
2*AddressChangeInterval - 2A1B0C0
2*AddressChangeInterval - 1A1B0C0
2*AddressChangeIntervalA2C1
2*AddressChangeInterval + 1A2C1
...
PostBlossomHalvingInterval - 2A2C1
PostBlossomHalvingInterval - 1A2C1
PostBlossomHalvingIntervalC2
PostBlossomHalvingInterval + 1C2
+
+

On Mainnet, ${NU4} is planned to activate exactly at the point when the Founders' Reward expires, at block height 1046400. On Testnet, there will be a shortened Founders' Reward address period prior to ${NU4} activation.

Consensus rules

-

Prior to activation of the Blossom network upgrade, the existing consensus rule for payment of the original Founders' Reward is enforced. 5

-

Once the Blossom network upgrade activates:

-
    -
  • The existing consensus rule 5 is no longer active.
  • -
  • The coinbase transaction in each block MUST contain at least one output per active funding stream that pays the stream's value to the stream's recipient address for the block's height.
  • -
-
-

Stream definitions

-

The consensus-defined funding streams described above each start at the Blossom activation height, and end at the first block reward halving. They are defined as follows:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StreamValue numeratorValue denominatorStart heightEnd height
FS 1340BlossomActivationHeightHeightForHalving(1)
FS 2125BlossomActivationHeightHeightForHalving(1)
FS 3140BlossomActivationHeightHeightForHalving(1)
FS 4150BlossomActivationHeightHeightForHalving(1)
FS 5180BlossomActivationHeightHeightForHalving(1)
FS 6180BlossomActivationHeightHeightForHalving(1)
FS 71100BlossomActivationHeightHeightForHalving(1)
FS 81200BlossomActivationHeightHeightForHalving(1)
-
    -
  • To-do: specify the correct values.
  • -
-

The sum of the block reward fractions for the above funding streams is 1/5, equal to the original Founders' Reward (as-defined by FoundersFraction in 6).

-

The sets of recipient addresses are defined as follows:

-
std::vector<std::string> FS_1_ADDRESSES = [
-    "tFS1INVALIDADDRESS00",
-    "tFS1INVALIDADDRESS01",
-    "tFS1INVALIDADDRESS02",
-    "tFS1INVALIDADDRESS03",
-    "tFS1INVALIDADDRESS04",
-    "tFS1INVALIDADDRESS05",
-    "tFS1INVALIDADDRESS06",
-    "tFS1INVALIDADDRESS07",
-    "tFS1INVALIDADDRESS08",
-    "tFS1INVALIDADDRESS09",
-    "tFS1INVALIDADDRESS10",
-    "tFS1INVALIDADDRESS11",
-];
-
-std::vector<std::string> FS_2_ADDRESSES = [
-    "tFS2INVALIDADDRESS00",
-    "tFS2INVALIDADDRESS01",
-    "tFS2INVALIDADDRESS02",
-    "tFS2INVALIDADDRESS03",
-    "tFS2INVALIDADDRESS04",
-    "tFS2INVALIDADDRESS05",
-    "tFS2INVALIDADDRESS06",
-    "tFS2INVALIDADDRESS07",
-    "tFS2INVALIDADDRESS08",
-    "tFS2INVALIDADDRESS09",
-    "tFS2INVALIDADDRESS10",
-    "tFS2INVALIDADDRESS11",
-];
-
-std::vector<std::string> FS_3_ADDRESSES = [
-    "tFS3INVALIDADDRESS00",
-    "tFS3INVALIDADDRESS01",
-    "tFS3INVALIDADDRESS02",
-    "tFS3INVALIDADDRESS03",
-    "tFS3INVALIDADDRESS04",
-    "tFS3INVALIDADDRESS05",
-    "tFS3INVALIDADDRESS06",
-    "tFS3INVALIDADDRESS07",
-    "tFS3INVALIDADDRESS08",
-    "tFS3INVALIDADDRESS09",
-    "tFS3INVALIDADDRESS10",
-    "tFS3INVALIDADDRESS11",
-];
-
-std::vector<std::string> FS_4_ADDRESSES = [
-    "tFS4INVALIDADDRESS00",
-    "tFS4INVALIDADDRESS01",
-    "tFS4INVALIDADDRESS02",
-    "tFS4INVALIDADDRESS03",
-    "tFS4INVALIDADDRESS04",
-    "tFS4INVALIDADDRESS05",
-    "tFS4INVALIDADDRESS06",
-    "tFS4INVALIDADDRESS07",
-    "tFS4INVALIDADDRESS08",
-    "tFS4INVALIDADDRESS09",
-    "tFS4INVALIDADDRESS10",
-    "tFS4INVALIDADDRESS11",
-];
-
-std::vector<std::string> FS_5_ADDRESSES = [
-    "tFS5INVALIDADDRESS00",
-    "tFS5INVALIDADDRESS01",
-    "tFS5INVALIDADDRESS02",
-    "tFS5INVALIDADDRESS03",
-    "tFS5INVALIDADDRESS04",
-    "tFS5INVALIDADDRESS05",
-    "tFS5INVALIDADDRESS06",
-    "tFS5INVALIDADDRESS07",
-    "tFS5INVALIDADDRESS08",
-    "tFS5INVALIDADDRESS09",
-    "tFS5INVALIDADDRESS10",
-    "tFS5INVALIDADDRESS11",
-];
-
-std::vector<std::string> FS_6_ADDRESSES = [
-    "tFS6INVALIDADDRESS00",
-    "tFS6INVALIDADDRESS01",
-    "tFS6INVALIDADDRESS02",
-    "tFS6INVALIDADDRESS03",
-    "tFS6INVALIDADDRESS04",
-    "tFS6INVALIDADDRESS05",
-    "tFS6INVALIDADDRESS06",
-    "tFS6INVALIDADDRESS07",
-    "tFS6INVALIDADDRESS08",
-    "tFS6INVALIDADDRESS09",
-    "tFS6INVALIDADDRESS10",
-    "tFS6INVALIDADDRESS11",
-];
-
-std::vector<std::string> FS_7_ADDRESSES = [
-    "tFS7INVALIDADDRESS00",
-    "tFS7INVALIDADDRESS01",
-    "tFS7INVALIDADDRESS02",
-    "tFS7INVALIDADDRESS03",
-    "tFS7INVALIDADDRESS04",
-    "tFS7INVALIDADDRESS05",
-    "tFS7INVALIDADDRESS06",
-    "tFS7INVALIDADDRESS07",
-    "tFS7INVALIDADDRESS08",
-    "tFS7INVALIDADDRESS09",
-    "tFS7INVALIDADDRESS10",
-    "tFS7INVALIDADDRESS11",
-];
-
-std::vector<std::string> FS_8_ADDRESSES = [
-    "tFS8INVALIDADDRESS00",
-    "tFS8INVALIDADDRESS01",
-    "tFS8INVALIDADDRESS02",
-    "tFS8INVALIDADDRESS03",
-    "tFS8INVALIDADDRESS04",
-    "tFS8INVALIDADDRESS05",
-    "tFS8INVALIDADDRESS06",
-    "tFS8INVALIDADDRESS07",
-    "tFS8INVALIDADDRESS08",
-    "tFS8INVALIDADDRESS09",
-    "tFS8INVALIDADDRESS10",
-    "tFS8INVALIDADDRESS11",
-];
+

Prior to activation of the ${NU4} network upgrade, the existing consensus rule for payment of the original Founders' Reward is enforced. 6

+

Once the ${NU4} network upgrade activates:

    -
  • To-do: specify the correct sets of FR addresses.
  • -
  • To-do: require that the FR address sets are PGP-signed with appropriate keys.
  • +
  • The existing consensus rule for payment of the Founders' Reward 6 is no longer active. (This would be the case under the preexisting consensus rules for Mainnet, but not for Testnet.)
  • +
  • The coinbase transaction in each block MUST contain at least one output per active funding stream that pays the stream's value in the prescribed way to the stream's recipient address for the block's height.
  • +
  • The "prescribed way" to pay a transparent P2SH address is to use a standard P2SH script of the form OP_HASH160 RedeemScriptHash(height) OP_EQUAL as the scriptPubKey.
  • +
  • The "prescribed way" to pay a Sapling address is as defined in 10. That is, all Sapling outputs in coinbase transactions (including, but not limited to, outputs for funding streams) MUST have valid note commitments when recovered using a 32-byte array of zeroes as the outgoing viewing key.
+

For the funding stream definitions to be activated at ${NU4}, see ZIP 214. 11 Funding stream definitions can be added, changed, or deleted in ZIPs associated with subsequent network upgrades, subject to the ZIP process. 7

Example implementation

struct FundingPeriod {
@@ -373,17 +216,14 @@
 };
 
 enum FundingStream {
-    FS_1,
-    FS_2,
-    FS_3,
-    FS_4,
-    FS_5,
-    FS_6,
-    FS_7,
-    FS_8,
+    FS_ECC,
+    FS_ZF,
+    FS_MG,
     MAX_FUNDING_STREAMS,
 };
 
+const auto FIRST_FUNDING_STREAM = FS_ECC;
+
 struct Params {
     ...
     int nFundingPeriodLength;
@@ -396,15 +236,17 @@
     Consensus::FundingStream idx,
     std::vector<std::string> addresses,
     uint64_t valueNumerator,
-    uint64_t valueDenominator)
+    uint64_t valueDenominator,
+    int startHeight,
+    int endHeight)
 {
     assert(valueNumerator < valueDenominator);
+    assert(valueNumerator < INT64_MAX / MAX_MONEY);
     params.vFundingPeriods[idx].addresses = addresses;
     params.vFundingPeriods[idx].valueNumerator = valueNumerator;
     params.vFundingPeriods[idx].valueDenominator = valueDenominator;
-    params.vFundingPeriods[idx].startHeight =
-        params.vUpgrades[Consensus::UPGRADE_BLOSSOM].nActivationHeight;
-    params.vFundingPeriods[idx].endHeight = HeightForHalving(params, 1);
+    params.vFundingPeriods[idx].startHeight = startHeight;
+    params.vFundingPeriods[idx].endHeight = endHeight;
     assert(params.vFundingPeriods[idx].startHeight < params.vFundingPeriods[idx].endHeight);
 };
 
@@ -413,14 +255,11 @@
 
     consensus.nFundingPeriodLength = consensus.nSubsidyPostBlossomHalvingInterval / 48;
 
-    AddZIP207FundingStream(consensus, Consensus::FS_1, FS_1_ADDRESSES, 3, 40);
-    AddZIP207FundingStream(consensus, Consensus::FS_2, FS_2_ADDRESSES, 1, 25);
-    AddZIP207FundingStream(consensus, Consensus::FS_3, FS_3_ADDRESSES, 1, 40);
-    AddZIP207FundingStream(consensus, Consensus::FS_4, FS_4_ADDRESSES, 1, 50);
-    AddZIP207FundingStream(consensus, Consensus::FS_5, FS_5_ADDRESSES, 1, 80);
-    AddZIP207FundingStream(consensus, Consensus::FS_6, FS_6_ADDRESSES, 1, 80);
-    AddZIP207FundingStream(consensus, Consensus::FS_7, FS_7_ADDRESSES, 1, 100);
-    AddZIP207FundingStream(consensus, Consensus::FS_8, FS_8_ADDRESSES, 1, 200);
+    int devFundStartHeight = HeightForHalving(params, 1);
+    int devFundEndHeight   = HeightForHalving(params, 2);
+    AddZIP207FundingStream(consensus, Consensus::FS_ECC, FS_ECC_ADDRESSES, 7, 100, devFundStartHeight, devFundEndHeight);
+    AddZIP207FundingStream(consensus, Consensus::FS_ZF,  FS_ZF_ADDRESSES,  5, 100, devFundStartHeight, devFundEndHeight);
+    AddZIP207FundingStream(consensus, Consensus::FS_MG,  FS_MG_ADDRESSES,  8, 100, devFundStartHeight, devFundEndHeight);
 
     ...
 }
@@ -430,17 +269,23 @@
     const Consensus::Params& params,
     Consensus::FundingStream idx)
 {
-    // Integer division is floor division in C++
-    auto curPeriod = (
-        nHeight + params.nSubsidyPostBlossomHalvingInterval - HeightForHalving(params, 1)
-    ) / params.nFundingPeriodLength;
-    auto startPeriod = (
-        params.vFundingPeriods[idx].startHeight
-            + params.nSubsidyPostBlossomHalvingInterval
-            - HeightForHalving(params, 1)
-    ) / params.nFundingPeriodLength;
+    assert(nHeight <= INT_MAX - params.nSubsidyPostBlossomHalvingInterval);
+    assert(params.vFundingPeriods[idx].startHeight <= INT_MAX - params.nSubsidyPostBlossomHalvingInterval);
+
+    int curPeriodNumerator = nHeight + params.nSubsidyPostBlossomHalvingInterval - HeightForHalving(params, 1);
+    int startPeriodNumerator = params.vFundingPeriods[idx].startHeight + params.nSubsidyPostBlossomHalvingInterval
+        - HeightForHalving(params, 1);
+
+    // Integer division is floor division for nonnegative integers in C++
+    assert(curPeriodNumerator >= 0);
+    assert(startPeriodNumerator >= 0);
+    auto curPeriod = curPeriodNumerator / params.nFundingPeriodLength;
+    auto startPeriod = startPeriodNumerator / params.nFundingPeriodLength;
     auto addressIndex = curPeriod - startPeriod;
-    return params.vFundingPeriods[idx].addresses[addressIndex];
+
+    auto addresses = params.vFundingPeriods[idx].addresses;
+    assert(addressIndex >= 0 && addressIndex < addresses.size());
+    return addresses[addressIndex];
 };
 
 CAmount FundingStreamValue(
@@ -448,7 +293,7 @@
     const Consensus::Params& params,
     Consensus::FundingStream idx)
 {
-    // Integer division is floor division in C++
+    // Integer division is floor division for nonnegative integers in C++
     return CAmount((
         GetBlockSubsidy(nHeight, params) * params.vFundingPeriods[idx].valueNumerator
     ) / params.vFundingPeriods[idx].valueDenominator);
@@ -459,7 +304,7 @@
     const Consensus::Params& params)
 {
     std::set<std::pair<CScript, CAmount>> requiredStreams;
-    for (int idx = Consensus::FS_ZECC_EF; idx < Consensus::MAX_FUNDING_STREAMS; idx++) {
+    for (int idx = Consensus::FIRST_FUNDING_STREAM; idx < Consensus::MAX_FUNDING_STREAMS; idx++) {
         // Funding period is [startHeight, endHeight)
         if (nHeight >= params.vFundingPeriods[idx].startHeight &&
             nHeight < params.vFundingPeriods[idx].endHeight)
@@ -476,7 +321,7 @@
 {
     ...
 
-    if (NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_BLOSSOM)) {
+    if (NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_NU4)) {
         // Coinbase transaction must include outputs corresponding to the consensus
         // funding streams active at the current block height.
         auto requiredStreams = GetActiveFundingStreams(nHeight, consensusParams);
@@ -491,14 +336,15 @@
         }
 
         if (!requiredStreams.empty()) {
-            return state.DoS(100, error("%s: funding stream missing", __func__), REJECT_INVALID, "cb-funding-stream-missing");
+            return state.DoS(100, error("%s: funding stream missing", __func__),
+                             REJECT_INVALID, "cb-funding-stream-missing");
         }
     } else {
         // Coinbase transaction must include an output sending 20% of
-        // the block reward to a founders reward script, until the last founders
-        // reward block is reached, with exception of the genesis block.
-        // The last founders reward block is defined as the block just before the
-        // first subsidy halving block, which occurs at halving_interval + slow_start_shift
+        // the block subsidy to a Founders' Reward script, until the last Founders'
+        // Reward block is reached, with exception of the genesis block.
+        // The last Founders' Reward block is defined as the block just before the
+        // first subsidy halving block.
         if ((nHeight > 0) && (nHeight <= consensusParams.GetLastFoundersRewardBlockHeight())) {
             bool found = false;
 
@@ -512,7 +358,8 @@
             }
 
             if (!found) {
-                return state.DoS(100, error("%s: founders reward missing", __func__), REJECT_INVALID, "cb-no-founders-reward");
+                return state.DoS(100, error("%s: founders reward missing", __func__),
+                                 REJECT_INVALID, "cb-no-founders-reward");
             }
         }
     }
@@ -522,15 +369,10 @@
             

Deployment

-

This proposal was originally intended to be deployed with the Blossom network upgrade. 7

+

This proposal is intended to be deployed with ${NU4}. 12

Backward compatibility

-

This proposal intentionally creates what is known as a "bilateral consensus rule change". Use of this mechanism requires that all network participants upgrade their software to a compatible version within the upgrade window. Older software will treat post-upgrade blocks as invalid, and will follow any pre-upgrade branch that persists.

-

This proposal is designed with the explicit requirement of not altering the overall issuance schedule (based on time), nor does it alter the proportion or timeline of the overall Founders' Reward. As a result, no users outside of the Zerocoin Electric Coin Company and Zcash Foundation should experience any UX or economic change outside of the upgrade due to this proposal itself.

-

Interactions with other ZIPs

-

4 (Shorter Block Target Spacing) specifies a change to the block target spacing. It is planned to take effect in the Blossom network upgrade 7. This ZIP was originally written to take effect at the same time, but was Withdrawn from consideration for Blossom.

-

ZIP 208 modifies the payment of the original Founders' Reward to take account of the block target spacing change. It does this by specifying a FounderAddressAdjustedHeight function and related changes, which would need to be revisited to take into account funding streams.

-
+

This proposal intentionally creates what is known as a "bilateral consensus rule change". Use of this mechanism requires that all network participants upgrade their software to a compatible version within the upgrade window. Older software will treat post-upgrade blocks as invalid, and will follow any pre-upgrade consensus branch that persists.

Reference Implementation

TBC

@@ -544,51 +386,99 @@ - +
- +
2Section 7.7: Calculation of Block Subsidy and Founders' Reward. Zcash Protocol Specification, Version 2018.0-beta-33 or later [Overwinter+Sapling]Zcash Protocol Specification, Version 2020.1.1 or later
- +
- +
3Continued Funding and TransparencySection 3.9: Block Subsidy and Founders' Reward. Zcash Protocol Specification, Version 2020.1.1 or later
- +
- +
4ZIP 208: Shorter Block Target SpacingSection 5.3: Constants. Zcash Protocol Specification, Version 2020.1.1 or later
- +
- +
5Section 7.8: Payment of Founders' Reward. Zcash Protocol Specification, Version 2018.0-beta-33 or later [Overwinter+Sapling]Section 7.7: Calculation of Block Subsidy and Founders' Reward. Zcash Protocol Specification, Version 2020.1.1 or later
- +
- +
6Section 5.3: Constants. Zcash Protocol Specification, Version 2018.0-beta-33 or later [Overwinter+Sapling]Section 7.8: Payment of Founders' Reward. Zcash Protocol Specification, Version 2020.1.1 or later
- +
- + + + +
7ZIP 206: Blossom Network UpgradeZIP 0: ZIP Process
+ + + + + + + +
8ZIP 200: Network Upgrade Mechanism
+ + + + + + + +
9ZIP 208: Shorter Block Target Spacing
+ + + + + + + +
10ZIP 213: Shielded Coinbase
+ + + + + + + +
11ZIP 214: Consensus rules for a Zcash Development Fund
+ + + + + + + +
12ZIP 251: Deployment of the ${NU4} Network Upgrade
+ + + + +
13ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants
diff --git a/zip-0207.rst b/zip-0207.rst index 10368b67b..fa2bed198 100644 --- a/zip-0207.rst +++ b/zip-0207.rst @@ -1,10 +1,11 @@ :: ZIP: 207 - Title: Split Founders' Reward + Title: Funding Streams Owners: Jack Grigg + Daira Hopwood Category: Consensus - Status: Withdrawn + Status: Draft Created: 2019-01-04 License: MIT @@ -12,29 +13,65 @@ Terminology =========== -The key words "MUST", "SHOULD", "SHOULD NOT", and "MAY" in this document are to be interpreted as described in -RFC 2119. [#RFC2119]_ +The key words "MUST", "SHOULD", "SHOULD NOT", and "MAY" in this document are +to be interpreted as described in RFC 2119. [#RFC2119]_ + +The terms "block subsidy" and "halving" in this document are to be interpreted +as described in sections 3.9 and 7.7 of the Zcash Protocol Specification. +[#protocol-subsidyconcepts]_ [#protocol-subsidies]_ + +The terms "consensus branch" and "network upgrade" in this document are to be +interpreted as described in ZIP 200. [#zip-0200]_ + +The terms below are to be interpreted as follows: + +${NU4} + Code-name for the fifth Zcash network upgrade, also known as Network Upgrade 4. +Testnet + The Zcash test network, as defined in the Zcash Protocol Specification. [#protocol]_ +Mainnet + The Zcash production network, as defined in the Zcash Protocol Specification. [#protocol]_ Abstract ======== -This Withdrawn proposal would have altered consensus rules to split the original Founders' Reward across -several recipient addresses per block instead of one, corresponding to the several funding streams contained -within it. +This proposal specifies a mechanism to support funding streams, distributed +from a portion of the block subsidy for a specified range of block heights. + +This is intended as a means of implementing the Zcash Development Fund, +using the funding stream definitions specified in ZIP 214 [#zip-0214]_. It +should be read in conjunction with ZIP 1014 [#zip-1014]_, which describes +the high-level requirements for that fund. Motivation ========== -Since the launch of the Zcash network, the consensus rules have required that until the first block reward -halving (at block 850,000), each block must send 20% of the block subsidy to a hard-coded transparent address. -[#block-subsidy]_ This funding stream is referred to as the Founders' Reward. +Motivation for the Zcash Development Fund is considered in ZIP 1014 [#zip-1014]_. + +This ZIP 207 was originally proposed for the Blossom network upgrade, as a +means of splitting the original Founders' Reward into several streams. It was +then withdrawn when such splitting was judged to be unnecessary at the consensus +level. Since the capabilities of the funding stream mechanism match the +requirements for the Zcash Development Fund, the ZIP is being reintroduced +for that purpose in order to reuse specification, analysis, and implementation +effort. -This stream of 2.5-ZEC outputs (the value after the mining slow-start was completed) can be split into several -logical funding streams (for background, see [#continued-funding]_). Modifying the consensus rules to allocate -the 2.5 ZEC across separate recipient addresses decouples these funding streams organizationally, legally, and -operationally. It further reinforces transparency as to the structure of the original Founders' Reward. + +Requirements +============ + +The primary requirement of this ZIP is to provide a mechanism for specifying +the funding streams that are used in ZIP 214 [#zip-0214]_ to implement the Zcash +Development Fund. It should be sufficiently expressive to handle both the main +three "slices" (ECC, ZF, and MG) defined in ZIP 1014 [#zip-1014]_, and also +(with additional funding stream definitions) the "direct grant option" described +in that ZIP. + +As for the original Founders' Reward, addresses for a given funding stream are +changed on a roughly-monthly basis, so that keys that are not yet needed may be +kept off-line as a security measure. Specification @@ -43,243 +80,129 @@ Specification Definitions ----------- -We use the following constants and functions defined in [#zip-0208]_: +We use the following constants and functions defined in [#protocol-constants]_, +[#protocol-subsidies]_, and [#protocol-foundersreward]_: -- ``BlossomActivationHeight`` -- ``PostBlossomHalvingInterval`` -- ``Halving(height)`` +- :math:`\mathsf{BlossomActivationHeight}` +- :math:`\mathsf{PostBlossomHalvingInterval}` +- :math:`\mathsf{Halving}(\mathsf{height})` +- :math:`\mathsf{BlockSubsidy}(\mathsf{height})` +- :math:`\mathsf{RedeemScriptHash}(\mathsf{height})`. -We also define the following constants and functions: +We also define the following function: + +- :math:`\mathsf{HeightForHalving}(\mathsf{halving})`: Smallest :math:`\mathsf{height}` such that + :math:`\mathsf{Halving}(\mathsf{height}) = \mathsf{halving}` -- ``SlowStartShift`` as-defined in [#block-subsidy]_. -- ``HeightForHalving(halving)``: Smallest ``height`` such that ``Halving(height) = halving`` Funding streams --------------- -A funding stream is defined by a block reward fraction (represented as a numerator and a denominator), a start -height (inclusive), and an end height (exclusive). - -By defining the issuance as a proportion of the total block issuance, rather than absolute zatoshis, this ZIP -dovetails with any changes to both block target times and issuance-per-block rates while maintaining an -unchanged target-time-based issuance schedule. We anticipate such target-time / issuance rate changes in other -ZIPs (for example, [#zip-0208]_). - -The value of a funding stream at a given block height is defined as:: - - FundingStream[FUND].Value(height) = - floor(( - BlockReward(height) * FundingStream[FUND].ValueNumerator - ) / FundingStream[FUND].ValueDenominator) - -An active funding stream at a given block height is defined as a funding stream for which the block height is -less than its end height, but not less than its start height. - -Each funding stream has an associated set of recipient addresses. Each address is used for at most 1/48th of a -halving interval, creating a roughly-monthly sequence of funding periods. The address to be used for a given -block height is defined as follows:: - - AddressChangeInterval = PostBlossomHalvingInterval / 48 - AddressPeriod(height) = - floor(( - height + PostBlossomHalvingInterval - HeightForHalving(1) - ) / AddressChangeInterval) - FundingStream[FUND].AddressIndex(height) = - AddressPeriod(height) - AddressPeriod(FundingStream[FUND].StartHeight) - Address(height) = FundingStream[FUND].Addresses[FundingStream[FUND].AddressIndex(height)] - -This has the property that all active funding streams change the address they are using on the same block -height schedule, aligned to the height of the first halving so that 48 funding periods fit cleanly within a -halving interval. This can be leveraged to simplify implementations, by batching the necessary outputs for -each funding period. - -Below is a visual representation of how stream addresses align with funding periods: - -================================== ======== ======== ======== - Example height Stream A Stream B Stream C -================================== ======== ======== ======== - ``AddressChangeInterval - 2`` A0 - ``AddressChangeInterval - 1`` A0 - ``AddressChangeInterval`` A1 B0 C0 - ``AddressChangeInterval + 1`` A1 B0 C0 - \... - ``2*AddressChangeInterval - 2`` A1 B0 C0 - ``2*AddressChangeInterval - 1`` A1 B0 C0 - ``2*AddressChangeInterval`` A2 C1 - ``2*AddressChangeInterval + 1`` A2 C1 - \... -``PostBlossomHalvingInterval - 2`` A2 C1 -``PostBlossomHalvingInterval - 1`` A2 C1 -``PostBlossomHalvingInterval`` C2 -``PostBlossomHalvingInterval + 1`` C2 -================================== ======== ======== ======== - -Note that this is not intended to align with the end of a pre-Blossom Founders' Reward address period (as -defined by ``FounderAddressChangeInterval`` in [#original-fr-consensus-rule]_). There will be a shortened -Founders' Reward address period prior to Blossom activation. +A funding stream is defined by a block subsidy fraction (represented as a +numerator and a denominator), a start height (inclusive), and an end height +(exclusive). + +By defining the issuance as a proportion of the total block subsidy, rather +than absolute zatoshis, this ZIP dovetails with any changes to both block +target spacing and issuance-per-block rates. Such a change occurred at the +Blossom network upgrade, for example. [#zip-0208]_ + +The value of a funding stream at a given block height is defined as: + +.. math:: + + \mathsf{FundingStream[FUND].Value}(\mathsf{height}) = + \mathsf{floor}\left( + \frac{\mathsf{BlockSubsidy}(\mathsf{height}) \,\cdot\, \mathsf{FundingStream[FUND].ValueNumerator}}{\mathsf{FundingStream[FUND].ValueDenominator}} + \right) + +An active funding stream at a given block height is defined as a funding +stream for which the block height is less than its end height, but not less +than its start height. + +Each funding stream has an associated sequence of recipient addresses, +each of which MUST be either a transparent P2SH address or a Sapling address. + +Each address is used for at most 1/48th of a halving interval, creating a +roughly-monthly sequence of funding periods. The address to be used for a +given block height is defined as follows: + +.. math:: + + \begin{eqnarray*} + \mathsf{AddressChangeInterval} &=& \mathsf{PostBlossomHalvingInterval} / 48 \\ + \mathsf{AddressPeriod}(\mathsf{height}) &=& + \mathsf{floor}\left( + {\small\frac{\mathsf{height} + \mathsf{PostBlossomHalvingInterval} - \mathsf{HeightForHalving}(1)}{\mathsf{AddressChangeInterval}}} + \right) \\ + \mathsf{FundingStream[FUND].AddressIndex}(\mathsf{height}) &=& + \mathsf{AddressPeriod}(\mathsf{height}) - \\&&\hspace{2em} \mathsf{AddressPeriod}(\mathsf{FundingStream[FUND].StartHeight}) \\ + \mathsf{Address}(\mathsf{height}) &=& \mathsf{FundingStream[FUND].Addresses[} \\&&\hspace{2em} \mathsf{FundingStream[FUND].AddressIndex}(\mathsf{height})\mathsf{]} + \end{eqnarray*} + +This has the property that all active funding streams change the address they +are using on the same block height schedule, aligned to the height of the +first halving so that 48 funding periods fit cleanly within a halving +interval. This can be leveraged to simplify implementations, by batching the +necessary outputs for each funding period. + +Below is a visual representation of how stream addresses align with funding +periods: + + ================================== ======== ======== ======== + Example height Stream A Stream B Stream C + ================================== ======== ======== ======== + ``AddressChangeInterval - 2`` A0 + ``AddressChangeInterval - 1`` A0 + ``AddressChangeInterval`` A1 B0 C0 + ``AddressChangeInterval + 1`` A1 B0 C0 + \... + ``2*AddressChangeInterval - 2`` A1 B0 C0 + ``2*AddressChangeInterval - 1`` A1 B0 C0 + ``2*AddressChangeInterval`` A2 C1 + ``2*AddressChangeInterval + 1`` A2 C1 + \... + ``PostBlossomHalvingInterval - 2`` A2 C1 + ``PostBlossomHalvingInterval - 1`` A2 C1 + ``PostBlossomHalvingInterval`` C2 + ``PostBlossomHalvingInterval + 1`` C2 + ================================== ======== ======== ======== + +On Mainnet, ${NU4} is planned to activate exactly at the point when the Founders' +Reward expires, at block height 1046400. On Testnet, there will be a shortened +Founders' Reward address period prior to ${NU4} activation. + Consensus rules --------------- -Prior to activation of the Blossom network upgrade, the existing consensus rule for payment of the original -Founders' Reward is enforced. [#original-fr-consensus-rule]_ - -Once the Blossom network upgrade activates: +Prior to activation of the ${NU4} network upgrade, the existing consensus rule +for payment of the original Founders' Reward is enforced. [#protocol-foundersreward]_ -- The existing consensus rule [#original-fr-consensus-rule]_ is no longer active. -- The coinbase transaction in each block MUST contain at least one output per active funding stream that pays - the stream's value to the stream's recipient address for the block's height. +Once the ${NU4} network upgrade activates: -Stream definitions ------------------- +- The existing consensus rule for payment of the Founders' Reward [#protocol-foundersreward]_ + is no longer active. + (This would be the case under the preexisting consensus rules for Mainnet, but + not for Testnet.) -The consensus-defined funding streams described above each start at the Blossom activation height, and end at -the first block reward halving. They are defined as follows: +- The coinbase transaction in each block MUST contain at least one output per + active funding stream that pays the stream's value in the prescribed way to + the stream's recipient address for the block's height. -====== =============== ================= =========================== ======================= -Stream Value numerator Value denominator Start height End height -====== =============== ================= =========================== ======================= - FS 1 3 40 ``BlossomActivationHeight`` ``HeightForHalving(1)`` - FS 2 1 25 ``BlossomActivationHeight`` ``HeightForHalving(1)`` - FS 3 1 40 ``BlossomActivationHeight`` ``HeightForHalving(1)`` - FS 4 1 50 ``BlossomActivationHeight`` ``HeightForHalving(1)`` - FS 5 1 80 ``BlossomActivationHeight`` ``HeightForHalving(1)`` - FS 6 1 80 ``BlossomActivationHeight`` ``HeightForHalving(1)`` - FS 7 1 100 ``BlossomActivationHeight`` ``HeightForHalving(1)`` - FS 8 1 200 ``BlossomActivationHeight`` ``HeightForHalving(1)`` -====== =============== ================= =========================== ======================= +- The "prescribed way" to pay a transparent P2SH address is to use a standard + P2SH script of the form ``OP_HASH160 RedeemScriptHash(height) OP_EQUAL`` as + the ``scriptPubKey``. -- To-do: specify the correct values. +- The "prescribed way" to pay a Sapling address is as defined in [#zip-0213]_. + That is, all Sapling outputs in coinbase transactions (including, but not + limited to, outputs for funding streams) MUST have valid note commitments + when recovered using a 32-byte array of zeroes as the outgoing viewing key. -The sum of the block reward fractions for the above funding streams is ``1/5``, equal to the original -Founders' Reward (as-defined by ``FoundersFraction`` in [#protocol-constants]_). +For the funding stream definitions to be activated at ${NU4}, see ZIP 214. [#zip-0214]_ +Funding stream definitions can be added, changed, or deleted in ZIPs associated +with subsequent network upgrades, subject to the ZIP process. [#zip-0000]_ -The sets of recipient addresses are defined as follows: - -.. code:: cpp - - std::vector FS_1_ADDRESSES = [ - "tFS1INVALIDADDRESS00", - "tFS1INVALIDADDRESS01", - "tFS1INVALIDADDRESS02", - "tFS1INVALIDADDRESS03", - "tFS1INVALIDADDRESS04", - "tFS1INVALIDADDRESS05", - "tFS1INVALIDADDRESS06", - "tFS1INVALIDADDRESS07", - "tFS1INVALIDADDRESS08", - "tFS1INVALIDADDRESS09", - "tFS1INVALIDADDRESS10", - "tFS1INVALIDADDRESS11", - ]; - - std::vector FS_2_ADDRESSES = [ - "tFS2INVALIDADDRESS00", - "tFS2INVALIDADDRESS01", - "tFS2INVALIDADDRESS02", - "tFS2INVALIDADDRESS03", - "tFS2INVALIDADDRESS04", - "tFS2INVALIDADDRESS05", - "tFS2INVALIDADDRESS06", - "tFS2INVALIDADDRESS07", - "tFS2INVALIDADDRESS08", - "tFS2INVALIDADDRESS09", - "tFS2INVALIDADDRESS10", - "tFS2INVALIDADDRESS11", - ]; - - std::vector FS_3_ADDRESSES = [ - "tFS3INVALIDADDRESS00", - "tFS3INVALIDADDRESS01", - "tFS3INVALIDADDRESS02", - "tFS3INVALIDADDRESS03", - "tFS3INVALIDADDRESS04", - "tFS3INVALIDADDRESS05", - "tFS3INVALIDADDRESS06", - "tFS3INVALIDADDRESS07", - "tFS3INVALIDADDRESS08", - "tFS3INVALIDADDRESS09", - "tFS3INVALIDADDRESS10", - "tFS3INVALIDADDRESS11", - ]; - - std::vector FS_4_ADDRESSES = [ - "tFS4INVALIDADDRESS00", - "tFS4INVALIDADDRESS01", - "tFS4INVALIDADDRESS02", - "tFS4INVALIDADDRESS03", - "tFS4INVALIDADDRESS04", - "tFS4INVALIDADDRESS05", - "tFS4INVALIDADDRESS06", - "tFS4INVALIDADDRESS07", - "tFS4INVALIDADDRESS08", - "tFS4INVALIDADDRESS09", - "tFS4INVALIDADDRESS10", - "tFS4INVALIDADDRESS11", - ]; - - std::vector FS_5_ADDRESSES = [ - "tFS5INVALIDADDRESS00", - "tFS5INVALIDADDRESS01", - "tFS5INVALIDADDRESS02", - "tFS5INVALIDADDRESS03", - "tFS5INVALIDADDRESS04", - "tFS5INVALIDADDRESS05", - "tFS5INVALIDADDRESS06", - "tFS5INVALIDADDRESS07", - "tFS5INVALIDADDRESS08", - "tFS5INVALIDADDRESS09", - "tFS5INVALIDADDRESS10", - "tFS5INVALIDADDRESS11", - ]; - - std::vector FS_6_ADDRESSES = [ - "tFS6INVALIDADDRESS00", - "tFS6INVALIDADDRESS01", - "tFS6INVALIDADDRESS02", - "tFS6INVALIDADDRESS03", - "tFS6INVALIDADDRESS04", - "tFS6INVALIDADDRESS05", - "tFS6INVALIDADDRESS06", - "tFS6INVALIDADDRESS07", - "tFS6INVALIDADDRESS08", - "tFS6INVALIDADDRESS09", - "tFS6INVALIDADDRESS10", - "tFS6INVALIDADDRESS11", - ]; - - std::vector FS_7_ADDRESSES = [ - "tFS7INVALIDADDRESS00", - "tFS7INVALIDADDRESS01", - "tFS7INVALIDADDRESS02", - "tFS7INVALIDADDRESS03", - "tFS7INVALIDADDRESS04", - "tFS7INVALIDADDRESS05", - "tFS7INVALIDADDRESS06", - "tFS7INVALIDADDRESS07", - "tFS7INVALIDADDRESS08", - "tFS7INVALIDADDRESS09", - "tFS7INVALIDADDRESS10", - "tFS7INVALIDADDRESS11", - ]; - - std::vector FS_8_ADDRESSES = [ - "tFS8INVALIDADDRESS00", - "tFS8INVALIDADDRESS01", - "tFS8INVALIDADDRESS02", - "tFS8INVALIDADDRESS03", - "tFS8INVALIDADDRESS04", - "tFS8INVALIDADDRESS05", - "tFS8INVALIDADDRESS06", - "tFS8INVALIDADDRESS07", - "tFS8INVALIDADDRESS08", - "tFS8INVALIDADDRESS09", - "tFS8INVALIDADDRESS10", - "tFS8INVALIDADDRESS11", - ]; - -- To-do: specify the correct sets of FR addresses. -- To-do: require that the FR address sets are PGP-signed with appropriate keys. Example implementation ---------------------- @@ -295,17 +218,14 @@ Example implementation }; enum FundingStream { - FS_1, - FS_2, - FS_3, - FS_4, - FS_5, - FS_6, - FS_7, - FS_8, + FS_ECC, + FS_ZF, + FS_MG, MAX_FUNDING_STREAMS, }; + const auto FIRST_FUNDING_STREAM = FS_ECC; + struct Params { ... int nFundingPeriodLength; @@ -318,15 +238,17 @@ Example implementation Consensus::FundingStream idx, std::vector addresses, uint64_t valueNumerator, - uint64_t valueDenominator) + uint64_t valueDenominator, + int startHeight, + int endHeight) { assert(valueNumerator < valueDenominator); + assert(valueNumerator < INT64_MAX / MAX_MONEY); params.vFundingPeriods[idx].addresses = addresses; params.vFundingPeriods[idx].valueNumerator = valueNumerator; params.vFundingPeriods[idx].valueDenominator = valueDenominator; - params.vFundingPeriods[idx].startHeight = - params.vUpgrades[Consensus::UPGRADE_BLOSSOM].nActivationHeight; - params.vFundingPeriods[idx].endHeight = HeightForHalving(params, 1); + params.vFundingPeriods[idx].startHeight = startHeight; + params.vFundingPeriods[idx].endHeight = endHeight; assert(params.vFundingPeriods[idx].startHeight < params.vFundingPeriods[idx].endHeight); }; @@ -335,14 +257,11 @@ Example implementation consensus.nFundingPeriodLength = consensus.nSubsidyPostBlossomHalvingInterval / 48; - AddZIP207FundingStream(consensus, Consensus::FS_1, FS_1_ADDRESSES, 3, 40); - AddZIP207FundingStream(consensus, Consensus::FS_2, FS_2_ADDRESSES, 1, 25); - AddZIP207FundingStream(consensus, Consensus::FS_3, FS_3_ADDRESSES, 1, 40); - AddZIP207FundingStream(consensus, Consensus::FS_4, FS_4_ADDRESSES, 1, 50); - AddZIP207FundingStream(consensus, Consensus::FS_5, FS_5_ADDRESSES, 1, 80); - AddZIP207FundingStream(consensus, Consensus::FS_6, FS_6_ADDRESSES, 1, 80); - AddZIP207FundingStream(consensus, Consensus::FS_7, FS_7_ADDRESSES, 1, 100); - AddZIP207FundingStream(consensus, Consensus::FS_8, FS_8_ADDRESSES, 1, 200); + int devFundStartHeight = HeightForHalving(params, 1); + int devFundEndHeight = HeightForHalving(params, 2); + AddZIP207FundingStream(consensus, Consensus::FS_ECC, FS_ECC_ADDRESSES, 7, 100, devFundStartHeight, devFundEndHeight); + AddZIP207FundingStream(consensus, Consensus::FS_ZF, FS_ZF_ADDRESSES, 5, 100, devFundStartHeight, devFundEndHeight); + AddZIP207FundingStream(consensus, Consensus::FS_MG, FS_MG_ADDRESSES, 8, 100, devFundStartHeight, devFundEndHeight); ... } @@ -352,17 +271,23 @@ Example implementation const Consensus::Params& params, Consensus::FundingStream idx) { - // Integer division is floor division in C++ - auto curPeriod = ( - nHeight + params.nSubsidyPostBlossomHalvingInterval - HeightForHalving(params, 1) - ) / params.nFundingPeriodLength; - auto startPeriod = ( - params.vFundingPeriods[idx].startHeight - + params.nSubsidyPostBlossomHalvingInterval - - HeightForHalving(params, 1) - ) / params.nFundingPeriodLength; + assert(nHeight <= INT_MAX - params.nSubsidyPostBlossomHalvingInterval); + assert(params.vFundingPeriods[idx].startHeight <= INT_MAX - params.nSubsidyPostBlossomHalvingInterval); + + int curPeriodNumerator = nHeight + params.nSubsidyPostBlossomHalvingInterval - HeightForHalving(params, 1); + int startPeriodNumerator = params.vFundingPeriods[idx].startHeight + params.nSubsidyPostBlossomHalvingInterval + - HeightForHalving(params, 1); + + // Integer division is floor division for nonnegative integers in C++ + assert(curPeriodNumerator >= 0); + assert(startPeriodNumerator >= 0); + auto curPeriod = curPeriodNumerator / params.nFundingPeriodLength; + auto startPeriod = startPeriodNumerator / params.nFundingPeriodLength; auto addressIndex = curPeriod - startPeriod; - return params.vFundingPeriods[idx].addresses[addressIndex]; + + auto addresses = params.vFundingPeriods[idx].addresses; + assert(addressIndex >= 0 && addressIndex < addresses.size()); + return addresses[addressIndex]; }; CAmount FundingStreamValue( @@ -370,7 +295,7 @@ Example implementation const Consensus::Params& params, Consensus::FundingStream idx) { - // Integer division is floor division in C++ + // Integer division is floor division for nonnegative integers in C++ return CAmount(( GetBlockSubsidy(nHeight, params) * params.vFundingPeriods[idx].valueNumerator ) / params.vFundingPeriods[idx].valueDenominator); @@ -381,7 +306,7 @@ Example implementation const Consensus::Params& params) { std::set> requiredStreams; - for (int idx = Consensus::FS_ZECC_EF; idx < Consensus::MAX_FUNDING_STREAMS; idx++) { + for (int idx = Consensus::FIRST_FUNDING_STREAM; idx < Consensus::MAX_FUNDING_STREAMS; idx++) { // Funding period is [startHeight, endHeight) if (nHeight >= params.vFundingPeriods[idx].startHeight && nHeight < params.vFundingPeriods[idx].endHeight) @@ -398,7 +323,7 @@ Example implementation { ... - if (NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_BLOSSOM)) { + if (NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_NU4)) { // Coinbase transaction must include outputs corresponding to the consensus // funding streams active at the current block height. auto requiredStreams = GetActiveFundingStreams(nHeight, consensusParams); @@ -413,14 +338,15 @@ Example implementation } if (!requiredStreams.empty()) { - return state.DoS(100, error("%s: funding stream missing", __func__), REJECT_INVALID, "cb-funding-stream-missing"); + return state.DoS(100, error("%s: funding stream missing", __func__), + REJECT_INVALID, "cb-funding-stream-missing"); } } else { // Coinbase transaction must include an output sending 20% of - // the block reward to a founders reward script, until the last founders - // reward block is reached, with exception of the genesis block. - // The last founders reward block is defined as the block just before the - // first subsidy halving block, which occurs at halving_interval + slow_start_shift + // the block subsidy to a Founders' Reward script, until the last Founders' + // Reward block is reached, with exception of the genesis block. + // The last Founders' Reward block is defined as the block just before the + // first subsidy halving block. if ((nHeight > 0) && (nHeight <= consensusParams.GetLastFoundersRewardBlockHeight())) { bool found = false; @@ -434,7 +360,8 @@ Example implementation } if (!found) { - return state.DoS(100, error("%s: founders reward missing", __func__), REJECT_INVALID, "cb-no-founders-reward"); + return state.DoS(100, error("%s: founders reward missing", __func__), + REJECT_INVALID, "cb-no-founders-reward"); } } } @@ -446,33 +373,17 @@ Example implementation Deployment ========== -This proposal was originally intended to be deployed with the Blossom network upgrade. [#zip-0206]_ +This proposal is intended to be deployed with ${NU4}. [#zip-0251]_ Backward compatibility ====================== -This proposal intentionally creates what is known as a "bilateral consensus rule change". Use of this -mechanism requires that all network participants upgrade their software to a compatible version within the -upgrade window. Older software will treat post-upgrade blocks as invalid, and will follow any pre-upgrade -branch that persists. - -This proposal is designed with the explicit requirement of not altering the overall issuance schedule (based -on time), nor does it alter the proportion or timeline of the overall Founders' Reward. As a result, no users -outside of the Zerocoin Electric Coin Company and Zcash Foundation should experience any UX or economic change -outside of the upgrade due to this proposal itself. - - -Interactions with other ZIPs ----------------------------- - -[#zip-0208]_ (Shorter Block Target Spacing) specifies a change to the block target spacing. It is planned -to take effect in the Blossom network upgrade [#zip-0206]_. This ZIP was originally written to take effect -at the same time, but was Withdrawn from consideration for Blossom. - -ZIP 208 modifies the payment of the original Founders' Reward to take account of the block target spacing -change. It does this by specifying a FounderAddressAdjustedHeight function and related changes, which would -need to be revisited to take into account funding streams. +This proposal intentionally creates what is known as a "bilateral consensus +rule change". Use of this mechanism requires that all network participants +upgrade their software to a compatible version within the upgrade window. +Older software will treat post-upgrade blocks as invalid, and will follow any +pre-upgrade consensus branch that persists. Reference Implementation @@ -485,9 +396,15 @@ References ========== .. [#RFC2119] `Key words for use in RFCs to Indicate Requirement Levels `_ -.. [#block-subsidy] `Section 7.7: Calculation of Block Subsidy and Founders' Reward. Zcash Protocol Specification, Version 2018.0-beta-33 or later [Overwinter+Sapling] `_ -.. [#continued-funding] `Continued Funding and Transparency `_ +.. [#protocol] `Zcash Protocol Specification, Version 2020.1.1 or later `_ +.. [#protocol-subsidyconcepts] `Section 3.9: Block Subsidy and Founders' Reward. Zcash Protocol Specification, Version 2020.1.1 or later `_ +.. [#protocol-constants] `Section 5.3: Constants. Zcash Protocol Specification, Version 2020.1.1 or later `_ +.. [#protocol-subsidies] `Section 7.7: Calculation of Block Subsidy and Founders' Reward. Zcash Protocol Specification, Version 2020.1.1 or later `_ +.. [#protocol-foundersreward] `Section 7.8: Payment of Founders' Reward. Zcash Protocol Specification, Version 2020.1.1 or later `_ +.. [#zip-0000] `ZIP 0: ZIP Process `_ +.. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ .. [#zip-0208] `ZIP 208: Shorter Block Target Spacing `_ -.. [#original-fr-consensus-rule] `Section 7.8: Payment of Founders' Reward. Zcash Protocol Specification, Version 2018.0-beta-33 or later [Overwinter+Sapling] `_ -.. [#protocol-constants] `Section 5.3: Constants. Zcash Protocol Specification, Version 2018.0-beta-33 or later [Overwinter+Sapling] `_ -.. [#zip-0206] `ZIP 206: Blossom Network Upgrade `_ +.. [#zip-0213] `ZIP 213: Shielded Coinbase `_ +.. [#zip-0214] `ZIP 214: Consensus rules for a Zcash Development Fund `_ +.. [#zip-0251] `ZIP 251: Deployment of the ${NU4} Network Upgrade `_ +.. [#zip-1014] `ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants `_ diff --git a/zip-0208.html b/zip-0208.html index 741b8ac41..87b3563ac 100644 --- a/zip-0208.html +++ b/zip-0208.html @@ -180,7 +180,13 @@ static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024; /** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of chainActive.Tip() will not be pruned. */ -static const unsigned int MIN_BLOCKS_TO_KEEP = 288; +static const unsigned int MIN_BLOCKS_TO_KEEP = 288; + +/** + * The period before a network upgrade activates, where connections to upgrading peers are preferred (in blocks). + * This was three days for upgrades up to and including Blossom, and is 1.5 days from Heartwood onward. + */ +static const int NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD = 1728;
diff --git a/zip-0208.rst b/zip-0208.rst index 4367f18db..18df47bf1 100644 --- a/zip-0208.rst +++ b/zip-0208.rst @@ -328,7 +328,6 @@ account of cases where the time period that needs to be estimated crosses Blosso activation. - Other block-related constants ''''''''''''''''''''''''''''' @@ -351,6 +350,12 @@ decision was made not to change them:: /** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of chainActive.Tip() will not be pruned. */ static const unsigned int MIN_BLOCKS_TO_KEEP = 288; + /** + * The period before a network upgrade activates, where connections to upgrading peers are preferred (in blocks). + * This was three days for upgrades up to and including Blossom, and is 1.5 days from Heartwood onward. + */ + static const int NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD = 1728; + Deployment ========== diff --git a/zip-0214.html b/zip-0214.html new file mode 100644 index 000000000..9d0096754 --- /dev/null +++ b/zip-0214.html @@ -0,0 +1,210 @@ + + + + ZIP 214: Consensus rules for a Zcash Development Fund + + + +
+
ZIP: 214
+Title: Consensus rules for a Zcash Development Fund
+Owners: Daira Hopwood <daira@electriccoin.co>
+Status: Draft
+Category: Consensus
+Created: 2020-02-28
+License: MIT
+Discussions-To: <https://forum.zcashcommunity.com/t/community-sentiment-polling-results-nu4-and-draft-zip-1014/35560>
+

Terminology

+

The key words "MUST", "SHALL", and "SHOULD" in this document are to be interpreted as described in RFC 2119. 1

+

The term "Zcash" in this document is to be interpreted as described in the Zcash Trademark Donation and License Agreement (3 or successor agreement).

+

The term "network upgrade" in this document is to be interpreted as described in ZIP 200 5 and the Zcash Trademark Donation and License Agreement (3 or successor agreement).

+

The terms "block subsidy" and "halving" in this document are to be interpreted as described in sections 3.9 and 7.7 of the Zcash Protocol Specification. 2

+

The terms "Electric Coin Company" (or "ECC"), "Zcash Foundation" (or "ZF"), "Major Grants", "ECC slice", "ZF slice", and "MG slice" in this document are to be interpreted as described in ZIP 1014 9.

+

The terms below are to be interpreted as follows:

+
+
${NU4}
+
Code-name for the fifth Zcash network upgrade, also known as Network Upgrade 4.
+
Testnet
+
The Zcash test network, as defined in 2.
+
Mainnet
+
The Zcash production network, as defined in 2.
+
+
+

Abstract

+

This ZIP describes consensus rule changes interpreting the proposed structure of the Zcash Development Fund, which is to be enacted in Network Upgrade 4 and last for 4 years.

+
+

Applicability

+

This ZIP concerns the Zcash Mainnet and Testnet, and is not intended to be applicable to other block chains using Zcash technology.

+
+

Motivation

+

Motivation for the Zcash Development Fund itself is considered in ZIP 1014 9, which gives a high-level description of the intended structure of the fund.

+

An important motivation for describing the consensus rules in a separate ZIP is to avoid making unintended changes to ZIP 1014, which has already been agreed between ECC, ZF, and the Zcash community. This facilitates critically assessing whether the consensus rule changes accurately reflect the intent of ZIP 1014.

+
+

Requirements

+

The primary requirement of this ZIP is to make changes to consensus rules necessary and sufficient to implement the intent of ZIP 1014.

+

The Zcash Development Fund distributes funding in ZEC obtained from block subsidies on Mainnet. This ZIP should also specify corresponding rules, addresses, and activation height for Testnet, in order to allow testing and auditing of the design and implementation within sufficient lead time before activation on Mainnet.

+
+

Non-requirements

+

This ZIP is not required to enforce provisions of ZIP 1014 that fall outside what is implementable by Zcash consensus rules.

+
+

Specification

+

The Blossom network upgrade changed the height of the first halving to block height 1046400 7, as a consequence of reducing the block target spacing from 150 seconds to 75 seconds.

+

Since ZIP 1014 specifies that the Zcash Development Fund starts at the first halving, the activation height of ${NU4} on Mainnet therefore SHALL be 1046400.

+

ZIP 207 6 SHALL be activated in ${NU4}.

+

The following funding streams are defined for Mainnet:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StreamNumeratorDenominatorStart heightEnd height
FS_ECC710010464002726400
FS_ZF510010464002726400
FS_MG810010464002726400
+
+

As specified in 6, a funding stream is active for a span of blocks that includes the block at its start height, but excludes the block at its end height.

+

The funding streams are defined for Testnet are identical except that the start height of each stream is the activation height of ${NU4} on Testnet, i.e. xxxxxxx.

+

Note: on Testnet, the activation height of ${NU4} will be before the first halving. Therefore, the consequence of the above rules for Testnet is that the amount sent to each Zcash Development Fund recipient address will initially (before Testnet block height 1046400) be double the number of currency units as the corresponding initial amount on Mainnet. This reduces to the same number of currency units as on Mainnet, from Testnet block heights 1046400 (inclusive) to 2726400 (exclusive).

+

Dev Fund Recipient Addresses

+

For each of Testnet and Mainnet, before deploying this ZIP in a node implementation with the activation height set for that network, each of the parties (ECC and ZF) SHALL generate sequences of recipient addresses to be used for each stream in each funding period:

+
    +
  • ECC SHALL generate the addresses for the FS_ECC funding stream, which on Mainnet corresponds to the ECC slice;
  • +
  • ZF SHALL generate the addresses for the FS_ZF and FS_MG funding streams, which on Mainnet correspond to the ZF slice and MG slice respectively.
  • +
+

Within each stream, the addresses MAY be independent, or MAY be repeated between funding periods. Each party SHOULD take account of operational security issues associated with potential compromise of the associated spending keys.

+

Funds sent to each Mainnet funding stream SHALL be governed by all requirements on the corresponding slice specified in ZIP 1014 9.

+

No requirements are imposed on the use of funds sent to Testnet funding streams.

+

Direct-grant option

+

ZIP 1014 specifies a "direct-grant option" by which, if agreed upon by both ECC and ZF before ${NU4} activation, some portion of the MG slice may be directly assigned to the grantee(s), rather than accepted and disbursed by ZF. 9

+

The funding stream mechanism allows for this option by adding a funding stream corresponding to each direct grantee, with addresses generated by ZF. In this case the total amount of funding streams assigned to direct grantees MUST be subtracted from the funding stream for the remaining MG slice (or, if all Major Grants are direct, replace the funding stream for the MG slice).

+

For each network upgrade after ${NU4} requiring modifications to the set of direct grantees, a separate ZIP would be published specifying those modifications.

+
+
+

Mainnet Recipient Addresses

+
+
+
FS_ECC_Addresses[0..47] = [
+
"TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO" ]
+
FS_ZF_Addresses[0..47] = [
+
"TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO" ]
+
FS_MG_Addresses[0..47] = [
+
"TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO", "TODO" ]
+
+
+
+

Testnet Recipient Addresses

+

TODO

+
+
+

Rationale

+

The rationale for ZF generating the addresses for the ZF_MG funding stream is that ZF is the financial recipient of the MG slice as specified in ZIP 1014. 9

+

Generation of recipient addresses for Testnet is specified to be done by the same parties as on Mainnet, in order to allow practicing each party's security procedures.

+

Since Testnet is ahead of Mainnet in terms of block height (by ~77000 blocks at the time of writing, which is the equivalent of ~67 days at the post-Blossom block target spacing), the activation height and the start heights of the funding streams could have also been set to 1046400 on Testnet. However, 67 days is arguably too short a testing period, and the block rate on Testnet is less predictable than on Mainnet.

+

It was judged to be unnecessary to have a mechanism to update funding stream definitions (in case of security breach or changes to direct grant recipients) other than at network upgrades.

+
+

Deployment

+

This proposal is intended to be deployed with ${NU4}. 8

+
+

References

+ + + + + + + +
1Key words for use in RFCs to Indicate Requirement Levels
+ + + + + + + +
2Zcash Protocol Specification, Version 2020.1.1 or later
+ + + + + + + +
3Zcash Trademark Donation and License Agreement
+ + + + + + + +
4The Open Source Definition
+ + + + + + + +
5ZIP 200: Network Upgrade Mechanism
+ + + + + + + +
6ZIP 207: Funding Streams
+ + + + + + + +
7ZIP 208: Shorter Block Target Spacing
+ + + + + + + +
8ZIP 251: Deployment of the ${NU4} Network Upgrade
+ + + + + + + +
9ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants
+
+
+ + \ No newline at end of file diff --git a/zip-0214.rst b/zip-0214.rst new file mode 100644 index 000000000..872bc9b2a --- /dev/null +++ b/zip-0214.rst @@ -0,0 +1,369 @@ +:: + + ZIP: 214 + Title: Consensus rules for a Zcash Development Fund + Owners: Daira Hopwood + Status: Draft + Category: Consensus + Created: 2020-02-28 + License: MIT + Discussions-To: + + +Terminology +=========== + +The key words "MUST", "SHALL", and "SHOULD" in this document are to be +interpreted as described in RFC 2119. [#RFC2119]_ + +The term "Zcash" in this document is to be interpreted as described in the +Zcash Trademark Donation and License Agreement ([#trademark]_ or successor +agreement). + +The term "network upgrade" in this document is to be interpreted as +described in ZIP 200 [#zip-0200]_ and the Zcash Trademark Donation and License +Agreement ([#trademark]_ or successor agreement). + +The terms "block subsidy" and "halving" in this document are to be interpreted +as described in sections 3.9 and 7.7 of the Zcash Protocol Specification. +[#protocol]_ + +The terms "Electric Coin Company" (or "ECC"), "Zcash Foundation" (or "ZF"), +"Major Grants", "ECC slice", "ZF slice", and "MG slice" in this document are to +be interpreted as described in ZIP 1014 [#zip-1014]_. + +The terms below are to be interpreted as follows: + +${NU4} + Code-name for the fifth Zcash network upgrade, also known as Network Upgrade 4. +Testnet + The Zcash test network, as defined in [#protocol]_. +Mainnet + The Zcash production network, as defined in [#protocol]_. + + +Abstract +======== + +This ZIP describes consensus rule changes interpreting the proposed structure of +the Zcash Development Fund, which is to be enacted in Network Upgrade 4 and last +for 4 years. + + +Applicability +============= + +This ZIP concerns the Zcash Mainnet and Testnet, and is not intended to be +applicable to other block chains using Zcash technology. + + +Motivation +========== + +Motivation for the Zcash Development Fund itself is considered in ZIP 1014 +[#zip-1014]_, which gives a high-level description of the intended structure of +the fund. + +An important motivation for describing the consensus rules in a separate ZIP is +to avoid making unintended changes to ZIP 1014, which has already been agreed +between ECC, ZF, and the Zcash community. This facilitates critically assessing +whether the consensus rule changes accurately reflect the intent of ZIP 1014. + + +Requirements +============ + +The primary requirement of this ZIP is to make changes to consensus rules necessary +and sufficient to implement the intent of ZIP 1014. + +The Zcash Development Fund distributes funding in ZEC obtained from block subsidies +on Mainnet. This ZIP should also specify corresponding rules, addresses, and +activation height for Testnet, in order to allow testing and auditing of the design +and implementation within sufficient lead time before activation on Mainnet. + + +Non-requirements +================ + +This ZIP is not required to enforce provisions of ZIP 1014 that fall outside what +is implementable by Zcash consensus rules. + + +Specification +============= + +The Blossom network upgrade changed the height of the first halving to block height +1046400 [#zip-0208]_, as a consequence of reducing the block target spacing from +150 seconds to 75 seconds. + +Since ZIP 1014 specifies that the Zcash Development Fund starts at the first halving, +the activation height of ${NU4} on Mainnet therefore SHALL be 1046400. + +ZIP 207 [#zip-0207]_ SHALL be activated in ${NU4}. + +The following funding streams are defined for Mainnet: + + ========== =========== ============= ============== ============ + Stream Numerator Denominator Start height End height + ========== =========== ============= ============== ============ + ``FS_ECC`` 7 100 1046400 2726400 + ``FS_ZF`` 5 100 1046400 2726400 + ``FS_MG`` 8 100 1046400 2726400 + ========== =========== ============= ============== ============ + +As specified in [#zip-0207]_, a funding stream is active for a span of blocks +that includes the block at its start height, but excludes the block at its end +height. + +The funding streams are defined for Testnet are identical except that the +start height of each stream is the activation height of ${NU4} on Testnet, i.e. +xxxxxxx. + +Note: on Testnet, the activation height of ${NU4} will be before the first halving. +Therefore, the consequence of the above rules for Testnet is that the amount sent +to each Zcash Development Fund recipient address will initially (before Testnet +block height 1046400) be double the number of currency units as the corresponding +initial amount on Mainnet. This reduces to the same number of currency units as on +Mainnet, from Testnet block heights 1046400 (inclusive) to 2726400 (exclusive). + + +Dev Fund Recipient Addresses +---------------------------- + +For each of Testnet and Mainnet, before deploying this ZIP in a node implementation +with the activation height set for that network, each of the parties (ECC and ZF) +SHALL generate sequences of recipient addresses to be used for each stream in each +funding period: + +* ECC SHALL generate the addresses for the ``FS_ECC`` funding stream, which on + Mainnet corresponds to the **ECC slice**; +* ZF SHALL generate the addresses for the ``FS_ZF`` and ``FS_MG`` funding streams, + which on Mainnet correspond to the **ZF slice** and **MG slice** respectively. + +Within each stream, the addresses MAY be independent, or MAY be repeated between +funding periods. Each party SHOULD take account of operational security issues +associated with potential compromise of the associated spending keys. + +Funds sent to each Mainnet funding stream SHALL be governed by all requirements on +the corresponding slice specified in ZIP 1014 [#zip-1014]_. + +No requirements are imposed on the use of funds sent to Testnet funding streams. + + +Direct-grant option +''''''''''''''''''' + +ZIP 1014 specifies a "direct-grant option" by which, if agreed upon by both ECC +and ZF before ${NU4} activation, some portion of the **MG slice** may be directly +assigned to the grantee(s), rather than accepted and disbursed by ZF. [#zip-1014]_ + +The funding stream mechanism allows for this option by adding a funding stream +corresponding to each direct grantee, with addresses generated by ZF. In this case +the total amount of funding streams assigned to direct grantees MUST be subtracted +from the funding stream for the remaining **MG slice** (or, if all Major Grants are +direct, replace the funding stream for the **MG slice**). + +For each network upgrade after ${NU4} requiring modifications to the set of direct +grantees, a separate ZIP would be published specifying those modifications. + + +Mainnet Recipient Addresses +--------------------------- + + FS_ECC_Addresses[0..47] = [ + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO" ] + + FS_ZF_Addresses[0..47] = [ + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO" ] + + FS_MG_Addresses[0..47] = [ + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO", + "TODO" ] + +Testnet Recipient Addresses +--------------------------- + +TODO + + +Rationale +========= + +The rationale for ZF generating the addresses for the ``ZF_MG`` funding +stream is that ZF is the financial recipient of the **MG slice** as specified +in ZIP 1014. [#zip-1014]_ + +Generation of recipient addresses for Testnet is specified to be done by the +same parties as on Mainnet, in order to allow practicing each party's security +procedures. + +Since Testnet is ahead of Mainnet in terms of block height (by ~77000 blocks +at the time of writing, which is the equivalent of ~67 days at the post-Blossom +block target spacing), the activation height and the start heights of the +funding streams could have also been set to 1046400 on Testnet. However, +67 days is arguably too short a testing period, and the block rate on Testnet +is less predictable than on Mainnet. + +It was judged to be unnecessary to have a mechanism to update funding stream +definitions (in case of security breach or changes to direct grant recipients) +other than at network upgrades. + + +Deployment +========== + +This proposal is intended to be deployed with ${NU4}. [#zip-0251]_ + + +References +========== + +.. [#RFC2119] `Key words for use in RFCs to Indicate Requirement Levels `_ +.. [#protocol] `Zcash Protocol Specification, Version 2020.1.1 or later `_ +.. [#trademark] `Zcash Trademark Donation and License Agreement `_ +.. [#osd] `The Open Source Definition `_ +.. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ +.. [#zip-0207] `ZIP 207: Funding Streams `_ +.. [#zip-0208] `ZIP 208: Shorter Block Target Spacing `_ +.. [#zip-0251] `ZIP 251: Deployment of the ${NU4} Network Upgrade `_ +.. [#zip-1014] `ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants `_ diff --git a/zip-0250.html b/zip-0250.html index a651b7943..d309b0766 100644 --- a/zip-0250.html +++ b/zip-0250.html @@ -51,9 +51,12 @@

Nodes compatible with Heartwood activation on testnet MUST advertise protocol version 170010 or later. Nodes compatible with Heartwood activation on mainnet MUST advertise protocol version 170011 or later. The minimum peer protocol version that Heartwood-compatible nodes will connect to is 170002.

Pre-Heartwood testnet nodes are defined as nodes on testnet advertising a protocol version less than 170010. Pre-Heartwood mainnet nodes are defined as nodes on mainnet advertising a protocol version less than 170011.

-

For each network (testnet and mainnet), approximately three days (defined in terms of block height) before the corresponding Heartwood activation height, nodes compatible with Heartwood activation on that network will change the behaviour of their peer connection logic in order to prefer pre-Heartwood peers on that network for eviction from the set of peer connections:

-
/** The period before a network upgrade activates, where connections to upgrading peers are preferred (in blocks). */
-static const int NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD = 24 * 24 * 3;
+

For each network (testnet and mainnet), approximately 1.5 days (defined in terms of block height) before the corresponding Heartwood activation height, nodes compatible with Heartwood activation on that network will change the behaviour of their peer connection logic in order to prefer pre-Heartwood peers on that network for eviction from the set of peer connections:

+
/**
+ * The period before a network upgrade activates, where connections to upgrading peers are preferred (in blocks).
+ * This was three days for upgrades up to and including Blossom, and is 1.5 days from Heartwood onward.
+ */
+static const int NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD = 1728;

The implementation is similar to that for Overwinter which was described in 4.

Once Heartwood activates on testnet or mainnet, Heartwood nodes SHOULD take steps to:

    diff --git a/zip-0250.rst b/zip-0250.rst index 6186b192f..14d0c99fb 100644 --- a/zip-0250.rst +++ b/zip-0250.rst @@ -73,14 +73,17 @@ Pre-Heartwood testnet nodes are defined as nodes on testnet advertising a protoc version less than 170010. Pre-Heartwood mainnet nodes are defined as nodes on mainnet advertising a protocol version less than 170011. -For each network (testnet and mainnet), approximately three days (defined in terms of +For each network (testnet and mainnet), approximately 1.5 days (defined in terms of block height) before the corresponding Heartwood activation height, nodes compatible with Heartwood activation on that network will change the behaviour of their peer connection logic in order to prefer pre-Heartwood peers on that network for eviction from the set of peer connections:: - /** The period before a network upgrade activates, where connections to upgrading peers are preferred (in blocks). */ - static const int NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD = 24 * 24 * 3; + /** + * The period before a network upgrade activates, where connections to upgrading peers are preferred (in blocks). + * This was three days for upgrades up to and including Blossom, and is 1.5 days from Heartwood onward. + */ + static const int NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD = 1728; The implementation is similar to that for Overwinter which was described in [#zip-0201]_. diff --git a/zip-0251.html b/zip-0251.html new file mode 100644 index 000000000..465a0b59a --- /dev/null +++ b/zip-0251.html @@ -0,0 +1,146 @@ + + + + ZIP 251: Deployment of the Network Upgrade + + + +
    +
    ZIP: 251
    +Title: Deployment of the ${NU4} Network Upgrade
    +Owners: Daira Hopwood <daira@electriccoin.co>
    +Status: Draft
    +Category: Consensus
    +Created: 2020-02-28
    +License: MIT
    +

    Terminology

    +

    The key words "MUST", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in RFC 2119. 1

    +

    The term "network upgrade" in this document is to be interpreted as described in ZIP 200. 3

    +

    The terms below are to be interpreted as follows:

    +
    +
    ${NU4}
    +
    Code-name for the fifth Zcash network upgrade, also known as Network Upgrade 4.
    +
    Testnet
    +
    The Zcash test network, as defined in 2.
    +
    Mainnet
    +
    The Zcash production network, as defined in 2.
    +
    +
    +

    Abstract

    +

    This proposal defines the deployment of the ${NU4} network upgrade.

    +
    +

    Specification

    +

    ${NU4} deployment

    +

    The primary sources of information about ${NU4} consensus protocol changes are:

    +
      +
    • The Zcash Protocol Specification 2
    • +
    • ZIP 200: Network Upgrade Mechanism 3
    • +
    • ZIP 207: Funding Streams 5
    • +
    • ZIP 214: Consensus rules for a Zcash Development Fund 6
    • +
    • ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants 8
    • +
    • TODO: other ZIPs
    • +
    +

    The network handshake and peer management mechanisms defined in ZIP 201 4 also apply to this upgrade.

    +

    The following network upgrade constants 3 are defined for the ${NU4} upgrade:

    +
    +
    CONSENSUS_BRANCH_ID
    +
    0xTODO
    +
    ACTIVATION_HEIGHT (${NU4})
    +
    +

    Testnet: TODO

    +

    Mainnet: 1046400

    +
    +
    +

    Nodes compatible with ${NU4} activation on testnet MUST advertise protocol version TODO or later. Nodes compatible with ${NU4} activation on mainnet MUST advertise protocol version TODO or later. The minimum peer protocol version that ${NU4}-compatible nodes will connect to is 170002.

    +

    Pre-${NU4} testnet nodes are defined as nodes on testnet advertising a protocol version less than TODO. Pre-${NU4} mainnet nodes are defined as nodes on mainnet advertising a protocol version less than TODO.

    +

    For each network (testnet and mainnet), approximately 1.5 days (defined in terms of block height) before the corresponding ${NU4} activation height, nodes compatible with ${NU4} activation on that network will change the behaviour of their peer connection logic in order to prefer pre-${NU4} peers on that network for eviction from the set of peer connections:

    +
    /**
    + * The period before a network upgrade activates, where connections to upgrading peers are preferred (in blocks).
    + * This was three days for upgrades up to and including Blossom, and is 1.5 days from Heartwood onward.
    + */
    +static const int NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD = 1728;
    +

    The implementation is similar to that for Overwinter which was described in 4.

    +

    Once ${NU4} activates on testnet or mainnet, ${NU4} nodes SHOULD take steps to:

    +
      +
    • reject new connections from pre-${NU4} nodes on that network;
    • +
    • disconnect any existing connections to pre-${NU4} nodes on that network.
    • +
    +
    +
    +

    Backward compatibility

    +

    Prior to the network upgrade activating on each network, ${NU4} and pre-${NU4} nodes are compatible and can connect to each other. However, ${NU4} nodes will have a preference for connecting to other ${NU4} nodes, so pre-${NU4} nodes will gradually be disconnected in the run up to activation.

    +

    Once the network upgrades, even though pre-${NU4} nodes can still accept the numerically larger protocol version used by ${NU4} as being valid, ${NU4} nodes will always disconnect peers using lower protocol versions.

    +

    TODO: delete if inapplicable. Unlike Overwinter and Sapling, and like Blossom and Heartwood, ${NU4} does not define a new transaction version. ${NU4} transactions are therefore in the same v4 format as Sapling transactions; use the same version group ID, i.e. 0x892F2085 as defined in 2 section 7.1; and use the same transaction digest algorithm as defined in 7. This does not imply that transactions are valid across the ${NU4} activation, since signatures MUST use the appropriate consensus branch ID. 7

    +
    +

    Support in zcashd

    +

    Support for ${NU4} on testnet will be implemented in zcashd version 3.1.0, which will advertise protocol version TODO. Support for ${NU4} on mainnet will be implemented in zcashd version 4.0.0, which will advertise protocol version TODO.

    +
    +

    References

    + + + + + + + +
    1Key words for use in RFCs to Indicate Requirement Levels
    + + + + + + + +
    2Zcash Protocol Specification, Version 2020.1.1 or later
    + + + + + + + +
    3ZIP 200: Network Upgrade Activation Mechanism
    + + + + + + + +
    4ZIP 201: Network Peer Management for Overwinter
    + + + + + + + +
    5ZIP 208: Shorter Block Target Spacing
    + + + + + + + +
    6ZIP 214: Consensus rules for a Zcash Development Fund
    + + + + + + + +
    7ZIP 243: Transaction Signature Verification for Sapling
    + + + + + + + +
    8ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants
    +
    +
    + + \ No newline at end of file diff --git a/zip-0251.rst b/zip-0251.rst new file mode 100644 index 000000000..da13630df --- /dev/null +++ b/zip-0251.rst @@ -0,0 +1,139 @@ +:: + + ZIP: 251 + Title: Deployment of the ${NU4} Network Upgrade + Owners: Daira Hopwood + Status: Draft + Category: Consensus + Created: 2020-02-28 + License: MIT + + +Terminology +=========== + +The key words "MUST", "MUST NOT", "SHOULD", and "MAY" in this document are to be +interpreted as described in RFC 2119. [#RFC2119]_ + +The term "network upgrade" in this document is to be interpreted as described in +ZIP 200. [#zip-0200]_ + +The terms below are to be interpreted as follows: + +${NU4} + Code-name for the fifth Zcash network upgrade, also known as Network Upgrade 4. +Testnet + The Zcash test network, as defined in [#protocol]_. +Mainnet + The Zcash production network, as defined in [#protocol]_. + + +Abstract +======== + +This proposal defines the deployment of the ${NU4} network upgrade. + + +Specification +============= + +${NU4} deployment +----------------- + +The primary sources of information about ${NU4} consensus protocol changes are: + +- The Zcash Protocol Specification [#protocol]_ +- ZIP 200: Network Upgrade Mechanism [#zip-0200]_ +- ZIP 207: Funding Streams [#zip-0207]_ +- ZIP 214: Consensus rules for a Zcash Development Fund [#zip-0214]_ +- ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants [#zip-1014]_ +- TODO: other ZIPs + +The network handshake and peer management mechanisms defined in ZIP 201 [#zip-0201]_ +also apply to this upgrade. + + +The following network upgrade constants [#zip-0200]_ are defined for the ${NU4} +upgrade: + +CONSENSUS_BRANCH_ID + ``0xTODO`` + + +ACTIVATION_HEIGHT (${NU4}) + Testnet: TODO + + Mainnet: 1046400 + + +Nodes compatible with ${NU4} activation on testnet MUST advertise protocol version +TODO or later. Nodes compatible with ${NU4} activation on mainnet MUST advertise +protocol version TODO or later. The minimum peer protocol version that +${NU4}-compatible nodes will connect to is 170002. + +Pre-${NU4} testnet nodes are defined as nodes on testnet advertising a protocol +version less than TODO. Pre-${NU4} mainnet nodes are defined as nodes on mainnet +advertising a protocol version less than TODO. + +For each network (testnet and mainnet), approximately 1.5 days (defined in terms of +block height) before the corresponding ${NU4} activation height, nodes compatible +with ${NU4} activation on that network will change the behaviour of their peer +connection logic in order to prefer pre-${NU4} peers on that network for eviction +from the set of peer connections:: + + /** + * The period before a network upgrade activates, where connections to upgrading peers are preferred (in blocks). + * This was three days for upgrades up to and including Blossom, and is 1.5 days from Heartwood onward. + */ + static const int NETWORK_UPGRADE_PEER_PREFERENCE_BLOCK_PERIOD = 1728; + +The implementation is similar to that for Overwinter which was described in +[#zip-0201]_. + +Once ${NU4} activates on testnet or mainnet, ${NU4} nodes SHOULD take steps to: + +- reject new connections from pre-${NU4} nodes on that network; +- disconnect any existing connections to pre-${NU4} nodes on that network. + + +Backward compatibility +====================== + +Prior to the network upgrade activating on each network, ${NU4} and pre-${NU4} +nodes are compatible and can connect to each other. However, ${NU4} nodes will +have a preference for connecting to other ${NU4} nodes, so pre-${NU4} nodes will +gradually be disconnected in the run up to activation. + +Once the network upgrades, even though pre-${NU4} nodes can still accept the +numerically larger protocol version used by ${NU4} as being valid, ${NU4} nodes +will always disconnect peers using lower protocol versions. + +TODO: delete if inapplicable. +Unlike Overwinter and Sapling, and like Blossom and Heartwood, ${NU4} does not +define a new transaction version. ${NU4} transactions are therefore in the same +v4 format as Sapling transactions; use the same version group ID, i.e. 0x892F2085 +as defined in [#protocol]_ section 7.1; and use the same transaction digest +algorithm as defined in [#zip-0243]_. This does not imply that transactions are +valid across the ${NU4} activation, since signatures MUST use the appropriate +consensus branch ID. [#zip-0243]_ + + +Support in zcashd +================= + +Support for ${NU4} on testnet will be implemented in ``zcashd`` version 3.1.0, which +will advertise protocol version TODO. Support for ${NU4} on mainnet will be implemented +in ``zcashd`` version 4.0.0, which will advertise protocol version TODO. + + +References +========== + +.. [#RFC2119] `Key words for use in RFCs to Indicate Requirement Levels `_ +.. [#protocol] `Zcash Protocol Specification, Version 2020.1.1 or later `_ +.. [#zip-0200] `ZIP 200: Network Upgrade Activation Mechanism `_ +.. [#zip-0201] `ZIP 201: Network Peer Management for Overwinter `_ +.. [#zip-0207] `ZIP 208: Shorter Block Target Spacing `_ +.. [#zip-0214] `ZIP 214: Consensus rules for a Zcash Development Fund `_ +.. [#zip-0243] `ZIP 243: Transaction Signature Verification for Sapling `_ +.. [#zip-1014] `ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants `_