<p>The key words "MUST", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in RFC 2119. <aid="id1"class="footnote_reference"href="#rfc2119">1</a></p>
<p>The term "network upgrade" in this document is to be interpreted as described in ZIP 200. <aid="id2"class="footnote_reference"href="#zip-0200">3</a></p>
<p>The terms below are to be interpreted as follows:</p>
<dl>
<dt>${NU4}</dt>
<dd>Code-name for the fifth Zcash network upgrade, also known as Network Upgrade 4.</dd>
<dt>Testnet</dt>
<dd>The Zcash test network, as defined in <aid="id3"class="footnote_reference"href="#protocol">2</a>.</dd>
<dt>Mainnet</dt>
<dd>The Zcash production network, as defined in <aid="id4"class="footnote_reference"href="#protocol">2</a>.</dd>
<p>The network handshake and peer management mechanisms defined in ZIP 201 <aid="id10"class="footnote_reference"href="#zip-0201">4</a> also apply to this upgrade.</p>
<p>The following network upgrade constants <aid="id11"class="footnote_reference"href="#zip-0200">3</a> are defined for the ${NU4} upgrade:</p>
<p>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.</p>
<p>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.</p>
<p>For each network (testnet and mainnet), approximately three 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:</p>
<pre>/** 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;</pre>
<p>The implementation is similar to that for Overwinter which was described in <aid="id12"class="footnote_reference"href="#zip-0201">4</a>.</p>
<p>Once ${NU4} activates on testnet or mainnet, ${NU4} nodes SHOULD take steps to:</p>
<ul>
<li>reject new connections from pre-${NU4} nodes on that network;</li>
<li>disconnect any existing connections to pre-${NU4} nodes on that network.</li>
<p>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.</p>
<p>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.</p>
<p>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 <aid="id13"class="footnote_reference"href="#protocol">2</a> section 7.1; and use the same transaction digest algorithm as defined in <aid="id14"class="footnote_reference"href="#zip-0243">7</a>. This does not imply that transactions are valid across the ${NU4} activation, since signatures MUST use the appropriate consensus branch ID. <aid="id15"class="footnote_reference"href="#zip-0243">7</a></p>
<sectionid="support-in-zcashd"><h2><spanclass="section-heading">Support in zcashd</span><spanclass="section-anchor"><ahref="#support-in-zcashd"><imgwidth="24"height="24"src="assets/images/section-anchor.png"alt=""></a></span></h2>
<p>Support for ${NU4} on testnet will be implemented in <code>zcashd</code> version TODO, which will advertise protocol version TODO. Support for ${NU4} on mainnet will be implemented in <code>zcashd</code> version 3.0.0, which will advertise protocol version TODO.</p>