diff --git a/protocol/Makefile b/protocol/Makefile index c24798d95..885396c7e 100644 --- a/protocol/Makefile +++ b/protocol/Makefile @@ -22,11 +22,9 @@ PDFDIR=../rendered/protocol .PHONY: all protocol all-specs tag-release discard all: .Makefile.uptodate - $(MAKE) $(PDFDIR)/nu6.pdf $(PDFDIR)/nu5.pdf $(PDFDIR)/canopy.pdf $(PDFDIR)/heartwood.pdf $(PDFDIR)/blossom.pdf $(PDFDIR)/sapling.pdf - $(MAKE) protocol + $(MAKE) $(PDFDIR)/protocol.pdf $(PDFDIR)/nu5.pdf $(PDFDIR)/canopy.pdf $(PDFDIR)/heartwood.pdf $(PDFDIR)/blossom.pdf $(PDFDIR)/sapling.pdf -protocol: $(PDFDIR)/nu5.pdf - cp -f $(PDFDIR)/nu5.pdf $(PDFDIR)/protocol.pdf +protocol: $(PDFDIR)/protocol.pdf all-specs: .Makefile.uptodate $(MAKE) nu6 nu5 canopy heartwood blossom sapling @@ -66,7 +64,7 @@ $(PDFDIR)/canopy.pdf: protocol.tex zcash.bib jubjub.png key_components_sapling.p $(PDFDIR)/nu5.pdf: protocol.tex zcash.bib jubjub.png key_components_sapling.png key_components_orchard.png incremental_merkle.png $(MAKE) nu5 -$(PDFDIR)/nu6.pdf: protocol.tex zcash.bib jubjub.png key_components_sapling.png key_components_orchard.png incremental_merkle.png +$(PDFDIR)/protocol.pdf: protocol.tex zcash.bib jubjub.png key_components_sapling.png key_components_orchard.png incremental_merkle.png $(MAKE) nu6 .PHONY: auxsapling sapling @@ -139,8 +137,8 @@ auxnu6: nu6: $(MAKE) auxnu6 - mv -f aux/nu6.pdf $(PDFDIR) + mv -f aux/nu6.pdf $(PDFDIR)/protocol.pdf .PHONY: clean clean: - rm -f aux/* protocol.ver $(PDFDIR)/protocol.pdf $(PDFDIR)/nu6.pdf $(PDFDIR)/nu5.pdf $(PDFDIR)/canopy.pdf $(PDFDIR)/heartwood.pdf $(PDFDIR)/blossom.pdf $(PDFDIR)/sapling.pdf + rm -f aux/* protocol.ver $(PDFDIR)/protocol.pdf $(PDFDIR)/nu5.pdf $(PDFDIR)/canopy.pdf $(PDFDIR)/heartwood.pdf $(PDFDIR)/blossom.pdf $(PDFDIR)/sapling.pdf diff --git a/protocol/protocol.tex b/protocol/protocol.tex index bf9e6c1cf..dd5c473fe 100644 --- a/protocol/protocol.tex +++ b/protocol/protocol.tex @@ -760,7 +760,7 @@ \newcommand{\BitcoinText}{\textbf{Bitcoin}} \newcommand{\CryptoNote}{\termbf{CryptoNote}} \newcommand{\Mimblewimble}{\termbf{Mimblewimble}} -\newcommand{\Bulletproofs}{\termbf{Bulletproofs}} +\newcommand{\Bulletproofs}{\termsf{Bulletproofs}} \newcommand{\ZEC}{\termbf{ZEC}} \newcommand{\TAZ}{\termbf{TAZ}} \newcommand{\zatoshi}{\term{zatoshi}} @@ -1069,8 +1069,8 @@ \newcommand{\genesisBlock}{\term{genesis block}} \newcommand{\genesisBlocks}{\terms{genesis block}} \newcommand{\medianTimePast}{\term{median-time-past}} -\newcommand{\transaction}{\term{transaction}} -\newcommand{\transactions}{\terms{transaction}} +\newcommand{\transaction}{\termandindex{trans\-action}{transaction}} +\newcommand{\transactions}{\termandindex{trans\-actions}{transactions}} \newcommand{\transactionID}{\term{transaction ID}} \newcommand{\transactionIDs}{\terms{transaction ID}} \newcommand{\xTransactionIDs}{\termxs{transaction ID}} @@ -1091,11 +1091,25 @@ \newcommand{\coinbaseTransactions}{\terms{coinbase transaction}} \newcommand{\prevout}{\termandindex{prevout}{prevout (previous output)}} \newcommand{\prevouts}{\termandindex{prevouts}{prevout (previous output)}} +\newcommand{\standardPtoSHScript}{\term{standard P2SH script}} +\newcommand{\standardRedeemScript}{\term{standard redeem script}} +\newcommand{\xStandardRedeemScript}{\termx{standard redeem script}} \newcommand{\transparent}{\term{transparent}} \newcommand{\xTransparent}{\termx{transparent}} \newcommand{\transparentAddress}{\term{transparent address}} \newcommand{\transparentAddresses}{\termes{transparent address}} \newcommand{\xTransparentAddresses}{\termxes{transparent address}} +\newcommand{\PtoSH}{\termandindex{P2SH}{transparent address (P2SH)}} +\newcommand{\PtoSHAddress}{\termandindex{P2SH address}{transparent address (P2SH)}} +\newcommand{\PtoSHAddresses}{\termandindex{P2SH addresses}{transparent address (P2SH)}} +\newcommand{\transparentPtoSHAddress}{\termandindex{transparent P2SH address}{transparent address (P2SH)}} +\newcommand{\PtoSHMultisigAddress}{\termandindex{P2SH multisig address}{transparent address (P2SH multisig)}} +\newcommand{\PtoSHMultisigAddresses}{\termandindex{P2SH multisig addresses}{transparent address (P2SH multisig)}} +\newcommand{\transparentPtoSHMultisigAddress}{\termandindex{transparent P2SH multisig address}{transparent address (P2SH multisig)}} +\newcommand{\PtoPKH}{\termandindex{P2PKH}{transparent address (P2PKH)}} +\newcommand{\PtoPKHAddress}{\termandindex{P2PKH address}{transparent address (P2PKH)}} +\newcommand{\PtoPKHAddresses}{\termandindex{P2PKH addresses}{transparent address (P2PKH)}} +\newcommand{\transparentPtoPKHAddress}{\termandindex{transparent P2PKH address}{transparent address (P2PKH)}} \newcommand{\transparentInput}{\term{transparent input}} \newcommand{\transparentInputs}{\terms{transparent input}} \newcommand{\xTransparentInputs}{\termxs{transparent input}} @@ -1106,11 +1120,17 @@ % There is no Sprout transaction value pool, since JoinSplits are balanced individually. \newcommand{\SaplingTxValuePool}{\termandindex{\textbf{Sapling} transaction value pool}{transaction value pool (Sapling)}} \newcommand{\OrchardTxValuePool}{\termandindex{\textbf{Orchard} transaction value pool}{transaction value pool (Orchard)}} +\newcommand{\TransparentChainValuePoolBalance}{\termandindex{transparent chain value pool balance}{chain value pool balance (transparent)}} \newcommand{\SproutChainValuePoolBalance}{\termandindex{\textbf{Sprout} chain value pool balance}{chain value pool balance (Sprout)}} \newcommand{\SaplingChainValuePoolBalance}{\termandindex{\textbf{Sapling} chain value pool balance}{chain value pool balance (Sapling)}} \newcommand{\OrchardChainValuePoolBalance}{\termandindex{\textbf{Orchard} chain value pool balance}{chain value pool balance (Orchard)}} +\newcommand{\DeferredChainValuePoolBalance}{\termandindex{deferred development fund chain value pool balance}{chain value pool balance (deferred development fund)}} \newcommand{\chainValuePool}{\term{chain value pool}} \newcommand{\chainValuePools}{\terms{chain value pool}} +\newcommand{\deferredChainValuePool}{\term{deferred development fund chain value pool}} +\newcommand{\totalIssuedSupply}{\term{total issued supply}} +\newcommand{\totalOutputValue}{\term{total output value}} +\newcommand{\totalInputValue}{\term{total input value}} \newcommand{\shielded}{\term{shielded}} \newcommand{\blockChain}{\term{block chain}} \newcommand{\blockChains}{\terms{block chain}} @@ -1468,6 +1488,7 @@ \newcommand{\rinbytes}{\mathsf{r\_in\_bytes}} \newcommand{\tx}{\mathsf{tx}} +\newcommand{\cb}{\mathsf{cb}} \newcommand{\ReceivedSet}{\mathsf{ReceivedSet}} \newcommand{\SpentSet}{\mathsf{SpentSet}} \newcommand{\NullifierMap}{\mathsf{NullifierMap}} @@ -1795,9 +1816,10 @@ \newcommand{\fsStartHeight}{\fs\mathsf{.StartHeight}} \newcommand{\fsEndHeight}{\fs\mathsf{.EndHeight}} \newcommand{\fsValue}{\fs\mathsf{.Value}} -\newcommand{\fsAddressList}{\fs\mathsf{.AddressList}} -\newcommand{\fsAddressIndex}{\fs\mathsf{.AddressIndex}} -\newcommand{\fsNumAddresses}{\fs\mathsf{.NumAddresses}} +\newcommand{\fsRecipient}{\fs\mathsf{.Recipient}} +\newcommand{\fsRecipients}{\fs\mathsf{.Recipients}} +\newcommand{\fsRecipientIndex}{\fs\mathsf{.RecipientIndex}} +\newcommand{\fsNumRecipients}{\fs\mathsf{.NumRecipients}} \newcommand{\fsRedeemScriptHash}{\fs\mathsf{.RedeemScriptHash}} \newcommand{\SlowStartInterval}{\mathsf{SlowStartInterval}} \newcommand{\SlowStartShift}{\mathsf{SlowStartShift}} @@ -1808,8 +1830,8 @@ \newcommand{\NumFounderAddresses}{\mathsf{NumFounderAddresses}} \newcommand{\FounderAddressChangeInterval}{\mathsf{FounderAddressChangeInterval}} \newcommand{\FoundersFraction}{\mathsf{FoundersFraction}} -\newcommand{\FundingStreamAddressChangeInterval}{\mathsf{FundingStreamAddressChangeInterval}} -\newcommand{\FundingStreamAddressPeriod}{\mathsf{FundingStreamAddressPeriod}} +\newcommand{\FSRecipientChangeInterval}{\mathsf{FSRecipientChangeInterval}} +\newcommand{\FSRecipientPeriod}{\mathsf{FSRecipientPeriod}} \newcommand{\BlockHeight}{\mathsf{height}} \newcommand{\FounderAddressAdjustedHeight}{\mathsf{FounderAddressAdjustedHeight}} \newcommand{\FoundersRewardLastBlockHeight}{\mathsf{FoundersRewardLastBlockHeight}} @@ -1821,6 +1843,8 @@ \newcommand{\FounderAddressIndex}{\mathsf{FounderAddressIndex}} \newcommand{\FounderRedeemScriptHash}{\mathsf{FounderRedeemScriptHash}} \newcommand{\heightBytes}{\mathsf{heightBytes}} +\newcommand{\ChainValuePoolBalance}[1]{\mathsf{ChainValuePoolBalance^{#1}}} +\newcommand{\IssuedSupply}{\mathsf{IssuedSupply}} \newcommand{\blockSubsidy}{\term{block subsidy}} \newcommand{\minerSubsidy}{\term{miner subsidy}} @@ -1836,6 +1860,7 @@ \newcommand{\utxosFull}{\termandindex{UTXOs (unspent transaction outputs)}{UTXO (unspent transaction output)}} \newcommand{\fundingStream}{\term{funding stream}} \newcommand{\fundingStreams}{\terms{funding stream}} +\newcommand{\prescribedWay}{\termandindex{prescribed way}{prescribed way (to pay a funding stream recipient)}} \newcommand{\BlossomActivationHeight}{\mathsf{BlossomActivationHeight}} \newcommand{\IsBlossomActivated}{\mathsf{IsBlossomActivated}} @@ -1995,6 +2020,8 @@ \newcommand{\vBalance}[1]{\mathsf{v^{balance#1}}} \newcommand{\vBad}{\mathsf{v^{bad}}} \newcommand{\vSum}{\mathsf{v^{*}}} +\newcommand{\totalDeferredOutput}{\mathsf{totalDeferredOutput}} +\newcommand{\DeferredPool}{\mathsf{DEFERRED\_POOL}} \newcommand{\OracleNewAddress}{\Oracle^{\mathsf{NewAddress}}} \newcommand{\OracleDH}{\Oracle^{\mathsf{DH}}} @@ -2086,6 +2113,7 @@ % Tx hashing and scripts \newcommand{\sighashAlgorithm}{\term{SIGHASH algorithm}} +\newcommand{\sighashAlgorithms}{\terms{SIGHASH algorithm}} \newcommand{\sighashTxHash}{\term{SIGHASH transaction hash}} \newcommand{\sighashTxHashes}{\termes{SIGHASH transaction hash}} \newcommand{\sighashType}{\term{SIGHASH type}} @@ -2467,45 +2495,57 @@ \newenvironment{consensusrules}{\introlist\callout{}{Consensus rules:}\begin{itemize}}{\end{itemize}} \newcommand{\prenusixitem}[1]{\item \prenusix{#1}} +\newcommand{\nusixonlyitem}[1]{\nusix{\item {[\NUSix only]}\, {#1}}} \newcommand{\nusixonwarditem}[1]{\nusix{\item {[\NUSix onward]}\, {#1}}} \newcommand{\prenufiveitem}[1]{\item \prenufive{#1}} +\newcommand{\nufiveonlyitem}[1]{\nufive{\item {[\NUFive only\notbeforenusix{, pre-\NUSix}]}\, {#1}}} \newcommand{\nufiveonwarditem}[1]{\nufive{\item {[\NUFive onward]}\, {#1}}} \newcommand{\precanopyitem}[1]{\item \precanopy{#1}} +\newcommand{\canopyonlyitem}[1]{\canopy{\item {[\Canopy only\notbeforenufive{, pre-\NUFive}]}\, {#1}}} \newcommand{\canopyonwarditem}[1]{\canopy{\item {[\Canopy onward]}\, {#1}}} \newcommand{\preheartwooditem}[1]{\item \preheartwood{#1}} +\newcommand{\heartwoodonlyitem}[1]{\heartwood{\item {[\Heartwood only\notbeforecanopy{, pre-\Canopy}]}\, {#1}}} \newcommand{\heartwoodonwarditem}[1]{\heartwood{\item {[\Heartwood onward]}\, {#1}}} \newcommand{\heartwoodandcanopyitem}[1]{\heartwood{\item \heartwoodandcanopy{#1}}} \newcommand{\preblossomitem}[1]{\item \preblossom{#1}} +\newcommand{\blossomonlyitem}[1]{\blossom{\item {[\Blossom only\notbeforeheartwood{, pre-\Heartwood}]}\, {#1}}} \newcommand{\blossomonwarditem}[1]{\blossom{\item {[\Blossom onward]}\, {#1}}} \newcommand{\presaplingitem}[1]{\item \presapling{#1}} +\newcommand{\saplingonlyitem}[1]{\sapling{\item {[\Sapling only\notbeforeblossom{, pre-\Blossom}]}\, {#1}}} \newcommand{\saplingonwarditem}[1]{\sapling{\item {[\Sapling onward]}\, {#1}}} \newcommand{\saplingandblossomitem}[1]{\sapling{\item \saplingandblossom{#1}}} \newcommand{\saplingprenufiveitem}[1]{\sapling{\item \saplingprenufive{#1}}} \newcommand{\preoverwinteritem}[1]{\item \preoverwinter{#1}} -\newcommand{\overwinteronlyitem}[1]{\overwinter{\item {[\Overwinter only, \sapling{pre-\Sapling}]}\, {#1}}} +\newcommand{\overwinteronlyitem}[1]{\overwinter{\item {[\Overwinter only, pre-\Sapling]}\, {#1}}} \newcommand{\overwinteronwarditem}[1]{\overwinter{\item {[\Overwinter onward]}\, {#1}}} \newcommand{\overwinterprenufiveitem}[1]{\overwinter{\item \overwinterprenufive{#1}}} \newcommand{\sproutspecificitem}[1]{\item \sproutspecific{#1}} \newcommand{\prenusix}[1]{\notbeforenusix{\nusix{[Pre-\NUSix\!]\,}} {#1}} +\newcommand{\nusixonly}[1]{\nusix{[\NUSix only]\, {#1}}} \newcommand{\nusixonward}[1]{\nusix{[\NUSix onward]\, {#1}}} \newcommand{\prenufive}[1]{\notbeforenufive{\nufive{[Pre-\NUFive\!]\,}} {#1}} +\newcommand{\nufiveonly}[1]{\nufive{[\NUFive only\notbeforenusix{, pre-\NUSix}]\, {#1}}} \newcommand{\nufiveonward}[1]{\nufive{[\NUFive onward]\, {#1}}} \newcommand{\precanopy}[1]{\notbeforecanopy{\canopy{[Pre-\Canopy\!]\,}} {#1}} +\newcommand{\canopyonly}[1]{\canopy{[\Canopy only\notbeforenufive{, pre-\NUFive}]\, {#1}}} \newcommand{\canopyonward}[1]{\canopy{[\Canopy onward]\, {#1}}} \newcommand{\preheartwood}[1]{\notbeforeheartwood{\heartwood{[Pre-\Heartwood\!]\,}} {#1}} \newcommand{\heartwoodonward}[1]{\heartwood{[\Heartwood onward]\, {#1}}} -\newcommand{\heartwoodandcanopy}[1]{\heartwood{[\Heartwood\notbeforecanopy{ and \Canopy}\nufive{ only, pre-\NUFive}]\, {#1}}} +\newcommand{\heartwoodonly}[1]{\heartwood{[\Heartwood only\notbeforecanopy{, pre-\Canopy}]\, {#1}}} +\newcommand{\heartwoodandcanopy}[1]{\heartwood{[\Heartwood\notbeforecanopy{ and \Canopy}\notbeforenufive{ only, pre-\NUFive}]\, {#1}}} \newcommand{\preblossom}[1]{\notbeforeblossom{\blossom{[Pre-\Blossom\!]\,}} {#1}} +\newcommand{\blossomonly}[1]{\blossom{[\Blossom only\notbeforeheartwood{, pre-\Heartwood}]\, {#1}}} \newcommand{\blossomonward}[1]{\blossom{[\Blossom onward]\, {#1}}} \newcommand{\presapling}[1]{\sapling{[Pre-\Sapling\!]\,} {#1}} +\newcommand{\saplingonly}[1]{\sapling{[\Sapling only\notbeforeblossom{, pre-\Blossom}]\, {#1}}} \newcommand{\saplingonward}[1]{\sapling{[\Sapling onward]\, {#1}}} -\newcommand{\saplingandblossom}[1]{\sapling{[\Sapling\notbeforeblossom{ and \Blossom}\heartwood{ only, pre-\Heartwood}]\, {#1}}} -\newcommand{\saplingprenufive}[1]{\sapling{[\Sapling \notnufive{onward}\notbeforenufive{ to \Canopy inclusive, \nufive{pre-\NUFive}}]\, {#1}}} +\newcommand{\saplingandblossom}[1]{\sapling{[\Sapling\notbeforeblossom{ and \Blossom}\notbeforeheartwood{ only, pre-\Heartwood}]\, {#1}}} +\newcommand{\saplingprenufive}[1]{\sapling{[\Sapling \notnufive{onward}\notbeforenufive{ to \Canopy inclusive, pre-\NUFive}]\, {#1}}} \newcommand{\preoverwinter}[1]{\overwinter{[Pre-\Overwinter\!]\,} {#1}} -\newcommand{\overwinteronly}[1]{\overwinter{[\Overwinter only, \sapling{pre-\Sapling}]\, {#1}}} +\newcommand{\overwinteronly}[1]{\overwinter{[\Overwinter only, pre-\Sapling]\, {#1}}} \newcommand{\overwinteronward}[1]{\overwinter{[\Overwinter onward]\, {#1}}} -\newcommand{\overwinterprenufive}[1]{\overwinter{[\Overwinter \notnufive{onward}\notbeforenufive{ to \Canopy inclusive, \nufive{pre-\NUFive}}]\, {#1}}} +\newcommand{\overwinterprenufive}[1]{\overwinter{[\Overwinter \notnufive{onward}\notbeforenufive{ to \Canopy inclusive, pre-\NUFive}]\, {#1}}} \newcommand{\sproutspecific}[1]{[\Sprout\!]\, {#1}} \newcommand{\securityrequirement}[1]{\needspace{4ex}\vspace{2ex}\callout{}{Security requirement:}{#1}} @@ -2526,7 +2566,7 @@ \newcommand{\preheartwoodpnote}[1]{\callout{\notbeforeheartwood{\heartwood{[Pre-\Heartwood\!]\,\,}}}{Note:}{#1}} \newcommand{\presaplingpnote}[1]{\callout{\sapling{[Pre-\ Sapling\!]\,\,}}{Note:}{#1}} \newcommand{\preoverwinterpnote}[1]{\callout{\overwinter{[Pre-\Overwinter\!]\,\,}}{Note:}{#1}} -\newcommand{\overwinteronlypnote}[1]{\callout{\overwinter{[\Overwinter only, \sapling{pre-\Sapling}]\,\,}}{Note:}{#1}} +\newcommand{\overwinteronlypnote}[1]{\callout{\overwinter{[\Overwinter only\sapling{, pre-\Sapling}]\,\,}}{Note:}{#1}} \newcommand{\overwinteronwardpnote}[1]{\callout{\overwinter{[\Overwinter onward]\,\,}}{Note:}{#1}} \newcommand{\sproutspecificpnote}[1]{\callout{[\Sprout\!]\,\,}{Note:}{#1}} @@ -2575,7 +2615,7 @@ codenamed \Overwinter, \Sapling, \Blossom, \Heartwood, \Canopy, and \NUFive; and proposed changes for \NUSix.} % It is a work in progress. Protocol differences from \Zerocash and \Bitcoin are also explained. -\vspace{2.5ex} +\vspace{2ex} \noindent \textbf{Keywords:}~ \StrSubstitute[0]{\keywords}{,}{, }. \ifxetex @@ -2590,6 +2630,7 @@ This document was built with Lua\TeX, which is \href{https://github.com/zcash/zips/issues/249}{not recommended}.} \fi +\vspace{-2ex} \end{abstract} \phantompart{Contents}{contents} @@ -2649,7 +2690,7 @@ The name \Sprout is used for the \Zcash protocol prior to \Sapling (both before and after \Overwinter), and in particular its shielded protocol. -\vspace{2ex} +\vspace{1ex} \introlist This specification is structured as follows: @@ -2672,6 +2713,7 @@ \end{itemize} +\vspace{-2ex} \lsubsection{Caution}{caution} \Zcash security depends on consensus. Should a program interacting with the @@ -2699,8 +2741,9 @@ \introsection All value in \Zcash belongs to some \defining{\chainValuePool}. There is a single -\defining{\transparent} \chainValuePool, and also a \chainValuePool for each -\defining{\shielded} protocol (\Sprout\sapling{ or \Sapling}\nufive{ or \Orchard}). +\defining{\transparent} \chainValuePool,\notnusix{ and also} a \chainValuePool for each +\defining{\shielded} protocol (\Sprout\sapling{ or \Sapling}\nufive{ or \Orchard})\nusix{, +and a \deferredChainValuePool}. Transfers of \transparent value work essentially as in \Bitcoin and have the same privacy properties. Value in a \shielded \chainValuePool is carried by \notes\footnotewithlabel{notesandnullifiers}{In @@ -3332,8 +3375,8 @@ \xTreestates are described in \crossref{transactions}, and \noteCommitmentTrees are described in \crossref{notecommitmenttrees}. -\vspace{2ex} \introlist +\vspace{1.5ex} A \Sprout{} \defining{\noteCommitment} on a \note $\NoteTuple{} = (\AuthPublic, \Value, \NoteUniqueRand, \NoteCommitRand)$ is computed as @@ -3346,8 +3389,8 @@ where $\NoteCommit{Sprout}{}$ is instantiated in \crossref{concretesproutnotecommit}. \sapling{ -\vspace{2ex} \introlist +\vspace{1.5ex} A \Sapling{} \defining{\noteCommitment} on a \note $\NoteTuple{} = (\Diversifier, \DiversifiedTransmitPublic, \Value, \NoteCommitRand)$ is computed as @@ -3379,8 +3422,8 @@ } %sapling \nufive{ -\vspace{2ex} \introlist +\vspace{1.5ex} An \Orchard{} \defining{\noteCommitment} on a \note $\NoteTuple{} = (\Diversifier, \DiversifiedTransmitPublic, \Value, \NoteUniqueRand, \NoteNullifierRand, \NoteCommitRand)$ is computed as @@ -3397,6 +3440,7 @@ \vspace{-2.5ex} where $\NoteCommitAlg{Orchard}$ is instantiated in \crossref{concretesinsemillacommit}. +\introlist If $\NoteCommitAlg{Orchard}$ returns $\bot$ (which happens with insignificant probability), the \note is invalid and should be recreated with a different $\NoteSeedBytes$. @@ -6255,41 +6299,35 @@ identifiers, and \MAY be used for that reason whether or not \actionTransfers are present. } %nufive -\preoverwinter{The \sighashAlgorithm used prior to \Overwinter activation, i.e.\ for -version 1 and 2 \transactions, will be defined in \cite{ZIP-76} (to be written).} - -\overwinteronly{The \sighashAlgorithm used after \Overwinter activation and before \Sapling -activation, i.e.\ for version 3 \transactions, is defined in \cite{ZIP-143}.} - -\saplingonward{The \sighashAlgorithm used after \Sapling activation, i.e.\ for -version 4 \transactions, is defined in \cite{ZIP-243}.} - -\blossomonward{The \sighashAlgorithm used after \Blossom activation is the same as -for \Sapling, but using the \Blossom \consensusBranchID \hexint{2BB40E60} as defined in -\cite{ZIP-206}.} - -\heartwoodonward{The \sighashAlgorithm used after \Heartwood activation is the same as -for \Sapling, but using the \Heartwood \consensusBranchID \hexint{F5B9230B} as defined in -\cite{ZIP-250}.} - -\canopyonward{The \sighashAlgorithm used after \Canopy activation is the same as -for \Sapling, but using the \Canopy \consensusBranchID \hexint{E9FF75A6} as defined in -\cite{ZIP-251}.} - -\nufiveonward{The \sighashAlgorithm used for version 5 \transactions introduced by the -\NUFive \networkUpgrade is defined in \cite{ZIP-244}. Version 4 \transactions continue -to use the \sighashAlgorithm defined in \cite{ZIP-243}. After \NUFive activation, both -\transaction versions use the \NUFive \consensusBranchID \hexint{F919A198} as defined in -\cite{ZIP-252}.} - -\nufive{ -\consensusrule{ -\nufiveonward{Any \sighashType encoding used in a version 5 \transaction \MUST be the -canonical encoding of one of the defined \sighashTypes, i.e.\ one of \hexint{01}, -\hexint{02}, \hexint{03}, \hexint{81}, \hexint{82}, or \hexint{83}. (Previously, -undefined bits of a \sighashType encoding were ignored.)} -} %consensusrule -} %nufive +\begin{consensusrules} + \nufiveonwarditem{Any \sighashType encoding used in a version 5 \transaction \MUST be the + canonical encoding of one of the defined \sighashTypes, i.e.\ one of \hexint{01}, + \hexint{02}, \hexint{03}, \hexint{81}, \hexint{82}, or \hexint{83}. (Previously, + undefined bits of a \sighashType encoding were ignored.)} + \preoverwinteritem{The \sighashAlgorithm used prior to \Overwinter activation, i.e.\ for + version 1 and 2 \transactions, will be defined in \cite{ZIP-76} (to be written).} + \overwinteronlyitem{The \sighashAlgorithm used after \Overwinter activation and before + \Sapling activation, i.e.\ for version 3 \transactions, is defined in \cite{ZIP-143}.} + \overwinteronlyitem{All \transactions \MUST use the \Overwinter \consensusBranchID \hexint{5BA81B19} + as defined in \cite{ZIP-201}.} + \saplingonwarditem{The \sighashAlgorithm used after \Sapling activation, i.e.\ for + version 4 \transactions, is defined in \cite{ZIP-243}.} + \saplingonlyitem{All \transactions \MUST use the \Sapling \consensusBranchID \hexint{76B809BB} + as defined in \cite{ZIP-205}.} + \blossomonlyitem{All \transactions \MUST use the \Blossom \consensusBranchID \hexint{2BB40E60} + as defined in \cite{ZIP-206}.} + \heartwoodonlyitem{All \transactions \MUST use the \Heartwood \consensusBranchID \hexint{F5B9230B} + as defined in \cite{ZIP-250}.} + \canopyonlyitem{All \transactions \MUST use the \Canopy \consensusBranchID \hexint{E9FF75A6} + as defined in \cite{ZIP-251}.} + \nufiveonwarditem{The \sighashAlgorithm used for version 5 \transactions introduced by the + \NUFive \networkUpgrade is defined in \cite{ZIP-244}. Version 4 \transactions continue + to use the \sighashAlgorithm defined in \cite{ZIP-243}.} + \nufiveonlyitem{All \transactions \MUST use the \NUFive \consensusBranchID \hexint{F919A198} + as defined in \cite{ZIP-252}.} + \nusixonlyitem{All \transactions \MUST use the \NUSix \consensusBranchID \hexint{C8E71055} + as defined in \cite{ZIP-253}.} +\end{consensusrules} \introsection @@ -6329,7 +6367,6 @@ \introlist \lsubsection{Balance (\SproutText)}{joinsplitbalance} -\vspace{-1ex} In \Bitcoin, all inputs to and outputs from a \transaction are transparent. The total value of \transparentOutputs must not exceed the total value of \transparentInputs. The net value of \transparentInputs minus \transparentOutputs @@ -6344,14 +6381,6 @@ the \transparentTxValuePool. As a result, $\vpubOld$ is treated like an \emph{output} value, whereas $\vpubNew$ is treated like an \emph{input} value. -As defined in \cite{ZIP-209}, the \defining{\SproutChainValuePoolBalance} for a given -\blockChain is the sum of all $\vpubOld$ field values for \transactions in the \blockChain, -minus the sum of all $\vpubNew$ fields values for transactions in the \blockChain. - -\vspace{-2ex} -\consensusrule{If the \SproutChainValuePoolBalance would become negative in the \blockChain -created as a result of accepting a \block, then all nodes \MUST reject the block as invalid.} - \vspace{1ex} Unlike original \Zerocash \cite{BCGGMTV2014}, \Zcash does not have a distinction between Mint and Pour operations. The addition of $\vpubOld$ to a @@ -6369,11 +6398,9 @@ \sapling{ -\introsection -\vspace{-2ex} +\introlist \extralabel{bindingsig}{\lsubsection{Balance and Binding Signature (\SaplingText)}{saplingbalance}} -\vspace{-1ex} \Sapling adds \spendTransfers and \outputTransfers to the transparent and \joinSplitTransfers present in \Sprout. The net value of \spendTransfers minus \outputTransfers in a \transaction is @@ -6394,14 +6421,6 @@ \transparentTxValuePool, whereas negative $\vBalance{Sapling}$ is treated like an \emph{output} from that pool. -As defined in \cite{ZIP-209}, the \defining{\SaplingChainValuePoolBalance} for a given -\blockChain is the negation of the sum of all $\valueBalance{Sapling}$ field values for -\transactions in the \blockChain. - -\vspace{-2ex} -\consensusrule{If the \SaplingChainValuePoolBalance would become negative in the \blockChain -created as a result of accepting a \block, then all nodes \MUST reject the block as invalid.} - \vspace{1ex} \introlist Consistency of $\vBalance{Sapling}$ with the \valueCommitments in \spendDescriptions @@ -6543,7 +6562,7 @@ The $\spendStatements$ (\crossref{spendstatement}) prove that all of $\vOld{\alln}$ are in $\ValueType$. Similarly the $\outputStatements$ (\crossref{outputstatement}) -prove that all of $\vNew{\allm}$ are in $\ValueType$. +prove all of $\vNew{\allm}$ are in $\ValueType$. $\vBalance{Sapling}$ is encoded in the \transaction as a signed two's complement $64$-bit integer in the range $\SignedValueFieldType$. $\ValueLength$ is defined as 64, so $\vSum$ is in the range $\range{-m \mult (2^{64}-1) - 2^{63} + 1}{n \mult (2^{64}-1) + 2^{63}}$. @@ -6603,15 +6622,6 @@ \transparentTxValuePool, whereas negative $\vBalance{Orchard}$ is treated like an \emph{output} from that pool. -Similarly to the \SaplingChainValuePoolBalance defined in \cite{ZIP-209}, the -\defining{\OrchardChainValuePoolBalance} for a given \blockChain is the negation of the -sum of all $\valueBalance{Orchard}$ field values for \transactions in the \blockChain. - -\vspace{-1ex} -\consensusrule{If the \OrchardChainValuePoolBalance would become negative in the \blockChain -created as a result of accepting a \block, then all nodes \MUST reject the block as invalid.} - -\introlist \vspace{2ex} Consistency of $\vBalance{Orchard}$ with the \valueCommitments in \actionDescriptions is enforced by the \defining{\orchardBindingSignature}. The rôle of this signature in the @@ -6806,7 +6816,7 @@ Let $\SpendAuthSig{}$ be $\SpendAuthSig{Sapling}$\nufive{ or $\SpendAuthSig{Orchard}$ as applicable}. } %notbeforenufive -\introlist +\introsection \vspace{1ex} For each \spendDescription\nufive{ or \actionDescription}, the signer chooses a fresh \defining{\spendAuthRandomizer} $\AuthSignRandomizer$: @@ -6930,6 +6940,83 @@ \end{itemize} } %securityrequirement + +\vspace{-2ex} +\introsection +\lsubsection{Chain Value Pool Balances}{chainvaluepoolbalances} + +The \defining{\TransparentChainValuePoolBalance} for a given \blockChain is the sum of +the values of all \utxos in the \utxoSetFull for that chain. +It is denoted by $\ChainValuePoolBalance{Transparent}(\BlockHeight)$. + +\vspace{1.5ex} +As defined in \cite{ZIP-209}, the \defining{\SproutChainValuePoolBalance} for a given +\blockChain is the sum of all $\vpubOld$ field values for \transactions in the \blockChain, +minus the sum of all $\vpubNew$ field values for transactions in the \blockChain. +It is denoted by $\ChainValuePoolBalance{Sprout}(\BlockHeight)$. + +\vspace{-2ex} +\consensusrule{If the \SproutChainValuePoolBalance would become negative in the \blockChain +created as a result of accepting a \block, then all nodes \MUST reject the block as invalid.} + +\sapling{ +\vspace{1.5ex} +As defined in \cite{ZIP-209}, the \defining{\SaplingChainValuePoolBalance} for a given +\blockChain is the negation of the sum of all $\valueBalance{Sapling}$ values for +\transactions in the \blockChain. +It is denoted by $\ChainValuePoolBalance{Sapling}(\BlockHeight)$. + +\vspace{-2ex} +\consensusrule{If the \SaplingChainValuePoolBalance would become negative in the \blockChain +created as a result of accepting a \block, then all nodes \MUST reject the block as invalid.} +} %sapling + +\nufive{ +\vspace{1.5ex} +Similarly to the \SaplingChainValuePoolBalance defined in \cite{ZIP-209}, the +\defining{\OrchardChainValuePoolBalance} for a given \blockChain is the negation of the +sum of all $\valueBalance{Orchard}$ field values for \transactions in the \blockChain. +It is denoted by $\ChainValuePoolBalance{Orchard}(\BlockHeight)$. + +\vspace{-2ex} +\consensusrule{If the \OrchardChainValuePoolBalance would become negative in the \blockChain +created as a result of accepting a \block, then all nodes \MUST reject the block as invalid.} +} %nufive + +\nusix{ +\vspace{1.5ex} +Define $\totalDeferredOutput$ as in \crossref{subsidies}. + +Then, consistent with \cite{ZIP-207}, the \defining{\DeferredChainValuePoolBalance} +for a \blockChain up to and including height $\BlockHeight$ is given by +$\ChainValuePoolBalance{Deferred}(\BlockHeight) := \sum_{\mathsf{h} = 0}^{\BlockHeight} \totalDeferredOutput(\mathsf{h})$. + +\begin{nnotes} + \item $\totalDeferredOutput(\mathsf{h})$ is necessarily zero for heights $\mathsf{h}$ + prior to \NUSix activation. + \item Currently there is no way to withdraw from the \deferredChainValuePool, so + there is no possibility of it going negative. Therefore, no consensus rule to + prevent that eventuality is needed at this time. +\end{nnotes} +} %nusix + +\vspace{1ex} +The \defining{\totalIssuedSupply} of a \blockChain at \blockHeight $\BlockHeight$ is given +by the function: +$$ +\begin{array}{rl} + \IssuedSupply(\BlockHeight) \; := &\!\!\! \ChainValuePoolBalance{Transparent}(\BlockHeight) \\ + & +\,\; \ChainValuePoolBalance{Sprout}(\BlockHeight) \\ + & \sapling{+\,\; \ChainValuePoolBalance{Sapling}(\BlockHeight)} \\ +\notbeforenufive{ + & \nufive{+\,\; \ChainValuePoolBalance{Orchard}(\BlockHeight)} \\ +} +\notbeforenusix{ + & \nusix{+\,\; \ChainValuePoolBalance{Deferred}(\BlockHeight)} +} +\end{array} +$$ + \pagebreak \lsubsection{Zk-SNARK Statements}{snarkstatements} @@ -7942,7 +8029,7 @@ \vspace{-3ex} \nnote{Implementors should pay close attention to similarities and differences between this procedure -and \crossref{decryptivk}\notcanopy{.}\canopy{, especially:\!\! +and \crossref{decryptivk}\notcanopy{.}\canopy{, especially that: \begin{itemize} \item in this procedure, the ephemeral \privateKey $\EphemeralPrivate'$ derived from $\NoteSeedBytes$ is checked to be identical to that obtained from $\OutPlaintext$ (when $\NotePlaintextLeadByte \neq \hexint{01}$); @@ -11761,11 +11848,11 @@ \lsubsubsubsection{Transparent Addresses}{transparentaddrencoding} -\defining{\xTransparentAddresses} are either P2SH (Pay to Script Hash) addresses \cite{BIP-13} -or P2PKH (Pay to Public Key Hash) addresses \cite{Bitcoin-P2PKH}. +\defining{\xTransparentAddresses} are either \defining{\PtoSH (Pay to Script Hash)} addresses \cite{BIP-13} +or \defining{\PtoPKH (Pay to Public Key Hash)} addresses \cite{Bitcoin-P2PKH}. \introlist -The \rawEncoding of a P2SH address consists of: +\defining{The \rawEncoding of a \PtoSHAddress} consists of: \vspace{1ex} \begin{equation*} \begin{bytefield}[bitwidth=0.1em]{176} @@ -11777,7 +11864,7 @@ \begin{itemize} \item Two bytes $[\PtoSHAddressLeadByte, \PtoSHAddressSecondByte]$, - indicating this version of the \rawEncoding of a P2SH address + indicating this version of the \rawEncoding of a \PtoSHAddress on \Mainnet. (Addresses on \Testnet use $[\PtoSHAddressTestnetLeadByte, \PtoSHAddressTestnetSecondByte]$ instead.) @@ -11785,7 +11872,7 @@ \end{itemize} \introlist -The \rawEncoding of a P2PKH address consists of: +\defining{The \rawEncoding of a \PtoPKHAddress} consists of: \vspace{1ex} \begin{equation*} \begin{bytefield}[bitwidth=0.1em]{176} @@ -11797,7 +11884,7 @@ \begin{itemize} \item Two bytes $[\PtoPKHAddressLeadByte, \PtoPKHAddressSecondByte]$, - indicating this version of the \rawEncoding of a P2PKH address + indicating this version of the \rawEncoding of a \PtoPKHAddress on \Mainnet. (Addresses on \Testnet use $[\PtoPKHAddressTestnetLeadByte, \PtoPKHAddressTestnetSecondByte]$ instead.) @@ -11812,7 +11899,7 @@ the address type. In \Zcash two bytes are used. For addresses on \Mainnet, this and the encoded length cause the first two characters of the \BaseFiftyEightCheck encoding to be fixed as \ascii{t3} - for P2SH addresses, and as \ascii{t1} for P2PKH addresses. (This does + for \PtoSHAddresses, and as \ascii{t1} for \PtoPKHAddresses. (This does \emph{not} imply that a \transparent \Zcash address can be parsed identically to a \Bitcoin address just by removing the \ascii{t}.) \item \Zcash does not yet support Hierarchical Deterministic Wallet @@ -12148,12 +12235,12 @@ \begin{itemize} \item typecode $\hexint{03}$ -- \crossref{orchardpaymentaddrencoding}; \item typecode $\hexint{02}$ -- \crossref{saplingpaymentaddrencoding}; - \item typecode $\hexint{01}$ -- \transparent P2SH address, \emph{or} typecode $\hexint{00}$ -- \transparent P2PKH address. + \item typecode $\hexint{01}$ -- \transparentPtoSHAddress, \emph{or} typecode $\hexint{00}$ -- \transparentPtoPKHAddress. \end{itemize} \vspace{-2ex} with the restrictions that there \MUST be at least one \shieldedPaymentAddress (typecodes $\geq \hexint{02})$, -and that both P2SH and P2PKH cannot be present. +and that both \PtoSH and \PtoPKH cannot be present. When sending a payment, the consumer of a \unifiedPaymentAddress \MUST use the most preferred address type that it supports from the set, i.e.\ the first in the above list. See \cite{ZIP-316} for additional @@ -12432,7 +12519,8 @@ \canopy{A fifth upgrade, called \defining{\Canopy}, activated on \Mainnet on 18~November, 2020 at \blockHeight $1046400$ (coinciding with the first \blockSubsidy \halving) \cite{Zcash-Canopy}. Its specifications are described in this document, -\cite{ZIP-251}, \cite{ZIP-207}, \cite{ZIP-211}, \cite{ZIP-212}, \cite{ZIP-214}, and \cite{ZIP-215}.} +\cite{ZIP-251}, \cite{ZIP-207}, \cite{ZIP-211}, \cite{ZIP-212}, \cite{ZIP-214}, and \cite{ZIP-215}. +Additional information and rationale is given in \cite{ZIP-1014}.} \nufive{A sixth upgrade, called \defining{\NUFive}, activated on \Mainnet on 31~May, 2022 at \blockHeight $1687104$ \cite{Zcash-Nu5}. Its specifications are described in this document, @@ -12442,12 +12530,14 @@ Additional information and rationale is given in \cite{Zcash-Orchard} and \cite{Zcash-halo2}.} \nusix{ -This draft specification describes the set of changes proposed for the \NUSix \networkUpgrade -(for which a \Mainnet activation height has not yet been set). -} %nusix +This draft specification describes the set of changes proposed for the \NUSix \networkUpgrade, +for which the \Mainnet activation \blockHeight has been set at $2726400$. Its specifications are +described in this document, \cite{ZIP-253}, \cite{ZIP-236}, and \cite{ZIP-2001}, with updates to +\cite{ZIP-207} and \cite{ZIP-214}. +Additional information and rationale is given in \cite{ZIP-1015}.} \introlist -\vspace{1ex} +\vspace{2ex} This section summarizes the strategy for upgrading from \Sprout to subsequent versions of the protocol (\Overwinter, \Sapling, \Blossom, \Heartwood, \Canopy, \NUFive, and \NUSix), and for future upgrades. @@ -12805,9 +12895,19 @@ of the signature prohibits \nonCanonicalPoint encodings. \end{itemize}} \vspace{-1ex} - \item The total value in \zatoshi of \transparentOutputs from a \coinbaseTransaction\heartwood{, minus - $\vBalance{Sapling}$,}\nufive{ minus $\vBalance{Orchard}$,} \MUSTNOT be greater than the value in - \zatoshi of \blockSubsidy plus the \transactionFees paid by \transactions in this \block. + \item \nusix{Let $\totalDeferredOutput$ be as defined in \shortcrossref{subsidies}.} + For the \block at \blockHeight $\mathsf{height}$: + \begin{itemize} + \item define the \totalOutputValue of its \coinbaseTransaction to be the total value + in \zatoshi of its \transparentOutputs\heartwood{, minus $\vBalance{Sapling}$}\nufive{, + minus $\vBalance{Orchard}$}\nusix{, plus $\totalDeferredOutput(\mathsf{height})$}; + \item define the \totalInputValue of its \coinbaseTransaction to be the value in \zatoshi + of the \blockSubsidy, plus the \transactionFees paid by \transactions in the \block. + \end{itemize} + \vspace{-1ex} + \prenusix{The \totalOutputValue of a \coinbaseTransaction \MUSTNOT be greater than its \totalInputValue.} + + \nusixonward{The \totalOutputValue of a \coinbaseTransaction \MUST be equal to its \totalInputValue.} \item A \coinbaseTransaction \MUSTNOT have any \joinSplitDescriptions. \item \sapling{A \coinbaseTransaction \MUSTNOT have any \spendDescriptions.} \preheartwooditem{\sapling{A \coinbaseTransaction \MUSTNOT have any \outputDescriptions.}} @@ -13381,6 +13481,10 @@ \item For \NUFive, the $\hashLightClientRoot$ field is renamed to $\hashBlockCommitments$. Once \NUFive activates, the meaning of this field changes according to \cite{ZIP-244}. } %nufive +\nusix{ + \vspace{-0.5ex} + \item There are no changes to the \blockVersionNumber or format for \NUSix. +} %nusix \end{pnotes} \introlist @@ -13390,8 +13494,8 @@ \vspace{-0.5ex} \item \Blockversions less than $4$ are not supported. \vspace{-0.5ex} - \item The $\hashReserved$\sapling{ (or $\hashFinalSaplingRoot$)}, $\solutionSize$, and - $\solution$ fields have been added. + \item The $\hashReserved$\sapling{ / $\hashFinalSaplingRoot$}\heartwood{ / $\hashLightClientRoot$}\nufive{ / $\hashBlockCommitments$}, + $\solutionSize$, and $\solution$ fields have been added. \vspace{-0.5ex} \item The type of the $\nNonce$ field has changed from \type{uint32} to \type{byte[32]}. \vspace{-0.5ex} @@ -13632,10 +13736,12 @@ \item $\ThresholdBits(\BlockHeight \typecolon \Nat) := \ToCompact(\Threshold(\BlockHeight))$. \end{formulae} +\vspace{-2ex} \begin{pnotes} \item The convention used for the height parameters to the functions $\MedianTime$, $\MeanTarget$, $\ActualTimespan$, $\ActualTimespanDamped$, $\ActualTimespanBounded$, $\Threshold$, and $\ThresholdBits$ is that these functions use only information from \blocks \emph{preceding} the given \blockHeight. + \introlist \item When the $\median$ function is applied to a sequence of even length (which only happens in the definition of $\MedianTime$ during the first $\PoWAveragingWindow - 1$ \blocks of the \blockChain), the element that begins the second half of the sequence is taken. @@ -13651,11 +13757,14 @@ \introlist +\vspace{-0.5ex} \lsubsubsection{nBits conversion}{nbits} +\vspace{-0.5ex} Deterministic conversions between a \defining{\targetThreshold} and a ``compact" nBits value are not fully defined in the Bitcoin documentation \cite{Bitcoin-nBits}, and so we define them here: +\introlist \begin{formulae}[leftmargin=1.5em,label=] \item $\size(x) := \ceiling{\hfrac{\bitlength(x)}{8}}$ \item $\mantissa(x) := \floor{x \mult 256^{3 - \size(x)}}$ @@ -13673,6 +13782,7 @@ \vspace{-2ex} \lsubsubsection{Definition of Work}{workdef} +\vspace{-0.5ex} As explained in \crossref{blockchain}, a node chooses the ``best'' \blockChain visible to it by finding the chain of valid \blocks with the greatest total work. @@ -13683,11 +13793,12 @@ \introlist -\vspace{-2ex} +\vspace{-1.5ex} \lsubsection{Calculation of Block Subsidy\notbeforecanopy{, Funding Streams,} and Founders' Reward}{subsidies} -\crossref{subsidyconcepts} defines the \blockSubsidy, \minerSubsidy,\notcanopy{ and} \foundersReward\canopy{, and \fundingStreams}. -Their amounts in \zatoshi are calculated from the \blockHeight using +\vspace{-0.5ex} +In \crossref{subsidyconcepts} the \blockSubsidy, \minerSubsidy,\notcanopy{ and} \foundersReward\canopy{, +and \fundingStreams} are defined. Their amounts in \zatoshi are calculated from the \blockHeight using the formulae below. Let\notbeforeblossom{ the constants} $\SlowStartInterval$,\, $\PreBlossomHalvingInterval$,\, @@ -13742,6 +13853,11 @@ \end{cases}$ } %canopy +\nusix{ + \vspace{1ex} + \item $\totalDeferredOutput(\BlockHeight) := \ssum{\fs\, \in\, \FundingStreams \;:\; \fsRecipient(\BlockHeight) \;=\; \DeferredPool}{} \fsValue(\BlockHeight)$ +} %nusix + \item $\MinerSubsidy(\BlockHeight) := \BlockSubsidy(\BlockHeight) - \FoundersReward(\BlockHeight) \canopy{\,- \ssum{\fs\, \in\, \FundingStreams}{} \fsValue(\BlockHeight)}$. \end{formulae} @@ -13829,8 +13945,7 @@ } \vspace{1ex} -Each address representation in $\FounderAddressList$ denotes a \transparent -P2SH multisig address. +Each address representation in $\FounderAddressList$ denotes a \transparentPtoSHMultisigAddress. \introlist Let $\SlowStartShift$ and $\Halving$ be defined as in the previous section. @@ -13853,15 +13968,15 @@ \blossom{\maximum\Of{\setof{\BlockHeight \typecolon \Nat \suchthat \Halving(\BlockHeight) < 1}}}$\,. \end{formulae} -Let $\FounderRedeemScriptHash(\BlockHeight \typecolon \Nat)$ be the standard redeem script hash, as specified in -\cite{Bitcoin-Multisig}, for the P2SH multisig address with \BaseFiftyEightCheck form +Let $\FounderRedeemScriptHash(\BlockHeight \typecolon \Nat)$ be the \standardRedeemScript hash, as +specified in \cite{Bitcoin-Multisig}, for the \PtoSHMultisigAddress with \BaseFiftyEightCheck form given by $\FounderAddressList_{\,\FounderAddressIndex(\BlockHeight)}$. \vspace{-1.5ex} \consensusrule{\precanopy{ A \coinbaseTransaction at $\BlockHeight \in \range{1}{\FoundersRewardLastBlockHeight}$ \MUST include at least one output that pays exactly $\FoundersReward(\BlockHeight)$ \zatoshi -with a standard P2SH script of the form \ScriptOP{HASH160} \;$\FounderRedeemScriptHash(\BlockHeight)$\; \ScriptOP{EQUAL} +with a \standardPtoSHScript of the form $\ScriptOP{HASH160} \;\FounderRedeemScriptHash(\BlockHeight)\; \ScriptOP{EQUAL}$ as its $\scriptPubKey$. }} @@ -13898,15 +14013,23 @@ \vspace{-2ex} \lsubsection{Payment of Funding Streams}{fundingstreams} -\vspace{-1ex} -The \defining{\fundingStreams} are paid by outputs in the \coinbaseTransaction, to one of a pre-defined -set of addresses, depending on the \blockHeight. +\vspace{-0.5ex} +Let $\PostBlossomHalvingInterval$ be as defined in \crossref{constants}. + +Let $\Halving$ be as defined in \crossref{subsidies}. + +\vspace{1ex} +The \defining{\fundingStreams} are paid to one of a pre-defined set of recipients, depending +on the \blockHeight. Each recipient identifier is either the string encoding of an address +to be paid by an output in the \coinbaseTransaction\nusix{, or the identifier $\DeferredPool$}. +\nusix{The latter indicates that the value is to be paid to a reserve to be used for development +funding, the distribution of which is to be determined via a future ZIP.} +\introlist A \fundingStream $\fs$ is defined by a \blockSubsidy fraction (represented as a numerator and denominator), a start \blockHeight (inclusive), an end \blockHeight (exclusive), and a sequence -of address representations: +of recipients: -\introlist \begin{formulae} \item $\fsNumerator \typecolon \PosInt$ \vspace{-0.25ex} @@ -13915,58 +14038,65 @@ \item $\fsStartHeight \typecolon \Nat$ \item $\fsEndHeight \typecolon \Nat$ \vspace{-1ex} - \item $\fsAddressList \typecolon \typeexp{\byteseqs}{\PosInt}$. + \item $\fsRecipients \typecolon \typeexp{\big(\byteseqs\nusix{ \,\union\, \setof{\DeferredPool}}\big)}{\PosInt}$. \end{formulae} +\introlist Define: \begin{formulae} \item $\HeightForHalving(\HalvingNum \typecolon \PosInt) := \minimum\Of{\setof{\BlockHeight \typecolon \Nat \suchthat \Halving(\BlockHeight) = \HalvingNum}}$ - \item $\FundingStreamAddressChangeInterval := \PostBlossomHalvingInterval / 48$ - \item $\FundingStreamAddressPeriod(\BlockHeight) := - \floor{\hfrac{\BlockHeight - (\HeightForHalving(1) - \PostBlossomHalvingInterval)}{\FundingStreamAddressChangeInterval}}$. + \item $\FSRecipientChangeInterval := \PostBlossomHalvingInterval / 48$ + \item $\FSRecipientPeriod(\BlockHeight) := + \floor{\hfrac{\BlockHeight - (\HeightForHalving(1) - \PostBlossomHalvingInterval)}{\FSRecipientChangeInterval}}$. \end{formulae} +\introlist For each \fundingStream $\fs$, define: \begin{formulae} - \item $\fsAddressIndex(\BlockHeight) := 1 + \FundingStreamAddressPeriod(\BlockHeight) - \FundingStreamAddressPeriod(\fsStartHeight)$ - \item $\fsNumAddresses := \fsAddressIndex(\fsEndHeight - 1)$. + \item $\fsRecipientIndex(\BlockHeight) := 1 + \FSRecipientPeriod(\BlockHeight) - \FSRecipientPeriod(\fsStartHeight)$ + \item $\fsRecipient(\BlockHeight) := \fsRecipients_{\,\fsRecipientIndex(\BlockHeight)}$ + \item $\fsNumRecipients := \fsRecipientIndex(\fsEndHeight - 1)$. \end{formulae} -$\fsAddressList$ \MUST be of length $\fsNumAddresses$. Each element of $\fsAddressList$ -\MUST represent either a \transparent P2SH address as specified in \crossref{transparentaddrencoding}, -or a \Sapling \shieldedPaymentAddress as specified in \crossref{saplingpaymentaddrencoding}. +$\fsRecipients$ \MUST be of length $\fsNumRecipients$. Each element of $\fsRecipients$ +\MUST represent either a \transparentPtoSHAddress as specified in \crossref{transparentaddrencoding}, +or a \Sapling \shieldedPaymentAddress as specified in \crossref{saplingpaymentaddrencoding}\nusix{, +or the identifier $\DeferredPool$}. Recall from \crossref{subsidies} the definition of $\fsValue$. A \fundingStream $\fs$ is ``active'' at \blockHeight $\BlockHeight$ when $\fsValue(\BlockHeight) > 0$. \introlist \consensusrule{ -\canopyonward{ -The \coinbaseTransaction at \blockHeight $\BlockHeight$ \MUST contain at least -one output per \fundingStream $\fs$ active at $\BlockHeight$, that pays -$\fsValue(\BlockHeight)$ \zatoshi in the prescribed way to the stream's -recipient address represented by $\fsAddressList_{\fsAddressIndex(\BlockHeight)}$. +\canopyonward{In each \block with \coinbaseTransaction $\cb$ at \blockHeight $\BlockHeight$, +for each \fundingStream $\fs$ active at that \blockHeight with a recipient identifier\nusix{ other than $\DeferredPool$} +given by $\fsRecipient(\BlockHeight)$, $\cb$ \MUST contain at least one output that pays +$\fsValue(\BlockHeight)$ \zatoshi in the \prescribedWay to the address represented by that +recipient identifier. \vspace{1ex} \begin{itemize} - \item The ``prescribed way'' to pay a \transparent P2SH address is to use a standard - P2SH script of the form \ScriptOP{HASH160} \;$\fsRedeemScriptHash(\BlockHeight)$\; \ScriptOP{EQUAL} - as the $\scriptPubKey$. Here $\fsRedeemScriptHash(\BlockHeight)$ is the standard - redeem script hash for the recipient address given by - $\fsAddressList_{\,\fsAddressIndex(\BlockHeight)}$ in \BaseFiftyEightCheck form. The - standard redeem script hash is specified in \cite{Bitcoin-Multisig} for - P2SH multisig addresses, or \cite{Bitcoin-P2SH} for other P2SH addresses. + \item The \defining{\prescribedWay} to pay a \transparentPtoSHAddress is to use a + \defining{\standardPtoSHScript} of the form + $\ScriptOP{HASH160}$ $\fsRedeemScriptHash(\BlockHeight)\; \ScriptOP{EQUAL}$ + as the $\scriptPubKey$. Here $\fsRedeemScriptHash(\BlockHeight)$ is the + \standardRedeemScript hash for the recipient address for + $\fsRecipient(\BlockHeight)$ in \BaseFiftyEightCheck form. + + \defining{\xStandardRedeemScript} hashes are defined in \cite{Bitcoin-Multisig} for + \PtoSHMultisigAddresses, or \cite{Bitcoin-P2SH} for other \PtoSHAddresses. \vspace{1ex} - \item The ``prescribed way" to pay a \Sapling address is as defined in \cite{ZIP-213}, - using the post-\Heartwood consensus rules specified for \Sapling outputs of - \coinbaseTransactions in \crossref{txnconsensus}. + \item The \defining{\prescribedWay} to pay a \Sapling \paymentAddress is defined in + \cite{ZIP-213}, using the post-\Heartwood consensus rules specified for \Sapling + outputs of \coinbaseTransactions in \crossref{txnconsensus}. \end{itemize} } %canopyonward } %consensusrule +\vspace{-3ex} \begin{pnotes} \item The \fundingStream addresses are not treated specially in any other way, and there can be other outputs to them, in \coinbaseTransactions or otherwise. @@ -13980,7 +14110,7 @@ Let $\CanopyActivationHeight$ be as defined in \crossref{constants}. \vspace{1ex} -\cite{ZIP-214} defines these \fundingStreams for \Mainnet: +\cite{ZIP-214} Revision 0 defines these \fundingStreams for \Mainnet: \renewcommand{\arraystretch}{1} @@ -13988,9 +14118,9 @@ \item \begin{tabular}{|l|c|c|c|c|} \hline Stream & Numerator & Denominator & Start height & End height \\\hline\raisedstrut -\texttt{FS\_ZIP214\_ECC} & $7$ & $100$ & $1046400$ & $2726400$ \\ -\texttt{FS\_ZIP214\_ZF} & $5$ & $100$ & $1046400$ & $2726400$ \\ -\texttt{FS\_ZIP214\_MG} & $8$ & $100$ & $1046400$ & $2726400$ \\\hline +\texttt{FS\_ZIP214\_BP} & $7$ & $100$ & $1046400$ & $2726400$ \\ +\texttt{FS\_ZIP214\_ZF} & $5$ & $100$ & $1046400$ & $2726400$ \\ +\texttt{FS\_ZIP214\_MG} & $8$ & $100$ & $1046400$ & $2726400$ \\\hline \end{tabular} \end{formulae} @@ -14000,9 +14130,9 @@ \item \begin{tabular}{|l|c|c|c|c|} \hline Stream & Numerator & Denominator & Start height & End height \\\hline\raisedstrut -\texttt{FS\_ZIP214\_ECC} & $7$ & $100$ & $1028500$ & $2796000$ \\ -\texttt{FS\_ZIP214\_ZF} & $5$ & $100$ & $1028500$ & $2796000$ \\ -\texttt{FS\_ZIP214\_MG} & $8$ & $100$ & $1028500$ & $2796000$ \\\hline +\texttt{FS\_ZIP214\_BP} & $7$ & $100$ & $1028500$ & $2796000$ \\ +\texttt{FS\_ZIP214\_ZF} & $5$ & $100$ & $1028500$ & $2796000$ \\ +\texttt{FS\_ZIP214\_MG} & $8$ & $100$ & $1028500$ & $2796000$ \\\hline \end{tabular} \end{formulae} @@ -14020,6 +14150,37 @@ \end{pnotes} } %canopy +\nusix{ +\vspace{1ex} +\introlist +\nusixonward{\cite{ZIP-214} Revision 1 defines these \fundingStreams for \Mainnet:} + +\begin{formulae} +\item \begin{tabular}{|l|c|c|c|c|} +\hline +Stream & Numerator & Denominator & Start height & End height \\\hline\raisedstrut +\texttt{FS\_FPF\_ZCG} & $8$ & $100$ & $2726400$ & $3146400$ \\ +\texttt{FS\_DEFERRED} & $12$ & $100$ & $2726400$ & $3146400$ \\\hline +\end{tabular} +\end{formulae} + +It also defines these \fundingStreams for \Testnet: + +\begin{formulae} +\item \begin{tabular}{|l|c|c|c|c|} +\hline +Stream & Numerator & Denominator & Start height & End height \\\hline\raisedstrut +\texttt{FS\_FPF\_ZCG} & $8$ & $100$ & $2976000$ & $3396000$ \\ +\texttt{FS\_DEFERRED} & $12$ & $100$ & $2976000$ & $3396000$ \\\hline +\end{tabular} +\end{formulae} + +\pnote{The new funding streams begin at the second halving for Mainnet, but the second +halving on Testnet occurred prior to the introduction of the new funding streams. +For both new funding streams on each network, the associated duration corresponds to +approximately one year's worth of blocks.} +} %nu6 + \lsubsection{Changes to the Script System}{scripts} @@ -14749,7 +14910,8 @@ Jakub Zalewski, Oana Ciobotaru, Andre Serrano, Brad Miller, Charlie O'Keefe, David Campbell, Elena Giralt, Francisco Gindre, Joseph Van~Geffen, Josh Swihart, Kevin Gorham, Larry Ruane, Marshall Gaucher, Ryan Taylor, Sasha Meyer, -Conrado Gouvea, and no doubt others. +Conrado Gouvêa, Aditya Bharadwaj, Andrew Arnott, Arya, Andrea Kobrlova, +Lukas Korba, Honza Rychnovský, and no doubt others. We would also like to thank the designers and developers of \Bitcoin and \BitcoinCore. @@ -14829,14 +14991,31 @@ \intropart \lsection{Change History}{changehistory} +\historyentry{2024.5.1}{2024-09-26} + +\begin{itemize} +\nusix{ + \item Apply \NUSix consensus changes from \cite{ZIP-2001} and \cite{ZIP-236}. +} %nusix + \item Collect the definitions of balances for each \chainValuePool into + \crossref{chainvaluepoolbalances}. + \item Add a definition of \totalIssuedSupply. + \item Add acknowledgements to Aditya Bharadwaj, Andrew Arnott, Arya, + Andrea Kobrlova, Lukas Korba, and Honza Rychnovský for discussions + on the Zcash protocol. +\end{itemize} + + \historyentry{2024.5.0}{2024-08-28} \begin{itemize} \item Add the hyphen in \nh{Daira-Emma} Hopwood. \item Correct some author lists in the References. \item Prevent incorrect line-breaking on hyphens. +\nufive{ \item In \crossref{concretesinsemillahash}, declare use of $\LEBStoIP{}$ instead of $\LEOStoIP{}$. - \item Add an acknowledgement to Conrado Gouvea for discussions on the Zcash protocol. +} %nufive + \item Add an acknowledgement to Conrado Gouvêa for discussions on the Zcash protocol. \item Add boilerplate support for \NUSix. \end{itemize} @@ -15582,7 +15761,7 @@ \item Change the specifications of \note decryption in \crossref{sproutinband} and \crossref{saplingandorchardinband} to return the \note and \memo, rather than a \notePlaintext. - \item Generalize the specification of \blockChain scanning in \crossref{scan} to support \Orchard. + \item Generalize the \blockChain scanning algorithm in \crossref{scan} to support \Orchard. \item Update the $\hashFinalSaplingRoot$/$\hashLightClientRoot$/$\hashBlockCommitments$ field for \NUFive. \item Update specification of $\Poseidon$. @@ -16384,7 +16563,7 @@ \item Add section on signature hashing. \item Briefly describe the changes to computation of \sighashTxHashes in \Sprout. \item Clarify that interstitial \treestates form a tree for each \transaction containing \joinSplitDescriptions. - \item Correct the description of P2PKH addresses in \crossref{transparentaddrencoding} --- they + \item Correct the description of \PtoPKHAddresses in \crossref{transparentaddrencoding} --- they use a hash of a compressed, not an uncompressed \ECDSA key representation. \item Clarify the wording of the caveat\footnoteref{securitycaveat} about the claimed security of shielded \transactions. @@ -16894,7 +17073,7 @@ \historyentry{2016.0-beta-1.8}{2016-10-04} \begin{itemize} - \item Revise the lead bytes for \transparent P2SH and P2PKH addresses, + \item Revise the lead bytes for \transparent \PtoSH and \PtoPKH addresses, and reencode the \Testnet \foundersReward addresses. \item Add a section on which BIPs apply to \Zcash. \item Specify that \ScriptOP{CODESEPARATOR} has been disabled, and diff --git a/protocol/zcash.bib b/protocol/zcash.bib index 3efa7d4d1..ec823e03d 100644 --- a/protocol/zcash.bib +++ b/protocol/zcash.bib @@ -1408,6 +1408,15 @@ @misc{ZIP-225 urldate={2021-03-21} } +@misc{ZIP-236, + presort={ZIP-0236}, + author={{Daira\nbh{}Emma} Hopwood}, + title={Blocks should balance exactly}, + howpublished={Zcash Improvement Proposal 236. Created July~2, 2024.}, + url={https://zips.z.cash/zip-0236}, + urldate={2024-09-24} +} + @misc{ZIP-239, presort={ZIP-0239}, author={{Daira\nbh{}Emma} Hopwood and Jack Grigg}, @@ -1471,6 +1480,15 @@ @misc{ZIP-252 urldate={2022-06-22} } +@misc{ZIP-253, + presort={ZIP-0253}, + author={Arya}, + title={Deployment of the {NU6} Network Upgrade}, + howpublished={Zcash Improvement Proposal 253. Created July~17, 2024.}, + url={https://zips.z.cash/zip-0253}, + urldate={2024-09-24} +} + @misc{ZIP-302, presort={ZIP-0302}, author={Jay Graber and Jack Grigg}, @@ -1489,6 +1507,33 @@ @misc{ZIP-316 urldate={2021-04-29} } +@misc{ZIP-1014, + presort={ZIP-1014}, + author={Andrew Miller and Zooko Wilcox}, + title={Establishing a Dev Fund for ECC, ZF, and Major Grants}, + howpublished={Zcash Improvement Proposal 1014. Created November~10, 2019.}, + url={https://zips.z.cash/zip-1014}, + urldate={2024-09-24} +} + +@misc{ZIP-1015, + presort={ZIP-1015}, + author={Jason McGee and @Peacemonger and Kris Nuttycombe}, + title={Block Reward Allocation for Non-Direct Development Funding}, + howpublished={Zcash Improvement Proposal 1015. Created August~26, 2024.}, + url={https://zips.z.cash/zip-1015}, + urldate={2024-09-24} +} + +@misc{ZIP-2001, + presort={ZIP-2001}, + author={Kris Nuttycombe}, + title={Lockbox Funding Streams}, + howpublished={Zcash Improvement Proposal 2001. Created July~2, 2024.}, + url={https://zips.z.cash/zip-2001}, + urldate={2024-09-24} +} + @misc{DigiByte-PoW, presort={DigiByte-PoW}, author={DigiByte Core Developers}, diff --git a/rendered/protocol/blossom.pdf b/rendered/protocol/blossom.pdf index e8a948e4e..bd6601412 100644 Binary files a/rendered/protocol/blossom.pdf and b/rendered/protocol/blossom.pdf differ diff --git a/rendered/protocol/canopy.pdf b/rendered/protocol/canopy.pdf index e8a9667ab..a2cc318da 100644 Binary files a/rendered/protocol/canopy.pdf and b/rendered/protocol/canopy.pdf differ diff --git a/rendered/protocol/heartwood.pdf b/rendered/protocol/heartwood.pdf index 9faa3e3dc..a380d6cfa 100644 Binary files a/rendered/protocol/heartwood.pdf and b/rendered/protocol/heartwood.pdf differ diff --git a/rendered/protocol/nu5.pdf b/rendered/protocol/nu5.pdf index 94332100c..f5a6655c1 100644 Binary files a/rendered/protocol/nu5.pdf and b/rendered/protocol/nu5.pdf differ diff --git a/rendered/protocol/protocol.pdf b/rendered/protocol/protocol.pdf index 94332100c..0e58d8841 100644 Binary files a/rendered/protocol/protocol.pdf and b/rendered/protocol/protocol.pdf differ diff --git a/rendered/protocol/sapling.pdf b/rendered/protocol/sapling.pdf index ebed3fa37..0939d0a14 100644 Binary files a/rendered/protocol/sapling.pdf and b/rendered/protocol/sapling.pdf differ diff --git a/rendered/zip-0207.html b/rendered/zip-0207.html index 10de04631..220c16514 100644 --- a/rendered/zip-0207.html +++ b/rendered/zip-0207.html @@ -17,8 +17,8 @@ License: MIT

Terminology

The key words "MUST", "SHOULD", "SHOULD NOT", and "MAY" in this document are to be interpreted as described in BCP 14 1 when, and only when, they appear in all capitals.

-

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 7

-

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

+

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 9

+

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

The terms below are to be interpreted as follows:

Canopy
@@ -31,19 +31,20 @@

Abstract

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 14. It should be read in conjunction with ZIP 1014 16, which describes the high-level requirements for that fund.

+

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

Motivation

-

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

-

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.

+

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

+

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 was reintroduced for that purpose in the Canopy upgrade in order to reuse specification, analysis, and implementation effort.

+

As of NU6, ZIP 1015 21 directs part of the block reward to a reserve, the distribution of which is to be determined via a future ZIP. ZIP 2001 22 modified this ZIP to augment the funding stream mechanism with a common mechanism to implement this proposal.

Requirements

-

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

+

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

As for the original Founders' Reward, a mechanism is provided to allow addresses for a given funding stream to be 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 5, 6, 7, and 8:

+

We use the following constants and functions defined in 5, 8, 9, and 10:

Funding streams

-

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. 11

+

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

+

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. 14

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

\(\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.

+

The funding streams are paid to one of a pre-defined set of recipients, depending on the block height. Each recipient identifier MUST be either the string encoding of a transparent P2SH address or Sapling address (as specified in 6 or [#protocol-saplingpaymentaddrencoding]) to be paid by an output in the coinbase transaction, or the identifier + \(\mathsf{DEFERRED}\_\mathsf{POOL}\) + . The latter, added in the NU6 network upgrade 19, indicates that the value is to be paid to a reserve to be used for development funding, the distribution of which is to be determined via a future ZIP.

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 \\ @@ -195,22 +198,83 @@

On Mainnet, Canopy 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 Canopy activation.

+

Deferred Development Fund Chain Value Pool Balance

+

Full node implementations MUST track an additional + \(\mathsf{ChainValuePoolBalance^{Deferred}}\) + chain value pool balance, in addition to the Sprout, Sapling, and Orchard chain value pool balances.

+

Define + \(\mathsf{totalDeferredOutput}(\mathsf{height}) := \sum_{\mathsf{fs} \in \mathsf{DeferredFundingStreams}(\mathsf{height})} \mathsf{fs.Value}(\mathsf{height})\) + where + \(\mathsf{DeferredFundingStreams}(\mathsf{height})\) + is the set of funding streams with recipient identifier + \(\mathsf{DEFERRED}\_\mathsf{POOL}\) + in the block at height + \(\mathsf{height}\) + .

+

The + \(\mathsf{ChainValuePoolBalance^{Deferred}}\) + chain value pool balance for a given block chain is the sum of the values of payments to + \(\mathsf{DEFERRED}\_\mathsf{POOL}\) + for transactions in the block chain.

+

Equivalently, + \(\mathsf{ChainValuePoolBalance^{Deferred}}\) + for a block chain up to and including height + \(\mathsf{height}\) + is given by + \(\sum_{\mathsf{h} = 0}^{\mathsf{height}} \mathsf{totalDeferredOutput}(\mathsf{h})\) + .

+

Note: + \(\mathsf{totalDeferredOutput}(\mathsf{h})\) + is necessarily zero for heights + \(\mathsf{h}\) + prior to NU6 activation.

+

Consensus rules

-

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

+

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

Once the Canopy network upgrade activates:

-

For the funding stream definitions to be activated at Canopy, see ZIP 214. 14 Funding stream definitions can be added, changed, or deleted in ZIPs associated with subsequent network upgrades, subject to the ZIP process. 9

+

These rules are reproduced in [#protocol-fundingstreams].

+

The effect of the definition of + \(\mathsf{ChainValuePoolBalance^{Deferred}}\) + above is that payments to the + \(\mathsf{DEFERRED}\_\mathsf{POOL}\) + cause + \(\mathsf{FundingStream[FUND].Value}(\mathsf{height})\) + to be added to + \(\mathsf{ChainValuePoolBalance^{Deferred}}\) + for the block chain including that block.

+

For the funding stream definitions to be activated at Canopy and at NU6, see ZIP 214. 17 Funding stream definitions can be added, changed, or deleted in ZIPs associated with subsequent network upgrades, subject to the ZIP process. 12

Deployment

-

This proposal is intended to be deployed with Canopy. 15

+

This proposal was initially deployed with Canopy. 18

+

Changes to support deferred funding streams are to be deployed with NU6. 19

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 consensus branch that persists.

@@ -227,7 +291,7 @@ 1 - Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words" + Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words" <https://www.rfc-editor.org/info/bcp14> @@ -235,7 +299,7 @@ 2 - Zcash Protocol Specification, Version 2021.2.16 or later + Zcash Protocol Specification, Version 2024.5.1 or later <protocol/protocol.pdf> @@ -243,7 +307,7 @@ 3 - Zcash Protocol Specification, Version 2021.2.16. Section 3.10: Block Subsidy and Founders' Reward + Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.10: Block Subsidy and Founders' Reward <protocol/protocol.pdf#subsidyconcepts> @@ -251,7 +315,7 @@ 4 - Zcash Protocol Specification, Version 2021.2.16. Section 3.12: Mainnet and Testnet + Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet <protocol/protocol.pdf#networks> @@ -259,95 +323,143 @@ 5 - Zcash Protocol Specification, Version 2021.2.16. Section 5.3: Constants + Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.3: Constants <protocol/protocol.pdf#constants> - +
- +
6Zcash Protocol Specification, Version 2021.2.16. Section 7.7.3: Difficulty adjustmentZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.6.1.1: Transparent Addresses <protocol/protocol.pdf#transparentaddrencoding>
- +
- +
7Zcash Protocol Specification, Version 2021.2.16. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders' RewardZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.6.3.1: Sapling Payment Addresses <protocol/protocol.pdf#saplingpaymentaddrencoding>
- +
- +
8Zcash Protocol Specification, Version 2021.2.16. Section 7.9: Payment of Founders' RewardZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.7.3: Difficulty adjustment <protocol/protocol.pdf#diffadjustment>
- +
- +
9ZIP 0: ZIP ProcessZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders' Reward <protocol/protocol.pdf#subsidies>
- +
- +
10ZIP 200: Network Upgrade MechanismZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.9: Payment of Founders' Reward <protocol/protocol.pdf#foundersreward>
- +
- +
11ZIP 208: Shorter Block Target SpacingZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.10: Payment of Funding Streams <protocol/protocol.pdf#fundingstreams>
- +
- +
12ZIP 212: Allow Recipient to Derive Sapling Ephemeral Secret from Note PlaintextZIP 0: ZIP Process <zip-0000.rst>
- +
- +
13ZIP 213: Shielded CoinbaseZIP 200: Network Upgrade Mechanism <zip-0200.rst>
- +
- +
14ZIP 214: Consensus rules for a Zcash Development FundZIP 208: Shorter Block Target Spacing <zip-0208.rst>
- +
- +
15ZIP 251: Deployment of the Canopy Network UpgradeZIP 212: Allow Recipient to Derive Sapling Ephemeral Secret from Note Plaintext <zip-0212.rst>
- +
- + + + +
16ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major GrantsZIP 213: Shielded Coinbase <zip-0213.rst>
+ + + + + + + +
17ZIP 214: Consensus rules for a Zcash Development Fund <zip-0214.rst>
+ + + + + + + +
18ZIP 251: Deployment of the Canopy Network Upgrade <zip-0251.rst>
+ + + + + + + +
19ZIP 253: Deployment of the NU6 Network Upgrade <zip-0253.rst>
+ + + + + + + +
20ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants <zip-1014.rst>
+ + + + + + + +
21ZIP 1015: Block Reward Allocation for Non-Direct Development Funding <zip-1015.rst>
+ + + + +
22ZIP 2001: Lockbox Funding Streams <zip-2001.rst>
diff --git a/rendered/zip-0214.html b/rendered/zip-0214.html index be8647c76..d8ead7e6d 100644 --- a/rendered/zip-0214.html +++ b/rendered/zip-0214.html @@ -150,15 +150,15 @@ - FS_DEFERRED - 12 + FS_FPF_ZCG + 8 100 2726400 3146400 - FS_FPF_ZCG - 8 + FS_DEFERRED + 12 100 2726400 3146400 @@ -178,15 +178,15 @@ - FS_DEFERRED - 12 + FS_FPF_ZCG + 8 100 2976000 3396000 - FS_FPF_ZCG - 8 + FS_DEFERRED + 12 100 2976000 3396000 @@ -277,7 +277,9 @@

Mainnet Recipient Addresses for Revision 0

Mainnet Recipient Addresses for Revision 1

-

<TBD>

+
+

FS_FPF_ZCG.AddressList[0..11] = ["t3cFfPt1Bcvgez9ZbMBFWeZsskxTkPzGCow"] * 12

+

Testnet Recipient Addresses for Revision 0

@@ -369,7 +371,7 @@

Rationale for Revision 0

2 - Zcash Protocol Specification, Version 2023.4.0 or later + Zcash Protocol Specification, Version 2024.5.1 or later @@ -377,7 +379,7 @@

Rationale for Revision 0

3 - Zcash Protocol Specification, Version 2023.4.0 [NU5]. Section 3.10: Block Subsidy, Funding Streams, and Founders' Reward + Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.10: Block Subsidy, Funding Streams, and Founders' Reward @@ -385,7 +387,7 @@

Rationale for Revision 0

4 - Zcash Protocol Specification, Version 2023.4.0 [NU5]. Section 3.12: Mainnet and Testnet + Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet @@ -393,7 +395,7 @@

Rationale for Revision 0

5 - Zcash Protocol Specification, Version 2023.4.0 [NU5]. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders' Reward + Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders' Reward diff --git a/rendered/zip-0227.html b/rendered/zip-0227.html index 7b82fb909..e5650ee1f 100644 --- a/rendered/zip-0227.html +++ b/rendered/zip-0227.html @@ -840,7 +840,7 @@

Deployment

-

This ZIP is proposed to activate with Network Upgrade 6.

+

TBD

References

diff --git a/rendered/zip-0236.html b/rendered/zip-0236.html index 7af767d39..9f0f3f295 100644 --- a/rendered/zip-0236.html +++ b/rendered/zip-0236.html @@ -53,23 +53,26 @@

Transparent inputs to a transaction insert value into a transparent transaction value pool associated with the transaction, and transparent outputs remove value from this pool. The effect of Sapling Spends and Outputs, and of Orchard Actions on the transaction value pool are specified in § 4.13 and § 4.14 respectively.

As in Bitcoin, the remaining value in the transparent transaction value pool of a non-coinbase transaction is available to miners as a fee. That is, the sum of those values for non-coinbase transactions in each block is treated as an implicit input to the transaction value balance of the block's coinbase transaction (in addition to the implicit input created by issuance).

-

The remaining value in the transparent transaction value pool of coinbase transactions in blocks prior to NU-X is destroyed. From activation of NU-X, this remaining value is required to be zero; that is, all of the available balance MUST be consumed by outputs of the coinbase transaction.

+

The remaining value in the transparent transaction value pool of coinbase transactions in blocks prior to NU6 is destroyed. From activation of NU6, this remaining value is required to be zero; that is, all of the available balance MUST be consumed by outputs of the coinbase transaction.

Consensus rules:

-

where "NU-X" is to be replaced by the designation of the network upgrade in which this ZIP will be activated.

+

where "NU6" is to be replaced by the designation of the network upgrade in which this ZIP will be activated.

Note that the differences in the first two paragraphs of the above replacement text are clarifications of the protocol, rather than consensus changes. Those could be made independently of this ZIP.

This change applies identically to Mainnet and Testnet.

Deployment

-

Subject to community agreement, this ZIP is proposed to be deployed with NU6. 6

+

This ZIP is proposed to be deployed with NU6. 6

Reference implementation

-

TODO

+

Acknowledgements

The author would like to thank Jack Grigg and Kris Nuttycombe for discussions leading to the submission of this ZIP.

@@ -87,7 +90,7 @@
- +
2Zcash Protocol Specification, Version 2023.4.0 or laterZcash Protocol Specification, Version 2024.5.1 or later
@@ -95,7 +98,7 @@ 3 - Zcash Protocol Specification, Version 2023.4.0. Section 3.4: Transactions and Treestates + Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.4: Transactions and Treestates @@ -103,7 +106,7 @@ 4 - Zcash Protocol Specification, Version 2023.4.0. Section 3.12: Mainnet and Testnet + Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet diff --git a/rendered/zip-0253.html b/rendered/zip-0253.html index 138230ad8..a667fd3b1 100644 --- a/rendered/zip-0253.html +++ b/rendered/zip-0253.html @@ -74,7 +74,7 @@

NU6 deployment

Testnet: 2976000
-Mainnet: TBD +Mainnet: 2726400
MIN_NETWORK_PROTOCOL_VERSION (NU6)
@@ -117,11 +117,11 @@

References

Mechanism↩︎

  • Zcash Protocol -Specification, Version v2023.4.0 or later. Section 3.12: Mainnet and +Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet↩︎

  • Zcash Protocol -Specification, Version v2023.4.0 or later↩︎

  • ZIP 200: Network Upgrade Mechanismhttps://github.com/zcash/zips/pull/881>

    Terminology

    -

    The key words "MUST", "REQUIRED", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in BCP 14 1 when, and only when, they appear in all capitals.

    +

    The key words "MUST", "SHALL", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in BCP 14 1 when, and only when, they appear in all capitals.

    "Zcash Community Advisory Panel", also called "ZCAP", refers to the panel of community members assembled by the Zcash Foundation and described at 5.

    "Zcash Community Grants", also called "ZCG", refers to the committee selected by the Zcash Community Advisory Panel or a successor process (e.g. as established by FPF) to decide on the funding of grants intended to fund the Zcash ecosystem.

    "Financial Privacy Foundation", also called "FPF", refers to the Cayman Islands-incorporated non-profit foundation company limited by guarantee of that name.

    @@ -132,15 +132,15 @@ - FS_DEFERRED - 12 + FS_FPF_ZCG + 8 100 2726400 3146400 - FS_FPF_ZCG - 8 + FS_DEFERRED + 12 100 2726400 3146400 @@ -160,15 +160,15 @@ - FS_DEFERRED - 12 + FS_FPF_ZCG + 8 100 2976000 3396000 - FS_FPF_ZCG - 8 + FS_DEFERRED + 12 100 2976000 3396000 diff --git a/rendered/zip-2001.html b/rendered/zip-2001.html index bc2f3d310..8e0ecfd19 100644 --- a/rendered/zip-2001.html +++ b/rendered/zip-2001.html @@ -18,58 +18,66 @@ License: MIT Pull-Request: <https://github.com/zcash/zips/pull/>

    Terminology

    -

    The key words "MUST", "REQUIRED", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in BCP 14 1 when, and only when, they appear in all capitals.

    +

    The key words "MUST" and "MUST NOT" in this document are to be interpreted as described in BCP 14 1 when, and only when, they appear in all capitals.

    Abstract

    This ZIP specifies a change to the Zcash consensus protocol to define a pool of issued Zcash value to be used to fund future development efforts within the Zcash ecosystem.

    -

    This ZIP builds upon the funding stream mechanism defined in ZIP 207 3. It defines a new "DEFERRED_POOL" funding stream type such that portions of the block reward sent to a stream of this type are deposited directly into the deferred funding pool instead of being sent to a recipient address. Other ways of adding to the pool, such as allowing for direct deposits or fee value currently allocated to miners may be defined in the future.

    +

    This ZIP builds upon the funding stream mechanism defined in ZIP 207 11. It defines a new "DEFERRED_POOL" funding stream type such that portions of the block reward sent to a stream of this type are deposited directly into the deferred funding pool instead of being sent to a recipient address. Other ways of adding to the pool, such as allowing for direct deposits or fee value currently allocated to miners may be defined in the future.

    Motivation

    -

    In accordance with ZIP 1014, 2 the Zcash block reward is allocated with 80% going to miners, and the remaining 20% distributed among the Major Grants Fund (8%), Electric Coin Company (ECC) (7%), and the Zcash Foundation (ZF) (5%). This funding structure supports various essential activities such as protocol development, security, marketing, and legal expenses. However, this model will expire in November 2024, leading to the entire block reward being allocated to miners if no changes are made.

    +

    In accordance with ZIP 1014, 16 the Zcash block reward is allocated with 80% going to miners, and the remaining 20% distributed among the Major Grants Fund (8%), Electric Coin Company (ECC) (7%), and the Zcash Foundation (ZF) (5%). This funding structure supports various essential activities such as protocol development, security, marketing, and legal expenses. However, this model will expire in November 2024, leading to the entire block reward being allocated to miners if no changes are made.

    Several draft ZIPs under consideration for replacing the existing direct allocation of block rewards suggest that part of the block reward be directed to a reserve, the distribution of which is to be determined via a future ZIP. This ZIP is intended to provide a common mechanism that can be used to implement these various proposals.

    Requirements

    The Zcash protocol will maintain a new Deferred chain pool value balance - \(\mathsf{PoolValue}_{Deferred}\) + \(\mathsf{ChainValuePoolBalance^{Deferred}}\) for the deferred funding pool, in much the same fashion as it maintains chain pool value balances for the transparent, Sprout, Sapling, and Orchard pools.

    -

    The funding stream mechanism defined in ZIP 207 3 is modified such that a funding stream may deposit funds into the deferred pool.

    +

    The funding stream mechanism defined in ZIP 207 11 is modified such that a funding stream may deposit funds into the deferred pool.

    Specification

    -

    Modifications to ZIP 207 3

    +

    Modifications to ZIP 207 11

    The following paragraph is added to the section Motivation:

    -

    ZIP TBD 6 directs part of the block reward to a reserve, the distribution of which is to be determined via a future ZIP. ZIP 2001 7 modified this ZIP to augment the funding stream mechanism with a common mechanism to implement this proposal.

    +

    As of NU6, ZIP 1015 17 directs part of the block reward to a reserve, the distribution of which is to be determined via a future ZIP. ZIP 2001 18 modified the present ZIP to augment the funding stream mechanism with a common mechanism to implement this proposal.

    -

    In the section Funding streams 4, instead of:

    +

    In the section Funding streams 12, instead of:

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

    it will be modified to read:

    -

    Each funding stream has an associated sequence of recipients, each of which MUST be either a transparent P2SH address, a Sapling address, or the identifier DEFERRED_POOL.

    +

    Each element of + \(\mathsf{fs.Recipients}\) + MUST represent either a transparent P2SH address as specified in 6, or a Sapling shielded payment address as specified in 7, or the identifier + \(\mathsf{DEFERRED}\_\mathsf{POOL}\!\) + .

    After the section Funding streams, a new section is added with the heading "Deferred Development Fund Chain Value Pool Balance" and the following contents:

    Full node implementations MUST track an additional - \(\mathsf{PoolValue}_{Deferred}\) + \(\mathsf{ChainValuePoolBalance^{Deferred}}\) chain value pool balance, in addition to the Sprout, Sapling, and Orchard chain value pool balances.

    Define \(\mathsf{totalDeferredOutput}(\mathsf{height}) := \sum_{\mathsf{fs} \in \mathsf{DeferredFundingStreams}(\mathsf{height})} \mathsf{fs.Value}(\mathsf{height})\) where \(\mathsf{DeferredFundingStreams}(\mathsf{height})\) - is the set of funding streams with a recipient of DEFERRED_POOL in the block at height - \(\mathsf{height}\) + is the set of funding streams with recipient identifier + \(\mathsf{DEFERRED}\_\mathsf{POOL}\) + in the block at height + \(\mathsf{height}\!\) .

    The - \(\mathsf{PoolValue}_{Deferred}\) - chain value pool balance for a given block chain is the sum of the values of payments to DEFERRED_POOL for transactions in the block chain.

    + \(\mathsf{ChainValuePoolBalance^{Deferred}}\) + chain value pool balance for a given block chain is the sum of the values of payments to + \(\mathsf{DEFERRED}\_\mathsf{POOL}\) + for transactions in the block chain.

    Equivalently, - \(\mathsf{PoolValue}_{Deferred}\) + \(\mathsf{ChainValuePoolBalance^{Deferred}}\) for a block chain up to and including height \(\mathsf{height}\) is given by - \(\sum_{\mathsf{h} = 0}^{\mathsf{height}} \mathsf{totalDeferredOutput}(\mathsf{h})\) + \(\sum_{\mathsf{h} = 0}^{\mathsf{height}} \mathsf{totalDeferredOutput}(\mathsf{h})\!\) .

    Note: \(\mathsf{totalDeferredOutput}(\mathsf{h})\) @@ -77,7 +85,7 @@

    Modifications to ZIP 207 \(\mathsf{h}\) prior to NU6 activation.

    -

    In the section Consensus rules 5, instead of:

    +

    In the section Consensus rules 13, instead of:

    -

    After the list of post-Canopy consensus rules, the following paragraph is added:

    +

    After the list of post-Canopy consensus rules, the following paragraphs are added:

    +

    These rules are reproduced in [#protocol-fundingstreams].

    The effect of the definition of - \(\mathsf{PoolValue}_{Deferred}\) - above is that payments to the DEFERRED_POOL cause + \(\mathsf{ChainValuePoolBalance^{Deferred}}\) + above is that payments to the + \(\mathsf{DEFERRED}\_\mathsf{POOL}\) + cause \(\mathsf{FundingStream[FUND].Value}(\mathsf{height})\) to be added to - \(\mathsf{PoolValue}_{Deferred}\) + \(\mathsf{ChainValuePoolBalance^{Deferred}}\) for the block chain including that block.

    +

    In the section Deployment 14, the following sentence is added:

    +
    +

    Changes to support deferred funding streams are to be deployed with NU6. 15

    +

    Modifications to the protocol specification

    -

    In section 7.1.2 Transaction Consensus Rules 10, instead of:

    +

    In section 4.17 Chain Value Pool Balances 5 (which is new in version 2024.5.1 of the protocol specification), include the following:

    +
    +

    Define + \(\mathsf{totalDeferredOutput}\) + as in 9.

    +

    Then, consistent with 11, the deferred development fund chain value pool balance for a block chain up to and including height + \(\mathsf{height}\) + is given by + \(\mathsf{ChainValuePoolBalance^{Deferred}}(\mathsf{height}) := \sum_{\mathsf{h} = 0}^{\mathsf{height}} \mathsf{totalDeferredOutput}(\mathsf{h})\!\) + .

    +

    Non-normative notes:

    +
      +
    • + \(\mathsf{totalDeferredOutput}(\mathsf{h})\) + is necessarily zero for heights + \(\mathsf{h}\) + prior to NU6 activation.
    • +
    • Currently there is no way to withdraw from the deferred development fund chain value pool, so there is no possibility of it going negative. Therefore, no consensus rule to prevent that eventuality is needed at this time.
    • +
    +

    The total issued supply of a block chain at block height + \(\mathsf{height}\) + is given by the function:

    +
    +
    \(\begin{array}{ll} +\mathsf{IssuedSupply}(\mathsf{height}) := &\!\!\!\!\mathsf{ChainValuePoolBalance^{Transparent}}(\mathsf{height}) \\ +&+\,\; \mathsf{ChainValuePoolBalance^{Sprout}}(\mathsf{height}) \\ +&+\,\; \mathsf{ChainValuePoolBalance^{Sapling}}(\mathsf{height}) \\ +&+\,\; \mathsf{ChainValuePoolBalance^{Orchard}}(\mathsf{height}) \\ +&+\,\; \mathsf{ChainValuePoolBalance^{Deferred}}(\mathsf{height}) +\end{array}\)
    +

    In section 7.1.2 Transaction Consensus Rules 8, instead of:

    The total value in zatoshi of transparent outputs from a coinbase transaction, minus - \(\mathsf{v^{balanceSapling}}\) + \(\mathsf{v^{balanceSapling}}\!\) , minus - \(\mathsf{v^{balanceOrchard}}\) + \(\mathsf{v^{balanceOrchard}}\!\) , MUST NOT be greater than the value in zatoshi of the block subsidy plus the transaction fees paid by transactions in this block.

    it will be modified to read:

    -

    For the block at height +

    For the block at block height \(\mathsf{height}\) :

    • define the "total output value" of its coinbase transaction to be the total value in zatoshi of its transparent outputs, minus - \(\mathsf{v^{balanceSapling}}\) + \(\mathsf{v^{balanceSapling}}\!\) , minus - \(\mathsf{v^{balanceOrchard}}\) + \(\mathsf{v^{balanceOrchard}}\!\) , plus - \(\mathsf{totalDeferredOutput}(\mathsf{height})\) + \(\mathsf{totalDeferredOutput}(\mathsf{height})\!\) ;
    • define the "total input value" of its coinbase transaction to be the value in zatoshi of the block subsidy, plus the transaction fees paid by transactions in the block.
    @@ -134,16 +198,8 @@

    Modifications to ZIP 207 12 contains language and definitions copied from ZIP 207; it should be updated to reflect the changes made above.

    -

    In section 3.4 Transactions and Treestates 9, a definition of "total issued supply" will be added, such that the total issued supply as of a given height is given by the function:

    -
    \(\begin{array}{ll} -\mathsf{IssuedSupply}(\mathsf{height}) := &\!\!\!\!\mathsf{PoolValue}_{Transparent}(\mathsf{height}) \\ -&+\;\; \mathsf{PoolValue}_{Sprout}(\mathsf{height}) \\ -&+\,\; \mathsf{PoolValue}_{Sapling}(\mathsf{height}) \\ -&+\,\; \mathsf{PoolValue}_{Orchard}(\mathsf{height}) \\ -&+\,\; \mathsf{PoolValue}_{Deferred}(\mathsf{height}) -\end{array}\)
    -

    The second paragraph of section 1.2 High-level Overview 8 should also be updated to take into account the deferred chain value pool. Since that section of the specification is entirely non-normative, we do not give the full wording change here.

    +

    Section 7.10 Payment of Funding Streams 10 contains language and definitions copied from ZIP 207; it should be updated to reflect the changes made above.

    +

    The second paragraph of section 1.2 High-level Overview 2 should be updated to take into account the deferred chain value pool. Since that section of the specification is entirely non-normative, we do not give the full wording change here.

    References

    @@ -155,91 +211,139 @@

    Modifications to ZIP 207 + - +
    2ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major GrantsZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 1.2: High-level Overview <protocol/protocol.pdf#overview>
    - +
    - +
    3ZIP 207: Funding StreamsZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.4: Transactions and Treestates <protocol/protocol.pdf#transactions>
    - +
    - +
    4ZIP 207: Funding Streams. Section: Funding streamsZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.11: Coinbase Transactions and Issuance <protocol/protocol.pdf#coinbasetransactions>
    - +
    - +
    5ZIP 207: Funding Streams. Section: Consensus rulesZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.17: Chain Value Pool Balances <protocol/protocol.pdf#chainvaluepoolbalances>
    - +
    - +
    6Draft ZIP: Block Reward Allocation for Non-Direct Development FundingZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.6.1.1: Transparent Addresses <protocol/protocol.pdf#transparentaddrencoding>
    - +
    - +
    7ZIP 2001: Lockbox Funding StreamsZcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.6.3.1: Sapling Payment Addresses <protocol/protocol.pdf#saplingpaymentaddrencoding>
    - +
    - +
    8Zcash Protocol Specification, Version 2023.4.0. Section 1.2: High-level Overview <protocol/protocol.pdf#overview>Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.1.2: Transaction Consensus Rules <protocol/protocol.pdf#txnconsensus>
    - +
    - +
    9Zcash Protocol Specification, Version 2023.4.0. Section 3.4: Transactions and Treestates <protocol/protocol.pdf#transactions>Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders’ Reward <protocol/protocol.pdf#subsidies>
    - +
    - +
    10Zcash Protocol Specification, Version 2023.4.0. Section 7.1.2: Transaction Consensus Rules <protocol/protocol.pdf#txnconsensus>Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.10: Payment of Funding Streams <protocol/protocol.pdf#fundingstreams>
    - +
    - +
    11Zcash Protocol Specification, Version 2023.4.0. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders’ Reward <protocol/protocol.pdf#subsidies>ZIP 207: Funding Streams <zip-0207.rst>
    - +
    - + + + +
    12Zcash Protocol Specification, Version 2023.4.0. Section 7.10: Payment of Funding Streams <protocol/protocol.pdf#fundingstreams>ZIP 207: Funding Streams. Section: Funding streams <zip-0207.rst#funding-streams>
    + + + + + + + +
    13ZIP 207: Funding Streams. Section: Consensus rules <zip-0207.rst#consensus-rules>
    + + + + + + + +
    14ZIP 207: Funding Streams. Section: Deployment <zip-0207.rst#deployment>
    + + + + + + + +
    15ZIP 253: Deployment of the NU6 Network Upgrade <zip-0253.rst>
    + + + + + + + +
    16ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants <zip-1014.rst>
    + + + + + + + +
    17ZIP 1015: Block Reward Allocation for Non-Direct Development Funding <zip-1015.rst>
    + + + + +
    18ZIP 2001: Lockbox Funding Streams <zip-2001.rst>
    diff --git a/zips/zip-0207.rst b/zips/zip-0207.rst index 8d8ed6b03..50b79227b 100644 --- a/zips/zip-0207.rst +++ b/zips/zip-0207.rst @@ -55,9 +55,14 @@ 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 for the Zcash Development Fund, the ZIP was reintroduced for that +purpose in the Canopy upgrade in order to reuse specification, analysis, and +implementation effort. + +As of NU6, ZIP 1015 [#zip-1015]_ directs part of the block reward to a reserve, +the distribution of which is to be determined via a future ZIP. +ZIP 2001 [#zip-2001]_ modified this ZIP to augment the funding stream mechanism +with a common mechanism to implement this proposal. Requirements @@ -100,8 +105,8 @@ Funding streams --------------- 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). +numerator and a denominator), a start height (inclusive), an end height +(exclusive), and a sequence of recipients as defined below. 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 @@ -121,8 +126,15 @@ 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. +The funding streams are paid to one of a pre-defined set of recipients, +depending on the block height. Each recipient identifier MUST be either the +string encoding of a transparent P2SH address or Sapling address (as specified in +[#protocol-transparentaddrencoding]_ or [#protocol-saplingpaymentaddrencoding]) +to be paid by an output in the coinbase transaction, or the identifier +:math:`\mathsf{DEFERRED}\_\mathsf{POOL}`. The latter, added in the NU6 network +upgrade [#zip-0253]_, indicates that the value is to be paid to a reserve to be +used for development funding, the distribution of which is to be determined via +a future ZIP. 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 @@ -174,6 +186,30 @@ Reward expires, at block height 1046400. On Testnet, there will be a shortened Founders' Reward address period prior to Canopy activation. +Deferred Development Fund Chain Value Pool Balance +-------------------------------------------------- + +Full node implementations MUST track an additional +:math:`\mathsf{ChainValuePoolBalance^{Deferred}}` chain value pool balance, +in addition to the Sprout, Sapling, and Orchard chain value pool balances. + +Define :math:`\mathsf{totalDeferredOutput}(\mathsf{height}) := \sum_{\mathsf{fs} \in \mathsf{DeferredFundingStreams}(\mathsf{height})} \mathsf{fs.Value}(\mathsf{height})` +where :math:`\mathsf{DeferredFundingStreams}(\mathsf{height})` is the set of +funding streams with recipient identifier :math:`\mathsf{DEFERRED}\_\mathsf{POOL}` +in the block at height :math:`\mathsf{height}`. + +The :math:`\mathsf{ChainValuePoolBalance^{Deferred}}` chain value pool balance +for a given block chain is the sum of the values of payments to +:math:`\mathsf{DEFERRED}\_\mathsf{POOL}` for transactions in the block chain. + +Equivalently, :math:`\mathsf{ChainValuePoolBalance^{Deferred}}` for a block +chain up to and including height :math:`\mathsf{height}` is given by +:math:`\sum_{\mathsf{h} = 0}^{\mathsf{height}} \mathsf{totalDeferredOutput}(\mathsf{h})`. + +Note: :math:`\mathsf{totalDeferredOutput}(\mathsf{h})` is necessarily +zero for heights :math:`\mathsf{h}` prior to NU6 activation. + + Consensus rules --------------- @@ -187,9 +223,17 @@ Once the Canopy network upgrade activates: (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. +- In each block with coinbase transaction :math:`\mathsf{cb}` at block height + :math:`\mathsf{height}`, for each funding stream :math:`\mathsf{fs}` + active at that block height with a recipient identifier other than + :math:`\mathsf{DEFERRED}\_\mathsf{POOL}` given by + :math:`\mathsf{fs.Recipient}(\mathsf{height})\!`, + :math:`\mathsf{cb}` \MUST contain at least one output that pays + :math:`\mathsf{fs.Value}(\mathsf{height})` \zatoshi in the prescribed way to + the address represented by that recipient identifier. + +- :math:`\mathsf{fs.Recipient}(\mathsf{height})` is defined as + :math:`\mathsf{fs.Recipients_{\,\fs.RecipientIndex}}(\mathsf{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 @@ -199,18 +243,29 @@ Once the Canopy network upgrade activates: 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. - In this case the note plaintext lead byte MUST be :math:`\mathbf{0x02}`, as + In this case the note plaintext lead byte MUST be :math:`\mathbf{0x02}\!`, as specified in [#zip-0212]_. -For the funding stream definitions to be activated at Canopy, 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]_ +These rules are reproduced in [#protocol-fundingstreams]. + +The effect of the definition of :math:`\mathsf{ChainValuePoolBalance^{Deferred}}` +above is that payments to the :math:`\mathsf{DEFERRED}\_\mathsf{POOL}` cause +:math:`\mathsf{FundingStream[FUND].Value}(\mathsf{height})` to be added to +:math:`\mathsf{ChainValuePoolBalance^{Deferred}}` for the block chain including +that block. + +For the funding stream definitions to be activated at Canopy and at NU6, 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]_ Deployment ========== -This proposal is intended to be deployed with Canopy. [#zip-0251]_ +This proposal was initially deployed with Canopy. [#zip-0251]_ + +Changes to support deferred funding streams are to be deployed with NU6. [#zip-0253]_ Backward compatibility @@ -234,19 +289,25 @@ Reference Implementation References ========== -.. [#BCP14] `Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words" `_ -.. [#protocol] `Zcash Protocol Specification, Version 2021.2.16 or later `_ -.. [#protocol-subsidyconcepts] `Zcash Protocol Specification, Version 2021.2.16. Section 3.10: Block Subsidy and Founders' Reward `_ -.. [#protocol-networks] `Zcash Protocol Specification, Version 2021.2.16. Section 3.12: Mainnet and Testnet `_ -.. [#protocol-constants] `Zcash Protocol Specification, Version 2021.2.16. Section 5.3: Constants `_ -.. [#protocol-diffadjustment] `Zcash Protocol Specification, Version 2021.2.16. Section 7.7.3: Difficulty adjustment `_ -.. [#protocol-subsidies] `Zcash Protocol Specification, Version 2021.2.16. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders' Reward `_ -.. [#protocol-foundersreward] `Zcash Protocol Specification, Version 2021.2.16. Section 7.9: Payment of Founders' Reward `_ -.. [#zip-0000] `ZIP 0: ZIP Process `_ -.. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ -.. [#zip-0208] `ZIP 208: Shorter Block Target Spacing `_ -.. [#zip-0212] `ZIP 212: Allow Recipient to Derive Sapling Ephemeral Secret from Note Plaintext `_ -.. [#zip-0213] `ZIP 213: Shielded Coinbase `_ -.. [#zip-0214] `ZIP 214: Consensus rules for a Zcash Development Fund `_ -.. [#zip-0251] `ZIP 251: Deployment of the Canopy Network Upgrade `_ -.. [#zip-1014] `ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants `_ +.. [#BCP14] `Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words" ` +.. [#protocol] `Zcash Protocol Specification, Version 2024.5.1 or later ` +.. [#protocol-subsidyconcepts] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.10: Block Subsidy and Founders' Reward ` +.. [#protocol-networks] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet ` +.. [#protocol-constants] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.3: Constants ` +.. [#protocol-transparentaddrencoding] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.6.1.1: Transparent Addresses ` +.. [#protocol-saplingpaymentaddrencoding] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.6.3.1: Sapling Payment Addresses ` +.. [#protocol-diffadjustment] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.7.3: Difficulty adjustment ` +.. [#protocol-subsidies] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders' Reward ` +.. [#protocol-foundersreward] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.9: Payment of Founders' Reward ` +.. [#protocol-fundingstreams] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.10: Payment of Funding Streams ` +.. [#zip-0000] `ZIP 0: ZIP Process ` +.. [#zip-0200] `ZIP 200: Network Upgrade Mechanism ` +.. [#zip-0208] `ZIP 208: Shorter Block Target Spacing ` +.. [#zip-0212] `ZIP 212: Allow Recipient to Derive Sapling Ephemeral Secret from Note Plaintext ` +.. [#zip-0213] `ZIP 213: Shielded Coinbase ` +.. [#zip-0214] `ZIP 214: Consensus rules for a Zcash Development Fund ` +.. [#zip-0251] `ZIP 251: Deployment of the Canopy Network Upgrade ` +.. [#zip-0253] `ZIP 253: Deployment of the NU6 Network Upgrade ` +.. [#zip-1014] `ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants ` +.. [#zip-1015] `ZIP 1015: Block Reward Allocation for Non-Direct Development Funding ` +.. [#zip-2001] `ZIP 2001: Lockbox Funding Streams ` diff --git a/zips/zip-0214.rst b/zips/zip-0214.rst index 2f153919a..d4fa10c96 100644 --- a/zips/zip-0214.rst +++ b/zips/zip-0214.rst @@ -170,8 +170,8 @@ As of `Revision 1`_, the following additional streams are defined for Mainnet: ================= =========== ============= ============== ============ Stream Numerator Denominator Start height End height ================= =========== ============= ============== ============ -``FS_DEFERRED`` 12 100 2726400 3146400 ``FS_FPF_ZCG`` 8 100 2726400 3146400 +``FS_DEFERRED`` 12 100 2726400 3146400 ================= =========== ============= ============== ============ As of `Revision 1`_, the following additional streams are defined for Testnet: @@ -179,8 +179,8 @@ As of `Revision 1`_, the following additional streams are defined for Testnet: ================= =========== ============= ============== ============ Stream Numerator Denominator Start height End height ================= =========== ============= ============== ============ -``FS_DEFERRED`` 12 100 2976000 3396000 ``FS_FPF_ZCG`` 8 100 2976000 3396000 +``FS_DEFERRED`` 12 100 2976000 3396000 ================= =========== ============= ============== ============ Notes for `Revision 0`_: @@ -300,7 +300,7 @@ consist of 48 repetitions of the same address). Mainnet Recipient Addresses for `Revision 1`_ --------------------------------------------- - + FS_FPF_ZCG.AddressList[0..11] = ["t3cFfPt1Bcvgez9ZbMBFWeZsskxTkPzGCow"] * 12 Testnet Recipient Addresses for `Revision 0`_ --------------------------------------------- @@ -401,10 +401,10 @@ References ========== .. [#BCP14] `Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words" `_ -.. [#protocol] `Zcash Protocol Specification, Version 2023.4.0 or later `_ -.. [#protocol-subsidyconcepts] `Zcash Protocol Specification, Version 2023.4.0 [NU5]. Section 3.10: Block Subsidy, Funding Streams, and Founders' Reward `_ -.. [#protocol-networks] `Zcash Protocol Specification, Version 2023.4.0 [NU5]. Section 3.12: Mainnet and Testnet `_ -.. [#protocol-subsidies] `Zcash Protocol Specification, Version 2023.4.0 [NU5]. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders' Reward `_ +.. [#protocol] `Zcash Protocol Specification, Version 2024.5.1 or later `_ +.. [#protocol-subsidyconcepts] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.10: Block Subsidy, Funding Streams, and Founders' Reward `_ +.. [#protocol-networks] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet `_ +.. [#protocol-subsidies] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders' Reward `_ .. [#trademark] `Zcash Trademark Donation and License Agreement `_ .. [#osd] `The Open Source Definition `_ .. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ diff --git a/zips/zip-0227.rst b/zips/zip-0227.rst index 175415391..ba15f2035 100644 --- a/zips/zip-0227.rst +++ b/zips/zip-0227.rst @@ -616,7 +616,8 @@ Reference Implementation Deployment ========== -This ZIP is proposed to activate with Network Upgrade 6. +TBD + References ========== diff --git a/zips/zip-0236.rst b/zips/zip-0236.rst index 9b672b758..b4fdfc8d8 100644 --- a/zips/zip-0236.rst +++ b/zips/zip-0236.rst @@ -121,7 +121,7 @@ is modified to become: addition to the implicit input created by issuance). The remaining value in the transparent transaction value pool of coinbase transactions - in blocks prior to NU-X is destroyed. From activation of NU-X, this remaining value + in blocks prior to NU6 is destroyed. From activation of NU6, this remaining value is required to be zero; that is, all of the available balance MUST be consumed by outputs of the coinbase transaction. @@ -129,12 +129,12 @@ is modified to become: * The remaining value in the transparent transaction value pool of a non-coinbase transaction MUST be nonnegative. - * [Pre-NU-X] The remaining value in the transparent transaction value pool of a + * [Pre-NU6] The remaining value in the transparent transaction value pool of a coinbase transaction MUST be nonnegative. - * [NU-X onward] The remaining value in the transparent transaction value pool of + * [NU6 onward] The remaining value in the transparent transaction value pool of a coinbase transaction MUST be zero. -where "NU-X" is to be replaced by the designation of the network upgrade in which +where "NU6" is to be replaced by the designation of the network upgrade in which this ZIP will be activated. Note that the differences in the first two paragraphs of the above replacement text @@ -147,13 +147,14 @@ This change applies identically to Mainnet and Testnet. Deployment ========== -Subject to community agreement, this ZIP is proposed to be deployed with NU6. [#zip-0253]_ +This ZIP is proposed to be deployed with NU6. [#zip-0253]_ Reference implementation ======================== -TODO +* https://github.com/zcash/zcash/pull/6933 (zcashd) +* https://github.com/ZcashFoundation/zebra/pull/8727 (zebrad) Acknowledgements @@ -167,8 +168,8 @@ References ========== .. [#BCP14] `Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words" `_ -.. [#protocol] `Zcash Protocol Specification, Version 2023.4.0 or later `_ -.. [#protocol-transactions] `Zcash Protocol Specification, Version 2023.4.0. Section 3.4: Transactions and Treestates `_ -.. [#protocol-networks] `Zcash Protocol Specification, Version 2023.4.0. Section 3.12: Mainnet and Testnet `_ +.. [#protocol] `Zcash Protocol Specification, Version 2024.5.1 or later `_ +.. [#protocol-transactions] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.4: Transactions and Treestates `_ +.. [#protocol-networks] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet `_ .. [#zip-0200] `ZIP 200: Network Upgrade Mechanism `_ .. [#zip-0253] `ZIP 253: Deployment of the NU6 Network Upgrade `_ diff --git a/zips/zip-0253.md b/zips/zip-0253.md index 3238dcdfa..35e497475 100644 --- a/zips/zip-0253.md +++ b/zips/zip-0253.md @@ -49,7 +49,7 @@ CONSENSUS_BRANCH_ID ACTIVATION_HEIGHT (NU6) : Testnet: 2976000 -: Mainnet: TBD +: Mainnet: 2726400 MIN_NETWORK_PROTOCOL_VERSION (NU6) : Testnet: `170110` @@ -69,9 +69,9 @@ NU6 does not define a new transaction version or impose a new minimum transactio [^BCP14]: [Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words"](https://www.rfc-editor.org/info/bcp14) -[^protocol-networks]: [Zcash Protocol Specification, Version v2023.4.0 or later. Section 3.12: Mainnet and Testnet](protocol/protocol.pdf#networks) +[^protocol]: [Zcash Protocol Specification, Version 2024.5.1 or later](protocol/protocol.pdf) -[^protocol]: [Zcash Protocol Specification, Version v2023.4.0 or later](protocol/protocol.pdf) +[^protocol-networks]: [Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet](protocol/protocol.pdf#networks) [^zip-0200]: [ZIP 200: Network Upgrade Mechanism](zip-0200.rst) diff --git a/zips/zip-1015.rst b/zips/zip-1015.rst index 1ed4f0a26..059441908 100644 --- a/zips/zip-1015.rst +++ b/zips/zip-1015.rst @@ -19,7 +19,7 @@ Terminology =========== -The key words "MUST", "REQUIRED", "MUST NOT", "SHOULD", and "MAY" in this +The key words "MUST", "SHALL", "MUST NOT", "SHOULD", and "MAY" in this document are to be interpreted as described in BCP 14 [#BCP14]_ when, and only when, they appear in all capitals. @@ -365,8 +365,8 @@ Mainnet will be: ================= =========== ============= ============== ============ Stream Numerator Denominator Start height End height ================= =========== ============= ============== ============ -``FS_DEFERRED`` 12 100 2726400 3146400 ``FS_FPF_ZCG`` 8 100 2726400 3146400 +``FS_DEFERRED`` 12 100 2726400 3146400 ================= =========== ============= ============== ============ The set of funding streams for Testnet will be: @@ -374,8 +374,8 @@ The set of funding streams for Testnet will be: ================= =========== ============= ============== ============ Stream Numerator Denominator Start height End height ================= =========== ============= ============== ============ -``FS_DEFERRED`` 12 100 2976000 3396000 ``FS_FPF_ZCG`` 8 100 2976000 3396000 +``FS_DEFERRED`` 12 100 2976000 3396000 ================= =========== ============= ============== ============ diff --git a/zips/zip-2001.rst b/zips/zip-2001.rst index 93b227281..0b0063bb4 100644 --- a/zips/zip-2001.rst +++ b/zips/zip-2001.rst @@ -11,12 +11,13 @@ License: MIT Pull-Request: + Terminology =========== -The key words "MUST", "REQUIRED", "MUST NOT", "SHOULD", and "MAY" in this -document are to be interpreted as described in BCP 14 [#BCP14]_ when, and only -when, they appear in all capitals. +The key words "MUST" and "MUST NOT" in this document are to be interpreted as +described in BCP 14 [#BCP14]_ when, and only when, they appear in all capitals. + Abstract ======== @@ -32,6 +33,7 @@ directly into the deferred funding pool instead of being sent to a recipient address. Other ways of adding to the pool, such as allowing for direct deposits or fee value currently allocated to miners may be defined in the future. + Motivation ========== @@ -49,17 +51,19 @@ to a reserve, the distribution of which is to be determined via a future ZIP. This ZIP is intended to provide a common mechanism that can be used to implement these various proposals. + Requirements ============ The Zcash protocol will maintain a new Deferred chain pool value balance -:math:`\mathsf{PoolValue}_{Deferred}` for the deferred funding pool, in much -the same fashion as it maintains chain pool value balances for the transparent, -Sprout, Sapling, and Orchard pools. +:math:`\mathsf{ChainValuePoolBalance^{Deferred}}` for the deferred funding pool, +in much the same fashion as it maintains chain pool value balances for the +transparent, Sprout, Sapling, and Orchard pools. The funding stream mechanism defined in ZIP 207 [#zip-0207]_ is modified such that a funding stream may deposit funds into the deferred pool. + Specification ============= @@ -68,10 +72,10 @@ Modifications to ZIP 207 [#zip-0207]_ The following paragraph is added to the section **Motivation**: - ZIP TBD [#draft-nuttycom-funding-allocation]_ directs part of the block reward - to a reserve, the distribution of which is to be determined via a future ZIP. - ZIP 2001 [#zip-2001]_ modified this ZIP to augment the funding stream mechanism - with a common mechanism to implement this proposal. + As of NU6, ZIP 1015 [#zip-1015]_ directs part of the block reward to a reserve, + the distribution of which is to be determined via a future ZIP. + ZIP 2001 [#zip-2001]_ modified the present ZIP to augment the funding stream + mechanism with a common mechanism to implement this proposal. In the section **Funding streams** [#zip-0207-funding-streams]_, instead of: @@ -80,29 +84,30 @@ In the section **Funding streams** [#zip-0207-funding-streams]_, instead of: it will be modified to read: - Each funding stream has an associated sequence of recipients, each of which - MUST be either a transparent P2SH address, a Sapling address, or the identifier - `DEFERRED_POOL`. + Each element of :math:`\mathsf{fs.Recipients}` MUST represent either a transparent + P2SH address as specified in [#protocol-transparentaddrencoding]_, or a Sapling + shielded payment address as specified in [#protocol-saplingpaymentaddrencoding]_, + or the identifier :math:`\mathsf{DEFERRED}\_\mathsf{POOL}\!`. After the section **Funding streams**, a new section is added with the heading "Deferred Development Fund Chain Value Pool Balance" and the following contents: Full node implementations MUST track an additional - :math:`\mathsf{PoolValue}_{Deferred}` chain value pool balance, in addition to - the Sprout, Sapling, and Orchard chain value pool balances. + :math:`\mathsf{ChainValuePoolBalance^{Deferred}}` chain value pool balance, + in addition to the Sprout, Sapling, and Orchard chain value pool balances. Define :math:`\mathsf{totalDeferredOutput}(\mathsf{height}) := \sum_{\mathsf{fs} \in \mathsf{DeferredFundingStreams}(\mathsf{height})} \mathsf{fs.Value}(\mathsf{height})` where :math:`\mathsf{DeferredFundingStreams}(\mathsf{height})` is the set of - funding streams with a recipient of `DEFERRED_POOL` in the block at height - :math:`\mathsf{height}`. + funding streams with recipient identifier :math:`\mathsf{DEFERRED}\_\mathsf{POOL}` + in the block at height :math:`\mathsf{height}\!`. - The :math:`\mathsf{PoolValue}_{Deferred}` chain value pool balance for a given - block chain is the sum of the values of payments to `DEFERRED_POOL` for - transactions in the block chain. + The :math:`\mathsf{ChainValuePoolBalance^{Deferred}}` chain value pool balance + for a given block chain is the sum of the values of payments to + :math:`\mathsf{DEFERRED}\_\mathsf{POOL}` for transactions in the block chain. - Equivalently, :math:`\mathsf{PoolValue}_{Deferred}` for a block chain up to - and including height :math:`\mathsf{height}` is given by - :math:`\sum_{\mathsf{h} = 0}^{\mathsf{height}} \mathsf{totalDeferredOutput}(\mathsf{h})`. + Equivalently, :math:`\mathsf{ChainValuePoolBalance^{Deferred}}` for a block + chain up to and including height :math:`\mathsf{height}` is given by + :math:`\sum_{\mathsf{h} = 0}^{\mathsf{height}} \mathsf{totalDeferredOutput}(\mathsf{h})\!`. Note: :math:`\mathsf{totalDeferredOutput}(\mathsf{h})` is necessarily zero for heights :math:`\mathsf{h}` prior to NU6 activation. @@ -115,36 +120,82 @@ In the section **Consensus rules** [#zip-0207-consensus-rules]_, instead of: it will be modified to read: - - In each block, for each active funding stream with a recipient other than - `DEFERRED_POOL` at that block's height, the block's coinbase transaction - MUST contain at least one output that pays the stream's value in the - prescribed way to that recipient. + - In each block with coinbase transaction :math:`\mathsf{cb}` at block height + :math:`\mathsf{height}`, for each funding stream :math:`\mathsf{fs}` + active at that block height with a recipient identifier other than + :math:`\mathsf{DEFERRED}\_\mathsf{POOL}` given by + :math:`\mathsf{fs.Recipient}(\mathsf{height})\!`, + :math:`\mathsf{cb}` MUST contain at least one output that pays + :math:`\mathsf{fs.Value}(\mathsf{height})` zatoshi in the prescribed way + to the address represented by that recipient identifier. + + - :math:`\mathsf{fs.Recipient}(\mathsf{height})` is defined as + :math:`\mathsf{fs.Recipients_{\,fs.RecipientIndex}}(\mathsf{height})\!`. + +After the list of post-Canopy consensus rules, the following paragraphs are added: -After the list of post-Canopy consensus rules, the following paragraph is added: + These rules are reproduced in [#protocol-fundingstreams]. - The effect of the definition of :math:`\mathsf{PoolValue}_{Deferred}` above - is that payments to the `DEFERRED_POOL` cause + The effect of the definition of :math:`\mathsf{ChainValuePoolBalance^{Deferred}}` + above is that payments to the :math:`\mathsf{DEFERRED}\_\mathsf{POOL}` cause :math:`\mathsf{FundingStream[FUND].Value}(\mathsf{height})` to be added to - :math:`\mathsf{PoolValue}_{Deferred}` for the block chain including that block. + :math:`\mathsf{ChainValuePoolBalance^{Deferred}}` for the block chain including + that block. + +In the section **Deployment** [#zip-0207-deployment]_, the following sentence is +added: + + Changes to support deferred funding streams are to be deployed with NU6. [#zip-0253]_ + Modifications to the protocol specification ------------------------------------------- +In section **4.17 Chain Value Pool Balances** [#protocol-chainvaluepoolbalances]_ +(which is new in version 2024.5.1 of the protocol specification), include the following: + + Define :math:`\mathsf{totalDeferredOutput}` as in [#protocol-subsidies]_. + + Then, consistent with [#zip-0207]_, the deferred development fund chain value pool + balance for a block chain up to and including height :math:`\mathsf{height}` is given by + :math:`\mathsf{ChainValuePoolBalance^{Deferred}}(\mathsf{height}) := \sum_{\mathsf{h} = 0}^{\mathsf{height}} \mathsf{totalDeferredOutput}(\mathsf{h})\!`. + + Non-normative notes: + + * :math:`\mathsf{totalDeferredOutput}(\mathsf{h})` is necessarily zero for heights + :math:`\mathsf{h}` prior to NU6 activation. + * Currently there is no way to withdraw from the deferred development fund chain value + pool, so there is no possibility of it going negative. Therefore, no consensus rule + to prevent that eventuality is needed at this time. + + The *total issued supply* of a block chain at block height :math:`\mathsf{height}` + is given by the function: + +.. math:: + + \begin{array}{ll} + \mathsf{IssuedSupply}(\mathsf{height}) := &\!\!\!\!\mathsf{ChainValuePoolBalance^{Transparent}}(\mathsf{height}) \\ + &+\,\; \mathsf{ChainValuePoolBalance^{Sprout}}(\mathsf{height}) \\ + &+\,\; \mathsf{ChainValuePoolBalance^{Sapling}}(\mathsf{height}) \\ + &+\,\; \mathsf{ChainValuePoolBalance^{Orchard}}(\mathsf{height}) \\ + &+\,\; \mathsf{ChainValuePoolBalance^{Deferred}}(\mathsf{height}) + \end{array} + In section **7.1.2 Transaction Consensus Rules** [#protocol-txnconsensus]_, instead of: The total value in zatoshi of transparent outputs from a coinbase transaction, - minus :math:`\mathsf{v^{balanceSapling}}`, minus :math:`\mathsf{v^{balanceOrchard}}`, + minus :math:`\mathsf{v^{balanceSapling}}\!`, minus :math:`\mathsf{v^{balanceOrchard}}\!`, MUST NOT be greater than the value in zatoshi of the block subsidy plus the transaction fees paid by transactions in this block. it will be modified to read: - For the block at height :math:`\mathsf{height}`: + For the block at block height :math:`\mathsf{height}`: - define the "total output value" of its coinbase transaction to be the total value - in zatoshi of its transparent outputs, minus :math:`\mathsf{v^{balanceSapling}}`, - minus :math:`\mathsf{v^{balanceOrchard}}`, plus :math:`\mathsf{totalDeferredOutput}(\mathsf{height})`; + in zatoshi of its transparent outputs, minus :math:`\mathsf{v^{balanceSapling}}\!`, + minus :math:`\mathsf{v^{balanceOrchard}}\!`, plus :math:`\mathsf{totalDeferredOutput}(\mathsf{height})\!`; - define the "total input value" of its coinbase transaction to be the value in zatoshi of the block subsidy, plus the transaction fees paid by transactions in the block. @@ -167,24 +218,10 @@ Section **7.10 Payment of Funding Streams** [#protocol-fundingstreams]_ contains language and definitions copied from ZIP 207; it should be updated to reflect the changes made above. -In section **3.4 Transactions and Treestates** [#protocol-transactions]_, a definition -of "total issued supply" will be added, such that the total issued supply as of a given -height is given by the function: - -.. math:: - - \begin{array}{ll} - \mathsf{IssuedSupply}(\mathsf{height}) := &\!\!\!\!\mathsf{PoolValue}_{Transparent}(\mathsf{height}) \\ - &+\;\; \mathsf{PoolValue}_{Sprout}(\mathsf{height}) \\ - &+\,\; \mathsf{PoolValue}_{Sapling}(\mathsf{height}) \\ - &+\,\; \mathsf{PoolValue}_{Orchard}(\mathsf{height}) \\ - &+\,\; \mathsf{PoolValue}_{Deferred}(\mathsf{height}) - \end{array} - The second paragraph of section **1.2 High-level Overview** [#protocol-overview]_ -should also be updated to take into account the deferred chain value pool. Since -that section of the specification is entirely non-normative, we do not give the -full wording change here. +should be updated to take into account the deferred chain value pool. Since that +section of the specification is entirely non-normative, we do not give the full +wording change here. References @@ -193,14 +230,20 @@ References .. [#BCP14] `Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words" `_ -.. [#zip-1014] `ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants `_ -.. [#zip-0207] `ZIP 207: Funding Streams `_ -.. [#zip-0207-funding-streams] `ZIP 207: Funding Streams. Section: Funding streams `_ -.. [#zip-0207-consensus-rules] `ZIP 207: Funding Streams. Section: Consensus rules `_ -.. [#draft-nuttycom-funding-allocation] `Draft ZIP: Block Reward Allocation for Non-Direct Development Funding `_ -.. [#zip-2001] `ZIP 2001: Lockbox Funding Streams `_ -.. [#protocol-overview] `Zcash Protocol Specification, Version 2023.4.0. Section 1.2: High-level Overview ` -.. [#protocol-transactions] `Zcash Protocol Specification, Version 2023.4.0. Section 3.4: Transactions and Treestates ` -.. [#protocol-txnconsensus] `Zcash Protocol Specification, Version 2023.4.0. Section 7.1.2: Transaction Consensus Rules ` -.. [#protocol-subsidies] `Zcash Protocol Specification, Version 2023.4.0. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders’ Reward ` -.. [#protocol-fundingstreams] `Zcash Protocol Specification, Version 2023.4.0. Section 7.10: Payment of Funding Streams ` +.. [#protocol-overview] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 1.2: High-level Overview ` +.. [#protocol-transactions] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.4: Transactions and Treestates ` +.. [#protocol-coinbasetransactions] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.11: Coinbase Transactions and Issuance ` +.. [#protocol-chainvaluepoolbalances] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.17: Chain Value Pool Balances ` +.. [#protocol-transparentaddrencoding] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.6.1.1: Transparent Addresses ` +.. [#protocol-saplingpaymentaddrencoding] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.6.3.1: Sapling Payment Addresses ` +.. [#protocol-txnconsensus] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.1.2: Transaction Consensus Rules ` +.. [#protocol-subsidies] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.8: Calculation of Block Subsidy, Funding Streams, and Founders’ Reward ` +.. [#protocol-fundingstreams] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.10: Payment of Funding Streams ` +.. [#zip-0207] `ZIP 207: Funding Streams ` +.. [#zip-0207-funding-streams] `ZIP 207: Funding Streams. Section: Funding streams ` +.. [#zip-0207-consensus-rules] `ZIP 207: Funding Streams. Section: Consensus rules ` +.. [#zip-0207-deployment] `ZIP 207: Funding Streams. Section: Deployment ` +.. [#zip-0253] `ZIP 253: Deployment of the NU6 Network Upgrade ` +.. [#zip-1014] `ZIP 1014: Establishing a Dev Fund for ECC, ZF, and Major Grants ` +.. [#zip-1015] `ZIP 1015: Block Reward Allocation for Non-Direct Development Funding ` +.. [#zip-2001] `ZIP 2001: Lockbox Funding Streams `