diff --git a/.gitignore b/.gitignore index 58c8a585c..57bbccb2c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,10 +20,13 @@ *.save *.save.* *~ +*.html.temp .Makefile.uptodate .zipfilelist.* .draftfilelist.* +MultiMarkdown-6 + protocol/aux/ protocol/protocol.ver diff --git a/Dockerfile b/Dockerfile index 48fd6085e..af77cee29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,10 @@ FROM debian:latest RUN apt-get update RUN apt-get install -y \ - gawk \ perl \ sed \ git \ + cmake \ python3 \ python3-pip \ pandoc \ @@ -18,7 +18,12 @@ RUN apt-get install -y \ texlive-bibtex-extra RUN rm /usr/lib/python3.11/EXTERNALLY-MANAGED -RUN pip install rst2html5 +RUN pip install 'docutils==0.21.2' 'rst2html5==2.0.1' + +RUN git config --global --add safe.directory /zips + +# Use a fork so that we're running pinned code. +RUN git clone -b develop https://github.com/Electric-Coin-Company/MultiMarkdown-6 && cd MultiMarkdown-6 && make release && cd build && make && make install ENV PATH=${PATH}:/root/.local/bin diff --git a/Makefile b/Makefile index 91414311a..a887b8087 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ -# Dependencies: see zip-guide.rst and protocol/README.rst +# Dependencies: see zips/zip-guide.rst and protocol/README.rst + +MARKDOWN_OPTION?=--mmd .PHONY: all-zips all tag-release protocol all-protocol discard all-zips: .Makefile.uptodate @@ -31,30 +33,18 @@ all-specs: all-zips discard: git checkout -- 'rendered/*.html' 'README.rst' 'rendered/protocol/*.pdf' -.Makefile.uptodate: Makefile edithtml.sh +.Makefile.uptodate: Makefile render.sh $(MAKE) clean touch .Makefile.uptodate -define PROCESSRST -$(eval TITLE := $(shell echo '$(patsubst zips/%,%,$(basename $<))' | sed -E 's|zip-0{0,3}|ZIP |;s|draft-|Draft |')$(shell grep -E '^(\.\.)?\s*Title: ' $< |sed -E 's|.*Title||')) -rst2html5 -v --title="$(TITLE)" $< >$@ -./edithtml.sh --rst $@ -endef - -define PROCESSMD -$(eval TITLE := $(shell echo '$(patsubst zips/%,%,$(basename $<))' | sed -E 's|zip-0{0,3}|ZIP |;s|draft-|Draft |')$(shell grep -E '^(\.\.)?\s*Title: ' $< |sed -E 's|.*Title||')) -pandoc --from=markdown --to=html $< --output=$@ -./edithtml.sh --md $@ "${TITLE}" -endef - -rendered/index.html: README.rst edithtml.sh - $(PROCESSRST) +rendered/index.html: README.rst render.sh + ./render.sh --rst $< $@ -rendered/%.html: zips/%.rst edithtml.sh - $(PROCESSRST) +rendered/%.html: zips/%.rst render.sh + ./render.sh --rst $< $@ -rendered/%.html: zips/%.md edithtml.sh - $(PROCESSMD) +rendered/%.html: zips/%.md render.sh + ./render.sh $(MARKDOWN_OPTION) $< $@ README.rst: .zipfilelist.current .draftfilelist.current makeindex.sh README.template $(wildcard zips/zip-*.rst) $(wildcard zips/zip-*.md) $(wildcard zips/draft-*.rst) $(wildcard zips/draft-*.md) ./makeindex.sh | cat README.template - >README.rst diff --git a/README.rst b/README.rst index ea74f770f..e9376841c 100644 --- a/README.rst +++ b/README.rst @@ -123,7 +123,7 @@ Released ZIPs
[^<]*
[^<]*)?)[^<]*
[^<]*)?)[^<]*
[^<]*)?)Implementors should note that this ZIP is consistently little-endian (in keeping with the Sapling and Orchard specifications), which is the opposite of BIP 32.
We adapt the path notation of BIP 32 2 to describe shielded HD paths, using prime marks ( - \('\) + \(\kern-0.1em{}'\!\) ) to indicate hardened derivation ( - \(i' = i + 2^{31}\) + \(\!i' = i + 2^{31}\!\) ) as in BIP 44 5:
We represent a Sapling extended spending key as - \((\mathsf{ask, nsk, ovk, dk, c})\) + \((\mathsf{ask, nsk, ovk, dk, c})\!\) , where \((\mathsf{ask, nsk, ovk})\) is the normal Sapling expanded spending key, @@ -211,7 +213,7 @@ \(\mathsf{c}\) is the chain code.
We represent a Sapling extended full viewing key as - \((\mathsf{ak, nk, ovk, dk, c})\) + \((\mathsf{ak, nk, ovk, dk, c})\!\) , where \((\mathsf{ak, nk, ovk})\) is the normal Sapling full viewing key, @@ -245,40 +247,40 @@ be a seed byte sequence of a chosen length, which MUST be at least 32 and at most 252 bytes.
Note that the master extended key is invalid if \(\mathsf{ask}_m\) is - \(0\) + \(0\!\) , or if the corresponding \(\mathsf{ivk}\) derived as specified in 11 is - \(0\) + \(0\!\) .
As in BIP 32, the method for deriving a child extended key, given a parent extended key and an index - \(i\) + \(i\!\) , depends on the type of key being derived, and whether this is a hardened or non-hardened derivation.
\(\mathsf{CKDsk}((\mathsf{ask}_{par}, \mathsf{nsk}_{par}, \mathsf{ovk}_{par}, \mathsf{dk}_{par}, \mathsf{c}_{par}), i)\) \(\rightarrow (\mathsf{ask}_i, \mathsf{nsk}_i, \mathsf{ovk}_i, \mathsf{dk}_i, \mathsf{c}_i)\) -
+ :Note that the child extended key is invalid if \(\mathsf{ask}_i\) is - \(0\) + \(0\!\) , or if the corresponding \(\mathsf{ivk}\) derived as specified in 11 is - \(0\) + \(0\!\) .
\(\mathsf{CKDfvk}((\mathsf{ak}_{par}, \mathsf{nk}_{par}, \mathsf{ovk}_{par}, \mathsf{dk}_{par}, \mathsf{c}_{par}), i)\) \(\rightarrow (\mathsf{ak}_{i}, \mathsf{nk}_{i}, \mathsf{ovk}_{i}, \mathsf{dk}_{i}, \mathsf{c}_{i})\) -
+ :Note that the child extended key is invalid if @@ -489,7 +491,7 @@ is the zero point of Jubjub, or if the corresponding \(\mathsf{ivk}\) derived as specified in 11 is - \(0\) + \(0\!\) .
This design uses the same technique as non-hardened derivation to obtain a full viewing key with the same spend authority (the private key corresponding to - \(\mathsf{ak}\) + \(\mathsf{ak}\!\) ) as the original, but viewing authority only for internal transfers.
The values of - \(I\) + \(I\!\) , - \(I_\mathsf{nsk}\) + \(I_\mathsf{nsk}\!\) , and \(R\) are the same between deriving a full viewing key, and deriving the corresponding spending key. Both of these derivations are shown in the following diagram:
@@ -544,35 +546,35 @@ is the zero point of Jubjub, or if the corresponding \(\mathsf{ivk_{internal}}\) derived from the internal full viewing key as specified in 11 is - \(0\) + \(0\!\) .The 88-bit diversifiers for a Sapling extended key are derived from its diversifier key - \(\mathsf{dk}\) + \(\mathsf{dk}\!\) . To prevent the diversifier leaking how many diversified addresses have already been generated for an account, we make the sequence of diversifiers pseudorandom and uncorrelated to that of any other account. In order to reach the maximum possible diversifier range without running into repetitions due to the birthday bound, we use FF1-AES256 as a Pseudo-Random Permutation as follows:
A valid diversifier \(d_j\) is one for which - \(\mathsf{DiversifyHash^{Sapling}}(d_j) \neq \bot\) + \(\mathsf{DiversifyHash^{Sapling}}(d_j) \neq \bot\!\) . For a given - \(\mathsf{dk}\) + \(\mathsf{dk}\!\) , approximately half of the possible values of \(j\) yield valid diversifiers.
The default diversifier for a Sapling extended key is defined to be - \(d_j\) + \(d_j\!\) , where \(j\) is the least nonnegative integer yielding a valid diversifier.
@@ -591,7 +593,7 @@\(\mathsf{MKGh}^\mathsf{Context}(\mathsf{IKM}) \rightarrow (\mathsf{sk}_m, \mathsf{c}_m)\) -
+ :\(\mathsf{CKDh}^\mathsf{Context}((\mathsf{sk}_{par}, \mathsf{c}_{par}), i)\) \(\rightarrow (\mathsf{sk}_i, \mathsf{c}_i)\) -
+ :\(\mathsf{CKDsk}((\mathsf{sk}_{par}, \mathsf{c}_{par}), i)\) \(\rightarrow (\mathsf{sk}_{i}, \mathsf{c}_i)\) -
+ :The result of applying \(\mathsf{DeriveInternalFVK^{Orchard}}\) to the external full viewing key is the internal full viewing key. The corresponding expanded internal spending key is - \((\mathsf{ask}, \mathsf{nk}, \mathsf{rivk_{internal}})\) - ,
+ \((\mathsf{ask}, \mathsf{nk}, \mathsf{rivk_{internal}})\!\) + .Unlike Sapling internal key derivation, we do not base this internal key derivation procedure on non-hardened derivation, which is not defined for Orchard. We can obtain the desired separation of viewing authority by modifying only the
\(\mathsf{rivk_{internal}}\)
field relative to the external full viewing key, which results in different
- \(\mathsf{dk_{internal}}\)
+ \(\mathsf{dk_{internal}}\!\)
,
\(\mathsf{ivk_{internal}}\)
and
@@ -755,27 +757,27 @@
As with Sapling, we define a mechanism for deterministically deriving a sequence of diversifiers, without leaking how many diversified addresses have already been generated for an account. Unlike Sapling, we do so by deriving a diversifier key directly from the full viewing key, instead of as part of the extended spending key. This means that the full viewing key provides the capability to determine the position of a diversifier within the sequence, which matches the capabilities of a Sapling extended full viewing key but simplifies the key structure. Given an Orchard extended spending key
- \((\mathsf{sk}_i, \mathsf{c}_i)\)
+ \((\mathsf{sk}_i, \mathsf{c}_i)\!\)
: Note that unlike Sapling, all Orchard diversifiers are valid, and thus all possible values of
@@ -799,7 +801,7 @@
\(\mathsf{Arbitrary.MKGDomain} = \texttt{âZcashArbitraryKDâ}\)
Orchard diversifier derivation
\(\mathsf{CKDarb}((\mathsf{sk}_{par}, \mathsf{c}_{par}), i)\) \(\rightarrow (\mathsf{sk}_i, \mathsf{c}_i)\) -
+ :Sapling and Orchard key paths have the following three path levels at the top, all of which use hardened derivation:
Sapling provides a mechanism to allow the efficient creation of diversified payment addresses with the same spending authority. A group of such addresses shares the same full viewing key and incoming viewing key, and so creating as many unlinkable addresses as needed does not increase the cost of scanning the block chain for relevant transactions.
The above key path levels include an account identifier, which in all user interfaces is represented as a "bucket of funds" under the control of a single spending authority. Therefore, wallets implementing Sapling ZIP 32 derivation MUST support the following path for any account in range - \(\{ 0\,.\!. 2^{31} - 1 \}\) + \(\{ 0\,..\, 2^{31} - 1 \}\!\) :
Furthermore, wallets MUST support generating the default payment address (corresponding to the default diversifier as defined above) for any account they support. They MAY also support generating a stream of payment addresses for a given account, if they wish to maintain the user experience of giving a unique address to each recipient.
@@ -882,23 +884,23 @@ path level as in 5:zcashd version 4.6.0 and later uses this to derive "legacy" Sapling addresses from a mnemonic seed phrase under account - \(\mathtt{0x7FFFFFFF}\) + \(\mathtt{0x7FFFFFFF}\!\) , using hardened derivation for - \(address\_index\) + \(address\_index\!\) .
Orchard supports diversified addresses with the same spending authority (like Sapling). A group of such addresses shares the same full viewing key and incoming viewing key, and so creating as many unlinkable addresses as needed does not increase the cost of scanning the block chain for relevant transactions.
The above key path levels include an account identifier, which in all user interfaces is represented as a "bucket of funds" under the control of a single spending authority. Therefore, wallets implementing Orchard ZIP 32 derivation MUST support the following path for any account in range - \(\{ 0\,.\!. 2^{31} - 1 \}\) + \(\{ 0\,..\, 2^{31} - 1 \}\!\) :
Furthermore, wallets MUST support generating the default payment address (corresponding to the default diversifier for Orchard) for any account they support. They MAY also support generating a stream of diversified payment addresses for a given account, if they wish to enable users to give a unique address to each recipient.
@@ -914,7 +916,7 @@ (as specified in 18) is given by:It MAY be used to uniquely identify a particular Sapling full viewing key.
@@ -926,7 +928,7 @@ (as specified in 20) is given by:It MAY be used to uniquely identify a particular Orchard full viewing key.
@@ -938,8 +940,8 @@ of a hierarchical deterministic wallet is given by:It MAY be used to uniquely identify a particular hierarchical deterministic wallet.
@@ -951,13 +953,13 @@The following encodings are analogous to the xprv
and xpub
encodings defined in BIP 32 for transparent keys and addresses. Each key type has a raw representation and a Bech32 7 encoding.
A Sapling extended spending key - \((\mathsf{ask, nsk, ovk, dk, c})\) + \((\mathsf{ask, nsk, ovk, dk, c})\!\) , at depth - \(depth\) + \(depth\!\) , with parent full viewing key tag \(parent\_fvk\_tag\) and child number - \(i\) + \(i\!\) , is represented as a byte sequence:
For the master extended spending key, \(depth\) is - \(0\) + \(0\!\) , \(parent\_fvk\_tag\) is 4 zero bytes, and \(i\) is - \(0\) + \(0\!\) .
When encoded as Bech32, the Human-Readable Part is secret-extended-key-main
for the production network, or secret-extended-key-test
for the test network.
A Sapling extended full viewing key - \((\mathsf{ak, nk, ovk, dk, c})\) + \((\mathsf{ak, nk, ovk, dk, c})\!\) , at depth - \(depth\) + \(depth\!\) , with parent full viewing key tag \(parent\_fvk\_tag\) and child number - \(i\) + \(i\!\) , is represented as a byte sequence:
For the master extended full viewing key, \(depth\) is - \(0\) + \(0\!\) , \(parent\_fvk\_tag\) is 4 zero bytes, and \(i\) is - \(0\) + \(0\!\) .
When encoded as Bech32, the Human-Readable Part is zxviews
for the production network, or zxviewtestsapling
for the test network.
An Orchard extended spending key - \((\mathsf{sk, c})\) + \((\mathsf{sk, c})\!\) , at depth - \(depth\) + \(depth\!\) , with parent full viewing key tag \(parent\_fvk\_tag\) and child number - \(i\) + \(i\!\) , is represented as a byte sequence:
For the master extended spending key, \(depth\) is - \(0\) + \(0\!\) , \(parent\_fvk\_tag\) is 4 zero bytes, and \(i\) is - \(0\) + \(0\!\) .
When encoded as Bech32, the Human-Readable Part is secret-orchard-extsk-main
for Mainnet, or secret-orchard-extsk-test
for Testnet.
We define this encoding for completeness, however given that it includes the capability to derive child spending keys, we expect that most wallets will only expose the regular Orchard spending key encoding to users 21.
@@ -1049,17 +1051,17 @@zxsprout
and zxtestsprout
, formerly specified for Sprout extended spending keys on Mainnet and Testnet respectively.Transactions that have insufficient fees are often not mined. This indeterminism is a source of confusion for users and wallets. Allowing a transaction to set a block height after which it cannot be mined would provide certainty around how long a transaction has to confirm before it is rejected by the network and must be re-sent.
Advantages include optimizing mempool performance by removing transactions that will not be mined, and potentially simplifying bidirectional payment channels by reducing the need to store and compress revocations for past states, since transactions not committed to the chain could expire and become invalid after a period of time.
If the expiry is at block height - \(N\) + \(N\!\!\) , then the transaction must be included in block \(N\) or earlier. Block \(N+1\) will be too late, and the transaction will be removed from the mempool.
The new consensus rule will enforce that the transaction will not be considered valid if included in block of height greater than - \(N\) + \(N\!\!\) , and blocks that include expired transactions will not be considered valid.
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.
+As of NU6, ZIP 1015 21 directs part of the block subsidy 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.
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.
@@ -59,13 +61,13 @@ \(\mathsf{BlockSubsidy}(\mathsf{height})\)We also define the following function:
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.
-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.
+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 7) to be paid by an output in the coinbase transaction, or the identifier + \(\mathsf{DEFERRED\_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:
-This has the property that all active funding streams change the address they are using on the same block height schedule, aligned to the height of the first halving so that 48 funding periods fit cleanly within a halving interval. This can be leveraged to simplify implementations, by batching the necessary outputs for each funding period.
Below is a visual representation of how stream addresses align with funding periods:
@@ -207,21 +209,21 @@ where \(\mathsf{DeferredFundingStreams}(\mathsf{height})\) is the set of funding streams with recipient identifier - \(\mathsf{DEFERRED}\_\mathsf{POOL}\) + \(\mathsf{DEFERRED\_POOL}\) in the block at height - \(\mathsf{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}\) + \(\mathsf{DEFERRED\_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})\) + \(\sum_{\mathsf{h} = 0}^{\mathsf{height}} \mathsf{totalDeferredOutput}(\mathsf{h})\!\) .
Note: \(\mathsf{totalDeferredOutput}(\mathsf{h})\) @@ -230,18 +232,18 @@ prior to NU6 activation.
Prior to activation of the Canopy network upgrade, the existing consensus rule for payment of the original Founders' Reward is enforced. 10
+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:
OP_HASH160 RedeemScriptHash(height) OP_EQUAL
as the scriptPubKey
.These rules are reproduced in [#protocol-fundingstreams].
+These rules are reproduced in 11.
The effect of the definition of \(\mathsf{ChainValuePoolBalance^{Deferred}}\) above is that payments to the - \(\mathsf{DEFERRED}\_\mathsf{POOL}\) + \(\mathsf{DEFERRED\_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
+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
This proposal was initially deployed with Canopy. 18
-Changes to support deferred funding streams are to be deployed with NU6. 19
+This proposal was initially deployed with Canopy. 18
+Changes to support deferred funding streams are to be deployed with NU6. 19
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.
@@ -291,7 +293,7 @@The changes described in this section are to be made in the Zcash Protocol Specification 3, relative to the pre-Blossom specification in [#preblossom-protocol].
Throughout the specification, rename HalvingInterval to PreBlossomHalvingInterval, and rename PoWTargetSpacing to PreBlossomTargetSpacing. These constants retain their values from 2 of 840000 (blocks) and 150 (seconds) respectively.
-In section 2 (Notation), add BlossomActivationHeight and PostBlossomPoWTargetSpacing to the list of integer constants.
-In section 5.3 (Constants), define PostBlossomPoWTargetSpacing := 75 seconds.
-For a given network (production or test), define BlossomActivationHeight as the height at which Blossom activates on that network, as specified in 11.
+Throughout the specification, rename + \(\mathsf{HalvingInterval}\) + to + \(\mathsf{PreBlossomHalvingInterval}\!\) + , and rename + \(\mathsf{PoWTargetSpacing}\) + to + \(\mathsf{PreBlossomTargetSpacing}\!\) + . These constants retain their values from 2 of + \(840000\) + (blocks) and + \(150\) + (seconds) respectively.
+In section 2 (Notation), add + \(\mathsf{BlossomActivationHeight}\) + and + \(\mathsf{PostBlossomPoWTargetSpacing}\) + to the list of integer constants.
+In section 5.3 (Constants), define + \(\mathsf{PostBlossomPoWTargetSpacing} := 75\) + seconds.
+For a given network (production or test), define + \(\mathsf{BlossomActivationHeight}\) + as the height at which Blossom activates on that network, as specified in 11.
In section 7.6.3 (Difficulty adjustment) [later moved to section 7.7.3], make the following changes:
-Define IsBlossomActivated(height) to return true if height ⼠BlossomActivationHeight, otherwise false.
-This specification assumes that BlossomActivationHeight ⼠SlowStartInterval.
+Define + \(\mathsf{IsBlossomActivated}(\mathsf{height})\) + to return true if + \(\mathsf{height} \geq \mathsf{BlossomActivationHeight}\!\) + , otherwise false.
+This specification assumes that + \(\mathsf{BlossomActivationHeight} \geq \mathsf{SlowStartInterval}\!\) + .
Define:
In the same section, redefine PoWTargetSpacing as a function taking a height parameter, as follows:
-Also redefine AveragingWindowTimespan, MinActualTimespan, MaxActualTimespan, ActualTimespanDamped, ActualTimespanBounded, and Threshold as follows:
-In section 7.7 (Calculation of Block Subsidy and Foundersâ Reward) [later moved to section 7.8], redefine the Halving and BlockSubsidy functions as follows:
+In the same section, redefine $mathsf{PoWTargetSpacing} as a function taking a + \(\mathsf{height}\) + parameter, as follows:
+Also redefine + \(\mathsf{AveragingWindowTimespan}\!\) + , + \(\mathsf{MinActualTimespan}\!\) + , + \(\mathsf{MaxActualTimespan}\!\) + , + \(\mathsf{ActualTimespanDamped}\!\) + , + \(\mathsf{ActualTimespanBounded}\!\) + , and + \(\mathsf{Threshold}\) + as follows:
Note: BlossomActivationHeight, PostBlossomHalvingInterval, and PostBlossomTargetSpacing are chosen so that:
+In section 7.7 (Calculation of Block Subsidy and Foundersâ Reward) [later moved to section 7.8], redefine the + \(\mathsf{Halving}\) + and + \(\mathsf{BlockSubsidy}\) + functions as follows:
+Note: + \(\mathsf{BlossomActivationHeight}\!\) + , + \(\mathsf{PostBlossomHalvingInterval}\!\) + , and + \(\mathsf{PostBlossomTargetSpacing}\) + are chosen so that:
In section 7.8 (Payment of Foundersâ Reward) [later moved to section 7.9], define:
-and in the definition of FounderAddressIndex, replace the use of height with FounderAddressAdjustedHeight(height).
+and in the definition of + \(\mathsf{FounderAddressIndex}\!\) + , replace the use of + \(\mathsf{height}\) + with + \(\mathsf{FounderAddressAdjustedHeight}(\mathsf{height})\!\) + .
Also define:
Replace the first note in that section with:
and in the second note, replace SlowStartShift + PreBlossomHalvingInterval - 1 with FoundersRewardLastBlockHeight.
+and in the second note, replace + \(\mathsf{SlowStartShift} + \mathsf{PreBlossomHalvingInterval} - 1\) + with + \(\mathsf{FoundersRewardLastBlockHeight}\!\) + .
The difficulty adjustment parameters PoWAveragingWindow and PoWMedianBlockSpan refer to numbers of blocks, but do not change at Blossom activation. This is because the amount of damping/averaging required is expected to be roughly the same, in terms of the number of blocks, after the change in block target spacing.
-The change in the effective value of PoWTargetSpacing will cause the block spacing to adjust to the new target, at the normal rate for a difficulty adjustment. The results of simulations are consistent with this expected behaviour.
-Note that the change in AveragingWindowTimespan(height) takes effect immediately when calculating the target difficulty starting from the block at the Blossom activation height, even though the difficulty of the preceding PoWAveragingWindow blocks will have been adjusted using the pre-Blossom target spacing. Therefore it is likely that the difficulty adjustment for the first few blocks after activation will be limited by PoWMaxAdjustDown. This is not anticipated to cause any problem.
+The difficulty adjustment parameters + \(\mathsf{PoWAveragingWindow}\) + and + \(\mathsf{PoWMedianBlockSpan}\) + refer to numbers of blocks, but do not change at Blossom activation. This is because the amount of damping/averaging required is expected to be roughly the same, in terms of the number of blocks, after the change in block target spacing.
+The change in the effective value of + \(\mathsf{PoWTargetSpacing}\) + will cause the block spacing to adjust to the new target, at the normal rate for a difficulty adjustment. The results of simulations are consistent with this expected behaviour.
+Note that the change in + \(\mathsf{AveragingWindowTimespan(\mathsf{height})\) + takes effect immediately when calculating the target difficulty starting from the block at the Blossom activation height, even though the difficulty of the preceding + \(\mathsf{PoWAveragingWindow}\) + blocks will have been adjusted using the pre-Blossom target spacing. Therefore it is likely that the difficulty adjustment for the first few blocks after activation will be limited by + \(\mathsf{PoWMaxAdjustDown}\!\) + . This is not anticipated to cause any problem.
On Testnet from block height 299188 onward, the difficulty adjustment algorithm 6 allows minimum-difficulty blocks, as described in 10, when the block time is greater than a given threshold. This specification changes this threshold to be proportional to the block target spacing.
-That is, if the block time of a block at height height ⼠299188 is greater than 6 ¡ PoWTargetSpacing(height) seconds after that of the preceding block, then the block is a minimum-difficulty block. In that case its nBits
field MUST be set to ToCompact(PoWLimit), where PoWLimit is the value defined for Testnet in section 5.3 of the Zcash Protocol Specification 5, and ToCompact is as defined in section 7.7.4 of that specification 7.
That is, if the block time of a block at height
+ \(\mathsf{height} \geq 299188\)
+ is greater than
+ \(6 \cdot \mathsf{PoWTargetSpacing}(\mathsf{height})\)
+ seconds after that of the preceding block, then the block is a minimum-difficulty block. In that case its nBits
field MUST be set to
+ \(\mathsf{ToCompact}(\mathsf{PoWLimit})\!\)
+ , where
+ \(\mathsf{PoWLimit}\)
+ is the value defined for Testnet in section 5.3 of the Zcash Protocol Specification 5, and
+ \(\mathsf{ToCompact}\)
+ is as defined in section 7.7.4 of that specification 7.
Note: a previous revision of this ZIP (and 10) incorrectly said that only the target threshold of minimum-difficulty blocks is affected. In fact the nBits
field is modified as well, and this affects difficulty adjustment for subsequent blocks.
This change does not affect Mainnet.
If pruning is enabled, when zcashd responds to an "getblocks" peer-to-peer message, it will only include blocks that it has on disk, and is likely to still have on disk an hour after responding to the message:
// If pruning, don't inv blocks unless we have on disk and are likely to still have // for some reasonable time window (1 hour) that block relay might require.-
For each block, when estimating whether it will still be on disk after an hour, we take MIN_BLOCKS_TO_KEEP = 288 blocks, minus approximately the number of blocks expected in one hour at the target block spacing as of that block. Around Blossom activation, this might underestimate the number of blocks in the next hour, but given the value of MIN_BLOCKS_TO_KEEP, this is not anticipated to cause any problem.
+For each block, when estimating whether it will still be on disk after an hour, we take MIN_BLOCKS_TO_KEEP = + \(288\) + blocks, minus approximately the number of blocks expected in one hour at the target block spacing as of that block. Around Blossom activation, this might underestimate the number of blocks in the next hour, but given the value of MIN_BLOCKS_TO_KEEP, this is not anticipated to cause any problem.
zcashd uses the EstimateNetHeight
function to estimate the approximate height of the fully synced chain, so that the progress of block download can be displayed to the node operator. This function has been rewritten, simplified, and changed to take account of cases where the time period that needs to be estimated crosses Blossom activation.
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.
14 | -ZIP 1015: Block Reward Allocation for Non-Direct Development Funding | +ZIP 1015: Block Subsidy Allocation for Non-Direct Development Funding |
---|
Note: the alternate validation equation - \([S]B = R + [k]A\) + \([S]B = R + [k]A\!\) , allowed by RFC 8032, MUST NOT be used.
Each of these has a single non-canonical encoding in which the value of the sign bit is - \(1\) + \(1\!\) .
This creates a consensus issue because (unlike other non-canonical point encodings that are rejected) either of the above encodings can be decoded, and then re-encoded to a different encoding. For example, if a non-canonical encoding appeared in a transaction field, then node implementations that store points internally as abstract curve points, and used those to derive transaction IDs, would derive different IDs than nodes which store transactions as bytes (such as zcashd).
This issue is not known to cause any security vulnerability, beyond the risk of consensus incompatibility. In fact, for some of the fields that would otherwise be affected, the issue does not occur because there are already consensus rules that prohibit small-order points, and this incidentally prohibits non-canonical encodings.
@@ -53,25 +55,25 @@Let - \(\mathsf{abst}_{\mathbb{J}}\) + \(\mathsf{abst}_{\mathbb{J}}\!\) , - \(\mathsf{repr}_{\mathbb{J}}\) + \(\mathsf{repr}_{\mathbb{J}}\!\) , and \(q_{\mathbb{J}}\) be as defined in 6.
Define a non-canonical compressed encoding of a Jubjub point to be a sequence of \(256\) bits, - \(b\) + \(b\!\) , such that \(\mathsf{abst}_{\mathbb{J}}(b) \neq \bot\) and - \(\mathsf{repr_{\mathbb{J}}}\big(\mathsf{abst}_{\mathbb{J}}(b)\big) \neq b\) + \(\mathsf{repr_{\mathbb{J}}}\big(\mathsf{abst}_{\mathbb{J}}(b)\big) \neq b\!\) .
Non-normative note: There are two such bit sequences, \(\mathsf{I2LEOSP}_{\ell_{\mathbb{J}}}(2^{255} + 1)\) and - \(\mathsf{I2LEOSP}_{\ell_{\mathbb{J}}}(2^{255} + q_{\mathbb{J}} - 1)\) + \(\mathsf{I2LEOSP}_{\ell_{\mathbb{J}}}(2^{255} + q_{\mathbb{J}} - 1)\!\) . The Sapling protocol uses little-endian ordering when converting between bit and byte sequences, so the first of these sequences corresponds to a \(\mathtt{0x01}\) byte, followed by @@ -110,7 +112,7 @@
@@ -136,20 +138,20 @@ \(\mathtt{cv}\)
- - \(\mathsf{pk}\star_{\mathsf{d}}\) + \(\mathsf{pk}\star_{\mathsf{d}}\!\) .
These fields cannot by consensus contain small-order points. All of the points with non-canonical encodings are small-order.
Implementations MAY choose to reject non-canonical encodings of the above four fields early in decoding of a transaction. This eliminates the risk that parts of the transaction could be re-serialized from their internal representation to a different byte sequence than in the original transaction, e.g. when calculating transaction IDs.
In addition, Sapling addresses and full viewing keys MUST be considered invalid when imported if they contain non-canonical Jubjub point encodings, or encodings of points that are not in the prime-order subgroup - \(\mathbb{J}^{(r)}\) + \(\mathbb{J}^{(r)}\!\) . These requirements MAY be enforced in advance of NU5 activation.
In Sapling addresses 8:
@@ -157,14 +159,14 @@
- the encoding of - \(\mathsf{pk_d}\) + \(\mathsf{pk_d}\!\) .
- the encoding of - \(\mathsf{ak}\) + \(\mathsf{ak}\!\) .
( \(\mathsf{ak}\) also MUST NOT encode the zero point - \(\mathcal{O}_{\mathbb{J}}\) + \(\mathcal{O}_{\mathbb{J}}\!\) .)
The above is intended to be a complete list of the places where compressed encodings of Jubjub points occur in the Zcash consensus protocol and in plaintext, address, or key formats.
The necessary checks are very simple and do not require cryptographic operations, therefore the performance impact will be negligible.
The public inputs of Jubjub points to the Spend circuit ( - \(\mathsf{rk}\) + \(\!\mathsf{rk}\) and - \(\mathsf{cv^{old}}\) + \(\mathsf{cv^{old}}\!\) ) and Output circuit ( - \(\mathsf{cv^{new}}\) + \(\!\mathsf{cv^{new}}\) and - \(\mathsf{epk}\) + \(\mathsf{epk}\!\) ) are not affected because they are represented in affine coordinates as elements of the correct field ( - \(\mathbb{F}_{r_\mathbb{S}} = \mathbb{F}_{q_\mathbb{J}}\) + \(\!\mathbb{F}_{r_\mathbb{S}} = \mathbb{F}_{q_\mathbb{J}}\!\) ), and so no issue of encoding canonicity arises.
Encodings of elliptic curve points on Curve25519, BN-254 - \(\mathbb{G}_1\) + \(\mathbb{G}_1\!\) , BN-254 - \(\mathbb{G}_2\) + \(\mathbb{G}_2\!\) , BLS12-381 - \(\mathbb{G}_1\) + \(\mathbb{G}_1\!\) , and BLS12-381 \(\mathbb{G}_2\) are not affected.
diff --git a/rendered/zip-0221.html b/rendered/zip-0221.html index a4e119e7b..400295cfc 100644 --- a/rendered/zip-0221.html +++ b/rendered/zip-0221.html @@ -3,7 +3,9 @@An MMR is a Merkle tree which allows for efficient appends, proofs, and verifications. Informally, appending data to an MMR consists of creating a new leaf and then iteratively merging neighboring subtrees with the same size. This takes at most \(\log(n)\) operations and only requires knowledge of the previous subtree roots, of which there are fewer than - \(\log(n)\) + \(\log(n)\!\) .
(example adapted from 6) To illustrate this, consider a list of 11 leaves. We first construct the biggest perfect binary subtrees possible by joining any balanced sibling trees that are the same size. We do this starting from the left to the right, adding a parent as soon as 2 children exist. This leaves us with three subtrees ("mountains") of altitudes 3, 1, and 0:
/\ @@ -122,7 +124,7 @@ be the altitude of a given node. We can easily jump to the node's right sibling (if it has one) by adding \(2^{h+1} - 1\) to its position, and its left child (if it has one) by subtracting - \(2^h\) + \(2^h\!\) . This allows us to efficiently find the subtree roots ("peaks") of the mountains.Once we have the positions of the mountain peaks, we "bag" them using the following algorithm:
@@ -162,14 +164,14 @@
The protocol requires that an MMR that commits to the inclusion of all blocks since the preceding network upgrade \((B_x, \ldots, B_{n-1})\) is formed for each block - \(B_n\) + \(B_n\!\) . The root \(M_n\) of the MMR MUST be included in the header of - \(B_n\) + \(B_n\!\) .
( - \(x\) + \(\!x\) is the activation height of the preceding network upgrade.)
FlyClient reduces the number of block headers needed for light client verification of a valid chain, from linear (as in the current reference protocol) to logarithmic in block chain length. This verification is correct with high probability. It also allows creation of subtree proofs, so light clients need only check blocks later than the most recently verified block index. Following that, verification of a transaction inclusion within that block follows the usual reference protocol 13.
A smaller proof size could enable the verification of Zcash SPV Proofs in block-chain protocols such as Ethereum, enabling efficient cross-chain communication and pegs. It also reduces bandwidth and storage requirements for resource-limited clients like mobile or IoT devices.
@@ -184,14 +186,14 @@ of \(B_n\) to be the last network upgrade activation height in the chain that is less than - \(n\) + \(n\!\) . (For this definition, block height \(0\) is considered to be the height of a network upgrade activation. The preceding network upgrade height of the genesis block is undefined.)The leaves of the MMR at block \(B_n\) are hash commitments to the header data and metadata of each previous block - \(B_x, \ldots, B_{n-1}\) + \(B_x, \ldots, B_{n-1}\!\) , where \(x\) is defined as above. We extend the standard MMR to allow metadata to propagate upwards through the tree by either summing the metadata of both children, or inheriting the metadata of a specific child as necessary. This allows us to create efficient proofs of selected properties of a range of blocks without transmitting the entire range of blocks or headers.
@@ -209,7 +211,7 @@- For clarity, in a given consensus branch, the
@@ -286,7 +288,7 @@hashSubtreeCommitment
field of leaf \(n-1\) is precisely equal to thehashPrevBlock
field in the header of the block at height - \(x+n\) + \(x+n\!\) , where \(x\) is the network upgrade activation height of that consensus branch.
- Leaf node
- The protocol-defined work of the block: - \(\mathsf{floor}(2^{256} / (\mathsf{ToTarget}(\mathsf{nBits}) + 1))\) + \(\mathsf{floor}(2^{256} / (\mathsf{ToTarget}(\mathsf{nBits}) + 1))\!\) . 4
- Internal or root node
- @@ -462,9 +464,9 @@
With each new block
- \(B_n\)
+ \(B_n\!\)
, we append a new MMR leaf node corresponding to block
- \(B_{n-1}\)
+ \(B_{n-1}\!\)
. The append
operation is detailed below in pseudocode (adapted from 2):
def get_peaks(node: ZcashMMRNode) -> List[ZcashMMRNode]: peaks: List[ZcashMMRNode] = [] @@ -600,7 +602,7 @@
hashFinalSaplingRoot
in current Sapling semantics.The calculation of hashChainHistoryRoot
is not well-defined for the genesis block, since then
\(n = 0\)
and there is no block
- \(B_{n-1}\)
+ \(B_{n-1}\!\)
. Also, in the case of chains that activate this ZIP after genesis (including Zcash Mainnet and Testnet), the hashChainHistoryRoot
of the activation block would commit to the whole previous epoch if a special case were not made. It would be impractical to calculate this commitment all at once, and so we specify that hashLightClientRoot
is set to all zero bytes for that block instead. The hash of the final Sapling note commitment tree root for the activation block will not be encoded in that block, but will be committed to one block later in the hashLatestSaplingRoot
field of the MMR root commitment.
We use the "simplified SWU" algorithm to define an infallible - \(\mathsf{GroupHash}\) + \(\mathsf{GroupHash}\!\) , instead of the fallible BLAKE2s-based mechanism used for Sapling. It is intended to follow (version 10 of) the IETF hash-to-curve Internet Draft 33 (but the protocol specification takes precedence in the case of any discrepancy).
The presence of the curve cycle is an explicit design choice. This proposal only uses half of the cycle (Pallas being an embedded curve of Vesta); the full cycle is expected to be leveraged by future protocol updates.
Orchard notes have the structure - \((addr, v, \rho, \psi, \mathsf{rcm}).\) - \(\rho\) + \((addr, v, \text{Ď}, \text{Ď}, \mathsf{rcm}).\) + \(\text{Ď}\) is set to the nullifier of the spent note in the same action, which ensures it is unique. - \(\psi\) + \(\text{Ď}\) and \(\mathsf{rcm}\) are derived from a random seed (as with Sapling after ZIP 212 30).
@@ -131,7 +133,7 @@Nullifiers for Orchard notes are computed as:
- \(\mathsf{nf} = [F_{\mathsf{nk}}(\rho) + \psi \pmod{p}] \mathcal{G} + \mathsf{cm}\) + \(\mathsf{nf} = [F_{\mathsf{nk}}(\text{Ď}) + \text{Ď} \pmod{p}] \,\mathcal{G} + \mathsf{cm}\)
where \(F\) diff --git a/rendered/zip-0225.html b/rendered/zip-0225.html index 1ab6b9415..2d381715d 100644 --- a/rendered/zip-0225.html +++ b/rendered/zip-0225.html @@ -3,7 +3,9 @@
enableSpendsOrchard
enableOutputsOrchard
0
.sizeProofsOrchard
compactSize
proofsOrchard
. Value is
- \(2720 + 2272 \cdot \mathtt{nActionsOrchard}\)
+ \(2720 + 2272 \cdot \mathtt{nActionsOrchard}\!\)
.valueBalanceSapling
and bindingSigSapling
are present if and only if
- \(\mathtt{nSpendsSapling} + \mathtt{nOutputsSapling} > 0\)
+ \(\mathtt{nSpendsSapling} + \mathtt{nOutputsSapling} > 0\!\)
. If valueBalanceSapling
is not present, then
- \(\mathsf{v^{balanceSapling}}`\)
- is defined to be 0.anchorSapling
is present if and only if
- \(\mathtt{nSpendsSapling} > 0\)
+ \(\mathtt{nSpendsSapling} > 0\!\)
.flagsOrchard
, valueBalanceOrchard
, anchorOrchard
, sizeProofsOrchard
, proofsOrchard
, and bindingSigOrchard
are present if and only if
- \(\mathtt{nActionsOrchard} > 0\)
+ \(\mathtt{nActionsOrchard} > 0\!\)
. If valueBalanceOrchard
is not present, then
\(\mathsf{v^{balanceOrchard}}\)
- is defined to be 0.vSpendProofsSapling
and vSpendAuthSigsSapling
have a 1:1 correspondence to the elements of vSpendsSapling
and MUST be ordered such that the proof or signature at a given index corresponds to the SpendDescriptionV5
at the same index.vOutputProofsSapling
have a 1:1 correspondence to the elements of vOutputsSapling
and MUST be ordered such that the proof at a given index corresponds to the OutputDescriptionV5
at the same index.proofsOrchard
, and the elements of vSpendAuthSigsOrchard
, each have a 1:1 correspondence to the elements of vActionsOrchard
and MUST be ordered such that the proof or signature at a given index corresponds to the OrchardAction
at the same index.enableSpendsOrchard
bit MUST be set to 0
.enableSpendsOrchard
bit MUST be set to
+ \(0\!\)
+ .The encodings of tx_in
, and tx_out
are as in a version 4 transaction (i.e. unchanged from Canopy). The encodings of SpendDescriptionV5
, OutputDescriptionV5
and OrchardAction
are described below. The encoding of Sapling Spends and Outputs has changed relative to prior versions in order to better separate data that describe the effects of the transaction from the proofs of and commitments to those effects, and for symmetry with this separation in the Orchard-related parts of the transaction format.
32
cmu
byte[32]
32
32
cmx
byte[32]
32
ephemeralKey
byte[32]
580
joinSplitPubKey
and joinSplitSig
fields were specified to be present if and only if
- \(\mathtt{nJoinSplit} > 0\)
+ \(\mathtt{nJoinSplit} > 0\!\)
.This Asset Base will be the base point of the value commitment for the specific Custom Asset. Note that the Asset Base of the ZEC Asset will be kept as the original value base point, \(\mathcal{V}^{\mathsf{Orchard}}\!\) @@ -116,27 +118,36 @@
We define the note commitment scheme \(\mathsf{NoteCommit^{OrchardZSA}_{rcm}}\) as follows:
-where \(\mathbb{P}, \ell_{\mathbb{P}}, q_{\mathbb{P}}\) are as defined for the Pallas curve 29, and where - \(\mathsf{NoteCommit^{Orchard}}.\!\mathsf{Trapdoor}\) - and - \(\mathsf{Orchard}.\!\mathsf{Output}\) + \(\mathsf{NoteCommit^{Orchard}.\{Trapdoor, Output\}}\) are as defined in the Zcash protocol specification 19. This note commitment scheme is instantiated using the Sinsemilla Commitment 28 as follows:
-where:
-Note that \(\mathsf{repr}_{\mathbb{P}}\) and @@ -156,7 +167,7 @@ \(\mathsf{NoteCommit^{Orchard}_{rcm}}\) in that for Custom Assets, the Asset Base will be added as an input to the commitment computation. In the case where the Asset is the ZEC Asset, the commitment is computed identically to the Orchard note commitment, without making use of the ZEC Asset Base as an input. As we will see, the nested structure of the Sinsemilla-based commitment 28 allows us to add the Asset Base as a final recursive step.
The note commitment output is still indistinguishable from the original Orchard ZEC note commitments, by definition of the Sinsemilla hash function 26. OrchardZSA note commitments will therefore be added to the same Orchard Note Commitment Tree. In essence, we have:
-This definition can be viewed as a generalization of the Orchard note commitment, and will allow maintaining a single commitment instance for the note commitment, which will be used both for pre-ZSA Orchard and OrchardZSA notes.
where \(\mathsf{v^{net}_{AssetId}} = \mathsf{v^{old}_{AssetId}} - \mathsf{v^{new}_{AssetId}}\) - such that - \(\mathsf{v^{old}_{AssetId}}\) - and - \(\mathsf{v^{new}_{AssetId}}\) - are the values of the old and new notes of Asset Identifier - \(\mathsf{AssetId}\) - respectively,
-- \(\mathsf{AssetBase_{AssetId}}\) - is defined in ZIP 227 5, and
-- \(\mathcal{R}^{\mathsf{Orchard}} := \mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard-cv"}, \texttt{"r"})\!\) - , as in the Orchard protocol.
+ such that +For ZEC, we define \(\mathsf{AssetBase}_{\mathsf{AssetId}} := \mathcal{V}^{\mathsf{Orchard}}\) so that the value commitment for ZEC notes is computed identically to the Orchard protocol deployed in NU5 4. As such @@ -203,7 +217,7 @@ ) that is burnt in the transaction, the sender adds to \(\mathsf{assetBurn}\) the tuple - \((\mathsf{AssetBase}, \mathsf{v})\) + \((\mathsf{AssetBase}, \mathsf{v})\!\) , where \(\mathsf{v}\) is the amount of the Custom Asset the sender wants to burn. We denote by @@ -306,7 +320,7 @@ , \(\mathcal{K}^{\mathsf{Orchard}}\) is the Orchard Nullifier Base as defined in 22, and - \(\mathcal{L}^{\mathsf{Orchard}} := \mathsf{GroupHash^{\mathbb{P}}}(\texttt{"z.cash:Orchard"}, \texttt{"L"})\!\) + \(\mathcal{L}^{\mathsf{Orchard}} := \mathsf{GroupHash^{\mathbb{P}}}(\texttt{âz.cash:Orchardâ}, \texttt{âLâ})\!\) .
In the Orchard protocol, since each Action represents an input and an output, the transaction that wants to send one input to multiple outputs must have multiple inputs. The Orchard protocol gives dummy spend notes 20 to the Actions that have not been assigned input notes.
@@ -384,67 +398,52 @@Senders must not be able to change the Asset Base for the output note in a Split Action. We do this via the following constraints:
Define - \(\mathsf{IssueAuthSig}.\!\mathsf{DerivePublic}\; : \; (\mathsf{isk}\; : \; \mathsf{IssueAuthSig}.\!\mathsf{Private}) \to \mathsf{IssueAuthSig}.\!\mathsf{Public}\) + \(\mathsf{IssueAuthSig.DerivePublic} \;{\small âŚ}\; (\mathsf{isk} \;{\small âŚ}\; \mathsf{IssueAuthSig.Private}) \to \mathsf{IssueAuthSig.Public}\) as:
where the \(\textit{PubKey}\) - algorithm is defined in BIP 340 21. Note that the byte representation of + algorithm is defined in BIP 340 22. Note that the byte representation of \(\mathsf{ik}\) is in big-endian order as defined in BIP 340.
It is possible for the \(\textit{PubKey}\) algorithm to fail with very low probability, which means that - \(\mathsf{IssueAuthSig}.\!\mathsf{DerivePublic}\) + \(\mathsf{IssueAuthSig.DerivePublic}\) could return \(\bot\) with very low probability. If this happens, discard the keys and repeat with a different \(\mathsf{isk}\!\) .
-This allows the issuer to use the same wallet it usually uses to transfer Assets, while keeping a disconnect from the other keys. Specifically, this method is aligned with the requirements and motivation of ZIP 32 2. It provides further anonymity and the ability to delegate issuance of an Asset (or in the future, generate a multi-signature protocol) while the rest of the keys remain in the wallet safe.
+This allows the issuer to use the same wallet it usually uses to transfer Assets, while keeping a disconnect from the other keys. Specifically, this method is aligned with the requirements and motivation of ZIP 32 2. It provides further anonymity and the ability to delegate issuance of an Asset (or in the future, generate a multi-signature protocol) while the rest of the keys remain in the wallet safe.
Define - \(\mathsf{AssetDigest_{AssetId}} := \textsf{BLAKE2b-512}(\texttt{"ZSA-Asset-Digest"},\; \mathsf{EncodeAssetId}(\mathsf{AssetId}))\!\) + \(\mathsf{AssetDigest_{AssetId}} := \textsf{BLAKE2b-512}(\texttt{âZSA-Asset-Digestâ},\; \mathsf{EncodeAssetId}(\mathsf{AssetId}))\!\) , where
The relations between the Asset Identifier, Asset Digest, and Asset Base are shown in the following diagram:
An issuance bundle is the aggregate of all the issuance-related information. Specifically, contains all the issuance actions and the issuer signature on the transaction SIGHASH that validates the issuance itself. It contains the following fields:
vIssueActions
: an array of issuance actions, of type IssueAction
.The issuance bundle is added within the transaction format as a new bundle. The detailed encoding of the issuance bundle as a part of the V6 transaction format is defined in ZIP 230 16.
+The issuance bundle is added within the transaction format as a new bundle. The detailed encoding of the issuance bundle as a part of the V6 transaction format is defined in ZIP 230 16.
The issuer program performs the following operations:
@@ -396,7 +398,7 @@ \(\mathsf{finalize} = 1\!\) ).Issuance requires the following additions to the global state:
A map, - \(\mathsf{issued\_assets} : \mathbb{P}^* \to \{0 .. \mathsf{MAX\_ISSUE}\} \times \mathbb{B} \!\) + \(\mathsf{issued\_assets} : \mathbb{P}^* \to \{0 .. \mathsf{MAX\_ISSUE}\} \times \mathbb{B}\!\) , from the Asset Base, - \(\mathsf{AssetBase} : \mathbb{P}^*\) + \(\mathsf{AssetBase} : \mathbb{P}^*\!\) , to a tuple \((\mathsf{balance}, \mathsf{final})\!\) , for every Asset that has been issued. We use the notation @@ -466,7 +468,7 @@ .
The maximum total supply of any issued Custom Asset is denoted by the constant - \(\mathsf{MAX\_ISSUE} := 2^{64} - 1 \!\) + \(\mathsf{MAX\_ISSUE} := 2^{64} - 1\!\) .
The issuance state, that is, the @@ -481,7 +483,7 @@
We describe the consensus rule changes that govern the management of the global issuance state in the Specification: Consensus Rule Changes section. We use \(\mathsf{issued\_assets}_{\mathsf{IN}}\) and - \(\mathsf{issued\_assets}_{\mathsf{OUT}}\!\) + \(\mathsf{issued\_assets}_{\mathsf{OUT}}\) to denote the input issuance state and output issuance state for a transaction, respectively.
IssueAction
MUST be valid encodings of the types given in Issue Note Description, and MUST encode the same
- \(\mathsf{AssetBase}\)
+ \(\mathsf{AssetBase}\!\)
.IssueAction
:
It is necessary to ensure that the balance of any issued Custom Asset never becomes negative within a shielded pool, along the lines of ZIP 209 8. However, unlike for the shielded ZEC pools, there is no individual transaction field that directly corresponds to both the issued and burnt amounts for a given Asset. Therefore, we require that all nodes maintain a record of the current amount in circulation for every issued Custom Asset, and update this record based on the issuance and burn transactions processed. This allows for efficient detection of balance violations for any Asset, in which scenario we specify a consensus rule to reject the transaction or block.
+It is necessary to ensure that the balance of any issued Custom Asset never becomes negative within a shielded pool, along the lines of ZIP 209 8. However, unlike for the shielded ZEC pools, there is no individual transaction field that directly corresponds to both the issued and burnt amounts for a given Asset. Therefore, we require that all nodes maintain a record of the current amount in circulation for every issued Custom Asset, and update this record based on the issuance and burn transactions processed. This allows for efficient detection of balance violations for any Asset, in which scenario we specify a consensus rule to reject the transaction or block.
We limit the total issuance of any Asset to a maximum of - \(\mathsf{MAX\_ISSUE}\) + \(\mathsf{MAX\_ISSUE}\!\) . This is a practical limit that also allows an issuer to issue the complete supply of an Asset in a single transaction.
Nodes also need to reject transactions that issue Custom Assets that have been previously finalized. The \(\mathsf{issued\_assets}\) @@ -605,7 +607,7 @@
This section details the construction of the subtree of hashes in the transaction digest that corresponds to issuance transaction data. Details of the overall changes to the transaction digest due to the OrchardZSA protocol can be found in ZIP 226 13. As in ZIP 244 18, the digests are all personalized BLAKE2b-256 hashes, and in cases where no elements are available for hashing, a personalized hash of the empty byte array is used.
+This section details the construction of the subtree of hashes in the transaction digest that corresponds to issuance transaction data. Details of the overall changes to the transaction digest due to the OrchardZSA protocol can be found in ZIP 226 13. As in ZIP 244 18, the digests are all personalized BLAKE2b-256 hashes, and in cases where no elements are available for hashing, a personalized hash of the empty byte array is used.
A new issuance transaction digest algorithm is defined that constructs the subtree of the transaction digest tree of hashes for the issuance portion of a transaction. Each branch of the subtree will correspond to a specific subset of issuance transaction data. The overall structure of the hash is as follows; each name referenced here will be described in detail below:
issuance_digest âââ issue_actions_digest @@ -674,7 +676,7 @@In case the transaction has no Issue Notes, ''issue_notes_digest'' is:
BLAKE2b-256("ZTxIdIAcNoteHash", [])T.5a.i.1: recipient
-This is the raw encoding of an Orchard shielded payment address as defined in the protocol specification 27.
+This is the raw encoding of an Orchard shielded payment address as defined in the protocol specification 28.
T.5a.i.2: value
Note value encoded as little-endian 8-byte representation of 64-bit unsigned integer (e.g. u64 in Rust) raw value.
@@ -708,7 +710,7 @@
The per-input transaction digest algorithm to generate the signature digest in ZIP 244 19 is modified so that a signature digest is produced for each transparent input, each Sapling input, each Orchard action, and additionally for each Issuance Action. For Issuance Actions, this algorithm has the exact same output as the transaction digest algorithm, thus the txid may be signed directly.
+The per-input transaction digest algorithm to generate the signature digest in ZIP 244 19 is modified so that a signature digest is produced for each transparent input, each Sapling input, each Orchard action, and additionally for each Issuance Action. For Issuance Actions, this algorithm has the exact same output as the transaction digest algorithm, thus the txid may be signed directly.
The overall structure of the hash is as follows. We highlight the changes for the OrchardZSA protocol via the [ADDED FOR ZSA]
text label, and we omit the descriptions of the sections that do not change for the OrchardZSA protocol:
signature_digest âââ header_digest @@ -723,14 +725,14 @@ S.3: sapling_digest (32-byte hash output) S.4: orchard_digest (32-byte hash output) S.5: issuance_digest (32-byte hash output) [ADDED FOR ZSA]-
The personalization field remains the same as in ZIP 244 18.
+The personalization field remains the same as in ZIP 244 18.
Identical to that specified for the transaction identifier.
In addition to the parameters defined in the Fee calculation section of ZIP 317 20, the OrchardZSA protocol upgrade defines the following additional parameters:
+In addition to the parameters defined in the Fee calculation section of ZIP 317 20, the OrchardZSA protocol upgrade defines the following additional parameters:
Wallets implementing this specification SHOULD use a conventional fee, viz. - \(zsa\_conventional\_fee\) + \(zsa\_conventional\_fee\!\) , that is calculated in zatoshis. Additional definitions that are used in the formula for the calculation are in the table below:
The other inputs to this formula are taken from transaction fields defined in the Zcash protocol specification 28 and the global state. They are defined in the Fee calculation section of ZIP 317 20. Note that - \(nOrchardActions\) +
The other inputs to this formula are taken from transaction fields defined in the Zcash protocol specification 29 and the global state. They are defined in the Fee calculation section of ZIP 317 20. Note that + \(nOrchardActions\!\) , that is used in the computation of - \(logical\_actions\) + \(logical\_actions\!\) , is redefined in the above table, and now combines the actions for native ZEC as well as OrchardZSA transfer actions for Custom Assets.
The formula for the computation of the \(zsa\_logical\_actions\) @@ -840,7 +842,7 @@
For bridging purposes, the secure method of off-boarding Assets is to burn an Asset with the burning mechanism in ZIP 226 10. Users should be aware of issuers that demand the Assets be sent to a specific address on the Zcash chain to be redeemed elsewhere, as this may not reflect the real reserve value of the specific Wrapped Asset.
+For bridging purposes, the secure method of off-boarding Assets is to burn an Asset with the burning mechanism in ZIP 226 10. Users should be aware of issuers that demand the Assets be sent to a specific address on the Zcash chain to be redeemed elsewhere, as this may not reflect the real reserve value of the specific Wrapped Asset.
The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317, and is described in ZIP 230 17.
+The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317, and is described in ZIP 230 17.
21 | +BIP 43: Purpose Field for Deterministic Wallets | +
---|
22 | BIP 340: Schnorr Signatures for secp256k1 |
---|
22 | +23 | Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 2: Notation |
---|
23 | +24 | Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.1: Payment Addresses and Keys |
---|
24 | +25 | Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.2.3: Orchard Key Components |
---|
25 | +26 | Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.10: SIGHASH Transaction Hashing |
---|
26 | +27 | Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.4.9.8: Group Hash into Pallas and Vesta |
---|
27 | +28 | Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.6.4.2: Orchard Raw Payment Addresses |
---|
28 | +29 | Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.1: Transaction Encoding and Consensus |
---|
Version 6 transactions are proposed to be allowed on the network starting from Network Upgrade 7. 12
+TODO
12 | +ZIP 254: Deployment of the NU7 Network Upgrade | +
---|
13 | ZIP 317: Proportional Transfer Fee Mechanism |
---|
13 | +14 | ZIP 317: Proportional Transfer Fee Mechanism, Fee calculation |
---|
Bytes | +Name | +Data Type | +Description | +
---|---|---|---|
1 | + fAllPruned |
+ uint8 |
+ 1 if all chunks have been pruned, otherwise 0. | +
32 | + nonceOrHash |
+ byte[32] |
+ The nonce for deriving encryption keys, or the overall hash. | +
â varies | + nMemoChunks |
+ compactSize |
+ The number of memo chunks. | +
â varies | + pruned |
+ byte[ \(\mathsf{ceiling}(\mathtt{nMemoChunks}/8)\)] |
+ Bitflags indicating the type of each entry in vMemoChunks . |
+
â varies | + vMemoChunks |
+ MemoChunk[nMemoChunks] |
+ A sequence of encrypted memo chunks. | +
â These fields are present if and only if fAllPruned == 0
.
If fAllPruned == 0
, then:
nonceOrHash
represents the nonce for deriving encryption keys.pruned
, in little-endian order, indicates the type of the
+corresponding entry in vMemoChunks
. A bit value of 0 indicates that
+the entry will be of type byte[272]
representing an encrypted memo
+chunk. A bit value of 1 indicates the entry will be a byte[32]
and
+contains the memo_chunk_digest
for a pruned chunk.If fAllPruned == 1
, then:
nonceOrHash
represents the overall hash for the memo bundle as defined in
+Transaction sighash.nMemoChunks
, pruned
, and vMemoChunks
fields will be absent.memo_chunk_digest = H(AEAD(MemoChunk, memo_key))
+memo_bundle_digest = H(concat(memo_chunk_digests))
+
+
+The memo bundle digest structure is a performance optimization for the case +where all memo chunks in a transaction have been pruned.
+ +TODO: finish this to be a modification to the equivalent of ZIP 244 for +transaction v6.
+ +(This section will become a modification to ZIP 317.)
+ +A memo bundle may contain two free chunks if there are any shielded outputs in
+the transaction. Otherwise, each memo chunk requires marginal_fee
as defined
+in ZIP 317 10.
Nodes must reject GetData
responses having an fAllPruned
value that is nonzero,
+or any byte of pruned
that is nonzero.
The following changes affecting the definitions of note plaintexts and note ciphertexts, +and the algorithms for encryption and decryption.
+In § 3.2.1 âNote Plaintexts and Memo Fieldsâ:
+Change
+-+Each Sapling or Orchard note plaintext (denoted np) -consists of
-âââ(leadByteâ âŚâ đšđ,âdâ âŚâ đš[âd],ârseedâ âŚâ đšđ[đđ],âmemoâ âŚâ đšđ[đđđ])
+Each Sapling or Orchard note plaintext (denoted \(\mathbf{np}\)) consists of
+ +\(\hspace{2em}(\mathsf{leadByte} \;âŚ\; \mathbb{B^{Y}}, \mathsf{d} \;âŚ\; \mathbb{B^{[\ell_{\mathsf{d}}]}}, \mathsf{rseed} \;âŚ\; \mathbb{B^{Y[32]}}, \mathsf{memo} \;âŚ\; \mathbb{B^{Y[512]}})\)
to
+-The form of a Sapling or Orchard note plaintext depends on the -version of the transaction in which it will be included; specifically -whether that version is pre-v6, or v6-onward.
-Each pre-v6 Sapling or Orchard note plaintext (denoted np) -consists of
-âââ(leadByteâ âŚâ đšđ,âdâ âŚâ đš[âd],ârseedâ âŚâ đšđ[đđ],âmemoâ âŚâ đšđ[đđđ])
-Each v6-onward Sapling or Orchard note plaintext (denoted np) -consists of
-âââ(leadByteâ âŚâ đšđ,âdâ âŚâ đš[âd],ârseedâ âŚâ đšđ[đđ],âKmemoâ âŚâ đšđ[đđ])
+The form of a Sapling or Orchard note plaintext depends on the version of +the transaction in which it will be included; specifically whether that +version is pre-v6, or v6-onward.
+ +Each pre-v6 Sapling or Orchard note plaintext (denoted \(\mathbf{np}\)) consists of
+ +\(\hspace{2em}(\mathsf{leadByte} \;âŚ\; \mathbb{B^{Y}}, \mathsf{d} \;âŚ\; \mathbb{B^{[\ell_{\mathsf{d}}]}}, \mathsf{rseed} \;âŚ\; \mathbb{B^{Y[32]}}, \mathsf{memo} \;âŚ\; \mathbb{B^{Y[512]}})\)
+ +Each v6-onward Sapling or Orchard note plaintext (denoted \(\mathbf{np}\)) consists of
+ +\(\hspace{2em}(\mathsf{leadByte} \;âŚ\; \mathbb{B^{Y}}, \mathsf{d} \;âŚ\; \mathbb{B^{[\ell_{\mathsf{d}}]}}, \mathsf{rseed} \;âŚ\; \mathbb{B^{Y[32]}}, \mathsf{K^{memo}} \;âŚ\; \mathbb{B^{Y[32]}})\)
In § 5.5 âEncodings of Note Plaintexts and Memo Fieldsâ 5:
+ +In § 5.5 âEncodings of Note Plaintexts and Memo Fieldsâ 11:
+Change the paragraph that describes âThe encoding of a Sapling or -Orchard note plaintextâ to refer to âThe encoding of a pre-v6 Sapling or -Orchard note plaintextâ.
Change the paragraph that describes “The encoding of a Sapling or Orchard note plaintext” +to refer to “The encoding of a pre-v6 Sapling or Orchard note plaintext”.
Add a new paragraph at the end of the section:
+-The encoding of a v6-onward Sapling or Orchard note plaintext -consists of:
--
+- - -- - - - - - - -8-bit leadByte -88-bit d -64-bit v -256-bit rseed -32-byte Kmemo -The encoding of a v6-onward Sapling or Orchard note plaintext consists of:
+ +| | | | | | +|—————————|———————|———————|————————–|—————————–| +| 8-bit \(\mathsf{leadByte}\) | 88-bit \(\mathsf{d}\) | 64-bit \(\mathsf{v}\) | 256-bit \(\mathsf{rseed}\) | 32-byte \(\mathsf{K^{memo}}\) |
+-
- A byte 0x03, indicating this version of the encoding of a v6-onward Sapling or Orchard note plaintext.
-- 11 bytes specifying d.
-- 8 bytes specifying v.
-- 32 bytes specifying rseed.
-- 32 bytes specifying Kmemo.
+- 11 bytes specifying \(\mathsf{d}\).
+- 8 bytes specifying \(\mathsf{v}\).
+- 32 bytes specifying \(\mathsf{rseed}\).
+- 32 bytes specifying \(\mathsf{K^{memo}}\).
A value consisting of 32
+ +0
x
F
F
-bytes for Kmemo is used to -indicate that there is no memo for this note plaintext.A value consisting of 32 \(\mathtt{0xFF}\) bytes for \(\mathsf{K^{memo}}\) is used +to indicate that there is no memo for this note plaintext.
In § 4.7.2 âSending Notes (Sapling)â 6 and -§ 4.7.3 âSending Notes (Orchard)â 7:
+ +In § 4.7.2 âSending Notes (Sapling)â 12 and +§ 4.7.3 âSending Notes (Orchard)â 13:
+Add a reference to this ZIP specifying the construction of the -memo bundle and derivation of Kmemo in the case of a v6-onward -note plaintext.
Add a reference to this ZIP specifying the construction of the memo bundle and +derivation of \(\mathsf{K^{memo}}\) in the case of a v6-onward note plaintext.
Change
+-+Let npâ=â(leadByte,âd,âv,ârseed,âmemo)â.
+Let \(\mathbf{np} = (\mathsf{leadByte}, \mathsf{d}, \mathsf{v}, \mathsf{rseed}, \mathsf{memo})\).
to
+--Let np be the -encoding of a Sapling note plaintext using leadByte, d, -v, rseed, and either memo for a pre-v6 note plaintext or Kmemo for a v6-onward note -plaintext.
+Let \(\mathbf{np}\) be the encoding of a Sapling note plaintext using \(\mathsf{leadByte}\), \(\mathsf{d}\), +\(\mathsf{v}\), \(\mathsf{rseed}\), and either \(\mathsf{memo}\) for a pre-v6 note plaintext or +\(\mathsf{K^{memo}}\) for a v6-onward note plaintext.
replacing âSaplingâ with Orchard in the case of § 4.7.3.
replacing “Sapling” with Orchard in the case of § 4.7.3.
In § 4.20.1 âEncryption (Sapling and Orchard)â 8:
+ +In § 4.20.1 âEncryption (Sapling and Orchard)â 14:
+Change
+-+Let npâ=â(leadByte,âd,âv,ârseed,âmemo) -be the Sapling or Orchard note plaintext. np is -encoded as defined in § 5.5 âEncodings of Note Plaintexts and Memo -Fieldsâ.
+Let \(\mathbf{np} = (\mathsf{leadByte}, \mathsf{d}, \mathsf{v}, \mathsf{rseed}, \mathsf{memo})\) +be the Sapling or Orchard note plaintext. \(\mathbf{np}\) is encoded as defined +in § 5.5 âEncodings of Note Plaintexts and Memo Fieldsâ.
to
+-Let np be the -encoding of the Sapling or Orchard note plaintext (which may be pre-v6 -or v6-onward), as defined in § 5.5 âEncodings of Note Plaintexts and -Memo Fieldsâ.
+Let \(\mathbf{np}\) be the encoding of the Sapling or Orchard note plaintext (which may be +pre-v6 or v6-onward), as defined in § 5.5 âEncodings of Note Plaintexts and Memo Fieldsâ.
Add another normative note to that section:
+-
- Cenc will be of length -either 580 or 100 bytes, depending on whether np is a -pre-v6 or v6-onward note plaintext.
+- \(\mathsf{C^{enc}}\) will be of length either 580 or 100 bytes, depending on whether +\(\mathbf{np}\) is a pre-v6 or v6-onward note plaintext.
In § 4.20.2 âDecryption using an Incoming Viewing Key (Sapling and -Orchard)â 9 and § 4.20.3 âDecryption using a -Full Viewing Key (Sapling and Orchard)â 10:
+ +In § 4.20.2 âDecryption using an Incoming Viewing Key (Sapling and Orchard)â 15 +and § 4.20.3 âDecryption using a Full Viewing Key (Sapling and Orchard)â 16:
+A memo bundle consists of a sequence of 256-byte memo chunks, each -individually encrypted. These memo chunks represent zero or more -encrypted memos.
-Each transaction may contain a single memo bundle, and a memo bundle
-may contain at most memo_chunk_limit
memo chunks. This
-limits the total amount of memo data that can be conveyed within a
-single transaction to memo_chunk_limit * 256
bytes.
memo_chunk_limit
is a parameter to this specification,
-to be decided upon by the community. The authors of this ZIP propose a
-maximum of 64 chunks, resulting in a maximum total memo data length of
-16 KiB.
Memo bundles are encoded in transactions in a prunable manner: each -memo chunk can be replaced by its representative digest.
-During transaction construction, each output with memo data is
-assigned a 32-byte memo key Kmemo. These keys SHOULD be
-generated randomly, and MUST NOT be used to encrypt more than one memo
-within a single transaction. If an output has no memo data, it is
-assigned the memo key consisting of 32 0
x
F
F
-bytes.
In note plaintexts of v6-onward transactions, the 512-byte memo field -is replaced by Kmemoâ.
-The transaction builder generates a 32-byte salt value salt from a CSPRNG. A new salt MUST be -generated for each memo bundle.
-The symmetric encryption key for a memo is derived from its Kmemo as follows:
-âââencryption_keyâ=âPRFKmemoexpand([0
x
E
0
]â||âsalt)
The first byte 0
x
E
0
-should be added to the documentation of inputs to PRFexpand in § 4.1.2 âPseudo
-Random Functionsâ 11.
If the generated key is 32 0
x
F
F
-bytes, the transaction constructor MAY repeat this procedure with a
-different salt, in order to avoid the recipient misinterpreting the
-output as having no memo data. Since that has negligible probability, it
-alternatively MAY omit this check.
Each memo is padded to a multiple of 256 bytes with zeroes, and split -into 256-byte chunks. Each memo chunk is encrypted with ChaCha20Poly1305 -12 as follows:
-âââIETF_AEAD_CHACHA20_POLY1305(encryption_key,ânonce,âmemo_chunk)
-where nonceâ=âI2BEOSP88(counter)||[final_chunk]â.
-This is a variant of the STREAM construction 13.
-0
x
01
-for the final memo chunk, and 0
x
00
-for all preceding chunks.Finally, the encrypted memo chunks for all memos are combined into a -single sequence using an order-preserving shuffle. Memo chunks from -different memos MAY be interleaved in any order, but memo chunks from -the same memo MUST have the same relative order. The following diagram -shows an example shuffle of three memos:
-[
- (memo_a, 0),
- (memo_b, 0),
- (memo_a, 1),
- (memo_c, 0),
- (memo_c, 1),
- (memo_a, 2),
-]
-When a recipient decrypts a shielded output, they obtain a memo key
-Kmemo. From this they derive
-encryption_key
as above, and then proceed as follows:
counter = 0
and
-final_chunk = 0x00
.counter
by 1, and then continue attempting to decrypt
-subsequent chunks.final_chunk = 0x01
and then attempt to decrypt the memo
-chunks again, starting immediately after the last successfully-decrypted
-chunk (or at the start if none were), and without incrementing
-counter
.
-final_chunk = 0x01
, discard any memo chunks that were
-decrypted, and return nothing. Otherwise, concatenate the decrypted memo
-chunks in order and return the concatenation as the memo.If any chunk of the memo encrypted to memo_key
has been
-pruned, the decryption process above returns nothing (as
-final_chunk
will be set to 0x01
with the wrong
-counter value), ensuring that a malformed memo is not returned.
All of these changes apply identically to Mainnet and Testnet.
+ +memo_chunk_limit == 64
is recommended. This results in a maximum of 16 KiB
+of memo data per transaction.
TBD
+ +Restricting the total amount of memo data in a bundle, for example to 16 KiB, +limits the rate at which the chain size can grow cheaply (from a computational +perspective; memo bundles are much easier to produce than proofs or signatures).
+ +The current behaviour for previous transaction versions (no limit on the number +of memos) is not altered by this ZIP, because memos in those transactions are +tied to individual shielded outputs (incurring their computational cost), and +are not natively aggregatable.
+ +TODO: this table needs to be recalculated with a 16 KiB limit.
+ +With 10 KiB limit on amount of memo data as the constant in this table, the +maximum number of unique memos you can create, and the cost in bytes of that +memo data plus auth when using a 32-byte memo key, is:
+Bytes | -Name | -Data Type | -Description | -
---|---|---|---|
1 | -fAllPruned |
-uint8 |
-1 if all chunks have been pruned, otherwise 0. | -
32 | -nonceOrHash |
-byte[32] |
-The nonce for deriving encryption keys, or the overall hash. | -
â varies | -nMemoChunks |
-compactSize |
-The number of memo chunks. | -
â varies | -pruned |
-byte[ ceiling(n M e m o C h u n k s /8)] |
-Bitflags indicating the type of each entry in
-vMemoChunks . |
-
â varies | -vMemoChunks |
-MemoChunk[nMemoChunks] |
-A sequence of encrypted memo chunks. | -
â These fields are present if and only if
-fAllPruned == 0
.
If fAllPruned == 0
, then:
nonceOrHash
represents the nonce for deriving
-encryption keys.pruned
, in little-endian order, indicates
-the type of the corresponding entry in vMemoChunks
. A bit
-value of 0 indicates that the entry will be of type
-byte[272]
representing an encrypted memo chunk. A bit value
-of 1 indicates the entry will be a byte[32]
and contains
-the memo_chunk_digest
for a pruned chunk.If fAllPruned == 1
, then:
nonceOrHash
represents the overall hash for the memo
-bundle as defined in Transaction
-sighash.nMemoChunks
, pruned
, and
-vMemoChunks
fields will be absent.memo_chunk_digest = H(AEAD(MemoChunk, memo_key))
-memo_bundle_digest = H(concat(memo_chunk_digests))
-The memo bundle digest structure is a performance optimization for -the case where all memo chunks in a transaction have been pruned.
-TODO: finish this to be a modification to the equivalent of ZIP 244 -for transaction v6.
-(This section will become a modification to ZIP 317.)
-A memo bundle may contain two free chunks if there are any shielded
-outputs in the transaction. Otherwise, each memo chunk requires
-marginal_fee
as defined in ZIP 317 14.
Nodes must reject GetData
responses having an
-fAllPruned
value that is nonzero, or any byte of
-pruned
that is nonzero.
memo_chunk_limit == 64
is recommended. This results in a
-maximum of 16 KiB of memo data per transaction.
Restricting the total amount of memo data in a bundle, for example to -16 KiB, limits the rate at which the chain size can grow cheaply (from a -computational perspective; memo bundles are much easier to produce than -proofs or signatures).
-The current behaviour for previous transaction versions (no limit on -the number of memos) is not altered by this ZIP, because memos in those -transactions are tied to individual shielded outputs (incurring their -computational cost), and are not natively aggregatable.
-TODO: this table needs to be recalculated with a 16 KiB limit.
-With 10 KiB limit on amount of memo data as the constant in this -table, the maximum number of unique memos you can create, and the cost -in bytes of that memo data plus auth when using a 32-byte memo key, -is:
-- | Memo size | -+ |
---|---|---|
Chunk size | +Memo size ⤠256 bytes | +Memo size = 512 bytes |
Chunk size | -⤠256 bytes | -512 bytes | -
============ | -====================== | -====================== | +
Pre-231 | +20 @ 10240 ( 0.00%) | +20 @ 10240 ( 0.00%) |
Pre-231 | -20 @ 10240 ( 0.00%) | -20 @ 10240 ( 0.00%) | +
512 | +20 @ 11220 (+ 9.57%) | +20 @ 11220 (+ 9.57%) |
512 | -20 @ 11220 (+ 9.57%) | -20 @ 11220 (+ 9.57%) | +
256 | +40 @ 12200 (+19.14%) | +20 @ 11540 (+12.70%) |
256 | -40 @ 12200 (+19.14%) | -20 @ 11540 (+12.70%) | -
256 20-out | -20 @ 6100 (-40.43%) | -+ |
256 20-out | +20 @ 6100 (-40.43%) | +
In the â256 20-outâ case you have a distinguisher compared to old -transactions, in that you can tell the transaction is sending at most -256 bytes per recipient rather than 512 if it is sending the max number -of memos. But thatâs inherently baked into the decision to use a smaller -memo chunk size (and it is still possible for the chunks to all be a -single memo sent to all outputs, or anything in between).
-If we used a 16-byte memo key instead of 32 bytes, the transaction -size overhead becomes:
+ +In the “256 20-out” case you have a distinguisher compared to old transactions, +in that you can tell the transaction is sending at most 256 bytes per recipient +rather than 512 if it is sending the max number of memos. But that’s inherently +baked into the decision to use a smaller memo chunk size (and it is still +possible for the chunks to all be a single memo sent to all outputs, or anything +in between).
+ +If we used a 16-byte memo key instead of 32 bytes, the transaction size overhead +becomes:
+- | Memo size | -+ |
---|---|---|
Chunk size | +Memo size ⤠256 bytes | +Memo size = 512 bytes |
Chunk size | -⤠256 bytes | -512 bytes | -
============ | -====================== | -====================== | -
Pre-231 | -20 @ 10240 ( 0.00%) | -20 @ 10240 ( 0.00%) | +
Pre-231 | +20 @ 10240 ( 0.00%) | +20 @ 10240 ( 0.00%) |
512 | -20 @ 10900 (+ 6.45%) | -20 @ 10900 (+ 6.45%) | +
512 | +20 @ 10900 (+ 6.45%) | +20 @ 10900 (+ 6.45%) |
256 | -40 @ 11560 (+12.89%) | -20 @ 11220 (+ 9.57%) | +
256 | +40 @ 11560 (+12.89%) | +20 @ 11220 (+ 9.57%) |
256 20-out | -20 @ 5780 (-43.55%) | -+ |
256 20-out | +20 @ 5780 (-43.55%) | +
The decrease in overhead is relatively modest in most cases, but more -noticeable for small memos with a 256-byte memo chunk.
-However, 128-bit keys donât meet Zcashâs target security level of 125 -bits, as argued in 15.
+ +The decrease in overhead is relatively modest in most cases, but more noticeable +for small memos with a 256-byte memo chunk.
+ +However, 128-bit keys don’t meet Zcash’s target security level of 125 bits, +as argued in 18.
+The benefits of 256-bit keys are:
+Including a per-transaction salt in -the derivation of encryptionkey gives protection -against accidental (or intentional) reuse of Kmemo reuse across multiple -transactions. We do not protect against Kmemo reuse within a transaction; -it is up to the transaction builder to ensure that the same Kmemo is not used to encrypt two -different memos (and if they did so, normal clients would either never -observe the second memo, or would decrypt parts of each memo and get a -nonsensical and potentially insecure âsplicedâ memo).
-We do not include commitments to the shielded outputs in the -derivation of encryptionkey -for two reasons:
+ +Including a per-transaction \(\mathsf{salt}\) in the derivation of +\(\mathsf{encryption_key}\) gives protection against accidental (or intentional) +reuse of \(\mathsf{K^{memo}}\) reuse across multiple transactions. We do not +protect against \(\mathsf{K^{memo}}\) reuse within a transaction; it is up to +the transaction builder to ensure that the same \(\mathsf{K^{memo}}\) is not +used to encrypt two different memos (and if they did so, normal clients would +either never observe the second memo, or would decrypt parts of each memo and +get a nonsensical and potentially insecure “spliced” memo).
+ +We do not include commitments to the shielded outputs in the derivation of +\(\mathsf{encryption_key}\) for two reasons:
+The separation of memo data from note data, and the new ability to -easily store variable-length memo data, opens up an attack vector -against node operators for storing arbitrary data. The transaction -digest commitments to the memo bundle are structured such that if a node -operator is presented with a memo key (i.e. they are given the -capability to decrypt a particular memo), they can identify and prune -the corresponding memo chunks, while still enabling the transaction to -be validated as part of its corresponding block and broadcast over the -network.
-The transaction encoding permits pruning at the individual chunk -level in order to facilitate pruning an individual memo from a -transaction without affecting the other memos. This enables node -operators to be responsive to, for example, GDPR deletion requests.
-Note that broadcasting a partially-pruned transaction means that the -pruned chunks no longer contribute to the upper bound on memo data.
-The prunable structure does not introduce a censorship axis; memo -bundles do not reveal which memo chunks correspond to which memos, and -therefore a network adversary cannot selectively censor individual -memos. They can censor any/all chunks within specific transactions, -however shielded transactions do not reveal their senders, recipients, -or amounts, and thus also cannot be individually targeted for -censorship.
-Making the fee linear in the number of chunks has the following -properties:
+ +The separation of memo data from note data, and the new ability to easily store +variable-length memo data, opens up an attack vector against node operators for +storing arbitrary data. The transaction digest commitments to the memo bundle +are structured such that if a node operator is presented with a memo key (i.e. +they are given the capability to decrypt a particular memo), they can identify +and prune the corresponding memo chunks, while still enabling the transaction to +be validated as part of its corresponding block and broadcast over the network.
+ +The transaction encoding permits pruning at the individual chunk level in order +to facilitate pruning an individual memo from a transaction without affecting the +other memos. This enables node operators to be responsive to, for example, GDPR +deletion requests.
+ +Note that broadcasting a partially-pruned transaction means that the pruned +chunks no longer contribute to the upper bound on memo data.
+ +The prunable structure does not introduce a censorship axis; memo bundles do not +reveal which memo chunks correspond to which memos, and therefore a network +adversary cannot selectively censor individual memos. They can censor any/all +chunks within specific transactions, however shielded transactions do not reveal +their senders, recipients, or amounts, and thus also cannot be individually +targeted for censorship.
+ +Making the fee linear in the number of chunks has the following properties:
+Combined with the memo bundle size restriction, the maximum -additional fee for a memo bundle over prior transactions is 0.0019 -ZEC.
-Combined with the memo bundle size restriction, the maximum additional fee for +a memo bundle over prior transactions is 0.0019 ZEC.
+ +This ZIP is proposed to activate with Network Upgrade 7. 20
+ +TBD
-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ââŠď¸
Zcash Protocol -Specification, Version 2024.5.1 [NU6] or laterâŠď¸
Zcash -Protocol Specification, Version 2024.5.1 [NU6]. Section 3.2.1: Note -Plaintexts and Memo FieldsâŠď¸
Zcash -Protocol Specification, Version 2024.5.1 [NU6]. Section 5.5: Encodings -of Note Plaintexts and Memo FieldsâŠď¸
Zcash -Protocol Specification, Version 2024.5.1 [NU6]. Section 4.7.2: Sending -Notes (Sapling)âŠď¸
Zcash -Protocol Specification, Version 2024.5.1 [NU6]. Section 4.7.3: Sending -Notes (Orchard)âŠď¸
Zcash Protocol -Specification, Version 2024.5.1 [NU6]. Section 4.20.1: Encryption -(Sapling and Orchard)âŠď¸
Zcash -Protocol Specification, Version 2024.5.1 [NU6]. Section 4.20.2: -Decryption using an Incoming Viewing Key (Sapling and Orchard)âŠď¸
Zcash -Protocol Specification, Version 2024.5.1 [NU6]. Section 4.20.3: -Decryption using a Full Viewing Key (Sapling and Orchard)âŠď¸
Zcash -Protocol Specification, Version 2024.5.1 [NU6]. Section 4.1.2: Pseudo -Random FunctionsâŠď¸
Online -Authenticated-Encryption and its Nonce-Reuse Misuse-ResistanceâŠď¸
Zcash -Protocol Specification, Version 2024.5.1 [NU6]. Section 8.7: In-band -secret distributionâŠď¸
zcash/zips issue #693: -Standardize a protocol for creating shielded transactions offlineâŠď¸
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” ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6] or later ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.2.1: Note Plaintexts and Memo Fields ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.1.2: Pseudo Random Functions ↩︎
+Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.5: Encodings of Note Plaintexts and Memo Fields ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.7.2: Sending Notes (Sapling) ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.7.3: Sending Notes (Orchard) ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.20.1: Encryption (Sapling and Orchard) ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.20.2: Decryption using an Incoming Viewing Key (Sapling and Orchard) ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.20.3: Decryption using a Full Viewing Key (Sapling and Orchard) ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 8.7: In-band secret distribution ↩︎
+zcash/zips issue #693: Standardize a protocol for creating shielded transactions offline ↩︎
+The key words âMUSTâ, âSHOULDâ, âSHOULD NOTâ, âMAYâ, âRECOMMENDEDâ, -âOPTIONALâ, and âREQUIREDâ in this document are to be interpreted as -described in RFC 2119. [1]
-The term ânetwork upgradeâ in this document is to be interpreted as -described in ZIP 200. [2]
-âBlock Subsidyâ - the algorithmic issuance of ZEC on block creation. -Part of the consensus rules. Split between the miner and the Dev Fund. -Also known as Block Reward.
-âIssuanceâ - The method by which ZEC becomes available for -circulation on the network.
-âWeâ - the ZIP Owners and Authors, listed in the above front -matter.
-âMAX_MONEY
â is the total ZEC supply cap, defined as
-21,000,000 ZEC. This is slightly larger than the supply cap for the
-current issuance mechanism, but is the value used in existing critical
-consensus checks.
We propose the introduction of a mechanism to voluntarily burn funds, -removing those funds entirely from circulation on the network. This -mechanism, in combination with ZIPs 234 and 235, comprises a long-term -strategy for the sustainability of the network. We will refer to the -combined effects of these three ZIPs as the âNetwork Sustainability -Mechanismâ.
-This mechanism seeks to address concerns about the sustainability of -the network design shared by Bitcoin-like systems:
-MAX_MONEY
. This lays necessary
-groundwork for extending the miner reward system, which currently has a
-clear final end date.The key word “MUST” in this document is to be interpreted as described in +BCP 14 1 when, and only when, it appears in all capitals.
+ +The term “network upgrade” in this document is to be interpreted as described +in ZIP 200. 2
+ +The character § is used when referring to sections of the Zcash Protocol +Specification. 3
+ +The terms “Mainnet” and “Testnet” are to be interpreted as described in +§ 3.12 âMainnet and Testnetâ. 4
+ +“ZEC/TAZ” refers to the native currency of Zcash on a given network, i.e. +ZEC on Mainnet and TAZ on Testnet.
+ +“Block Subsidy” - The algorithmic issuance of ZEC/TAZ on block creation, as +defined by consensus. This is split between the miner and Funding Streams.
+ +“Issuance” - The method by which ZEC/TAZ becomes available for circulation +on the network. [TODO: there is a potential terminology conflict between +this and issuance as defined in ZIP 227.]
+ +“Burning” - The method by which ZEC/TAZ becomes unavailable for circulation +on the network.
+ +\(\mathsf{MAX\_MONEY}\), as defined in § 5.3 âConstantsâ 5, +is the total ZEC/TAZ supply cap measured in zatoshi, corresponding to +21,000,000 ZEC. This is slightly larger than the supply cap for the current +issuance mechanism, but is the value used in existing critical consensus +checks.
+ +This ZIP proposes the introduction of a mechanism to voluntarily burn funds, +removing those funds entirely from circulation on the network. This mechanism, +in combination with ZIP 234 6 and ZIP 235 7, comprises a +long-term strategy for the sustainability of the network. We will refer to the +combined effects of these three ZIPs as the âNetwork Sustainability Mechanismâ.
+ +This mechanism seeks to address concerns about the sustainability of the network +design shared by Bitcoin-like systems:
+ +The modifications required are:
-The following field is added to the v6 transaction format [3]:
-Bytes | -Name | -Data Type | -Description | +
---|---|---|---|
Bytes | +Name | +Data Type | +Description |
8 | -burnAmount |
-uint64 |
-The amount of input value to be burned, in zatoshis. | +
8 | + burnAmount |
+ uint64 |
+ The value to be burned in this transaction, in zatoshis. |
Note: Older transaction versions can continue to be -supported after a network upgrade, but burning is not possible for these -transactions. For example, NU5 supports both v4 and v5 transaction -formats, for both coinbase and non-coinbase transactions.
-The burned value must now be considered when calculating the total -output value of a transaction. It should be treated similarly to a -transparent output, except that there is no way for this value to be -used as an input in a future transaction.
-The transaction digest algorithm defined in ZIP 244 [4] is to be -modified for v6 transactions as follows:
-Section T.1: header_digest [5] is specified in draft-txv6-sighash [6] -to read:
+ +The \(\mathsf{burn\_amount}\) of a transaction is defined to be the value of the
+burnAmount
field if present, and otherwise 0.
Notes:
+ +Make a change to § 3.4 âTransactions and Treestatesâ 8 +implementing the specification in Burn amount.
+ +In § 7.1 âTransaction Encoding and Consensusâ 11, add:
+ +++ +[NU7 onward] \(\mathsf{burn\_amount}\) MUST be in the range \(\{ 0 .. \mathsf{MAX\_MONEY} \}\).
+
Relative to the sighash algorithm defined in ZIP 244, the sighash algorithm
+that applies to v6 transactions differs by appending the encoding of
+\(\mathsf{burn\_amount}\) to the Common Transaction Fields that are the input
+to the digest in T.1: header_digest
13:
--A BLAKE2b-256 hash of the following values:
--T.1a: version (4-byte little-endian version identifier including ``fOverwintered`` flag) -T.1b: version_group_id (4-byte little-endian version group identifier) -T.1c: consensus_branch_id (4-byte little-endian consensus branch id) -T.1d: lock_time (4-byte little-endian ``nLockTime`` value) -T.1e: expiry_height (4-byte little-endian block height) -T.1f: burn_amount (8-byte little-endian burn amount value)
The personalization field of this hash is set to:
-+ZTxIdHeadersHash
T.1f: burn_amount (8-byte little-endian burn amount) +
All technical decisions in this ZIP are balanced between the -necessary robustness of the NSM mechanics, and simplicity of -implementation.
-An explicit value distinguishes the burned ZEC from the transaction -fee. Explicitness also ensures any arithmetic flaws in any -implementations are more likely to be observed and caught -immediately.
-This ZIP is proposed to activate with Network Upgrade 7.
-[1]: Key words for use in -RFCs to Indicate Requirement Levels
-[2]: ZIP 200: Network Upgrade -Mechanism
-[3]: ZIP 230: Version 6 Transaction -Format
-[4]: ZIP 244: Transaction Identifier -Non-Malleability
-[5]: ZIP 244: -Transaction Identifier Non-Malleability. Section T.1: Header -Digest
-[6]: Draft Tx v6 -Sighash
+ +Note: If both this ZIP and ZIP 2002 are selected for inclusion in the same +Network Upgrade, then the ambiguity in ordering of the fields added by these +ZIPs would need to be resolved.
+ +All of these changes apply identically to Mainnet and Testnet.
+ +All technical decisions in this ZIP are balanced between the necessary +robustness of the NSM mechanics, and simplicity of implementation.
+ +An explicit value distinguishes the burned ZEC from the transaction fee. +Explicitness also ensures any arithmetic flaws in any implementations are more +likely to be observed and caught immediately.
+ +This ZIP is proposed to activate with Network Upgrade 7. 14
+ +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” ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6] or later ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.3: Constants ↩︎
+ZIP 234: Network Sustainability Mechanism: Issuance Smoothing ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.4: Transactions And Treestates ↩︎
+ZIP 230: Version 6 Transaction Format. Section ‘Transaction Format’ ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.1.2 Transaction Consensus Rules ↩︎
+ZIP 244: Transaction Identifier Non-Malleability. Section T.1: header_digest ↩︎
+The key words âMUSTâ, âSHOULDâ, âSHOULD NOTâ, âMAYâ, âRECOMMENDEDâ, -âOPTIONALâ, and âREQUIREDâ in this document are to be interpreted as -described in RFC 2119. [1]
-âNetwork upgradeâ - to be interpreted as described in ZIP 200. -[2]
-âBlock Subsidyâ - the algorithmic issuance of ZEC on block creation. -Part of the consensus rules. Split between the miner and the Dev Fund. -Also known as Block Reward.
-âIssuanceâ - The method by which ZEC becomes available for -circulation on the network.
-Let PostBlossomHalvingInterval
be as defined in
-[#protocol-diffadjustment]_.
âMoney Reserveâ - MAX_MONEY - ChainValue
, where
-ChainValue
includes all ZEC available on the network,
-across all value pools.
This ZIP proposes a change to how nodes calculate the block -subsidy.
-Instead of following a step function around the 4-year halving -intervals inherited from Bitcoin, we propose a smooth logarithmic curve, -defined as a fixed portion of the current value of the Money Reserve at -a given block height.
-The new issuance scheme would approximate the current issuance over
-4-year intervals, assuming no ZEC is burned during that time, and
-retains the overall supply cap of MAX_MONEY
.
The key word “MUST” in this document is to be interpreted as described in +BCP 14 1 when, and only when, it appears in all capitals.
+ +The term “network upgrade” in this document is to be interpreted as described +in ZIP 200. 2
+ +The character § is used when referring to sections of the Zcash Protocol +Specification. 3
+ +The terms “Mainnet” and “Testnet” are to be interpreted as described in +§ 3.12 âMainnet and Testnetâ. 4
+ +The symbol “\(\,\cdot\,\)” means multiplication, as described in § 2 âNotationâ. +5
+ +“ZEC/TAZ” refers to the native currency of Zcash on a given network, i.e. +ZEC on Mainnet and TAZ on Testnet.
+ +The terms “Block Subsidy”, “Issuance”, and “Burning” are to be interpreted +as described in ZIP 233. 6
+ +Let \(\mathsf{PostBlossomHalvingInterval}\) be as defined in 7.
+ +\(\mathsf{MAX\_MONEY}\), as defined in § 5.3 âConstantsâ 8, +is the total ZEC/TAZ supply cap measured in zatoshi, corresponding to +21,000,000 ZEC. This is slightly larger than the supply cap for the current +issuance mechanism, but is the value used in existing critical consensus +checks.
+ +“Issued Supply” - The Issued Supply at a given height of a block chain is +the total ZEC/TAZ value in all chain value pool balances at that height, as +calculated by \(\mathsf{IssuedSupply}(\mathsf{height})\) defined in +§ 4.17 âChain Value Pool Balancesâ. 9
+ +“Money Reserve” - The Money Reserve at a given height of a block chain is +the total ZEC/TAZ value remaining to be issued, as calculated by +\(\mathsf{MAX\_MONEY} - \mathsf{IssuedSupply}(\mathsf{height})\).
+ +This ZIP proposes a change to how nodes calculate the block subsidy.
+ +Instead of following a step function around the 4-year halving intervals +inherited from Bitcoin, we propose a smooth logarithmic curve, defined as a +fixed portion of the current value of the Money Reserve at a given block height.
+ +The new issuance scheme would approximate the current issuance over 4-year
+intervals, assuming no ZEC/TAZ is burned during that time, and retains the
+overall supply cap of MAX_MONEY
.
Key Objectives:
-The current Zcash economic model, inherited from Bitcoin, includes a -halving mechanism that dictates the issuance of new coins. While this -has been foundational, halvings can lead to abrupt changes in the rate -of new coins being introduced to the market. Such sudden shifts can -potentially disrupt the networkâs economic model, potentially impacting -its security and stability. Furthermore, the halvings schedule is fixed -and does not provide any way to ârecycleâ funds into future -issuance.
-This new NSM-based issuance scheme solves these problems by ensuring -a more consistent and predictable rate of coin issuance, while -preserving the core aspects of Zcashâs issuance policy and the 21 -million coin cap. At the same time, it introduces the first mechanism to -recreate and distribute ZEC that has been removed from circulation, as -well as unclaimed transaction fees, across future block subsidies.
-Smoothing the issuance curve is possible using an exponential decay -formula that satisfies the following requirements:
-The current Zcash economic model, inherited from Bitcoin, includes a halving +mechanism that dictates the issuance of new coins. While this has been +foundational, halvings can lead to abrupt changes in the rate of new coins +being introduced to the market. Such sudden shifts can potentially disrupt the +network’s economic model, potentially impacting its security and stability. +Furthermore, the halvings schedule is fixed and does not provide any way to +“recycle” funds into future issuance.
+ +This new NSM-based issuance scheme solves these problems by ensuring a more +consistent and predictable rate of coin issuance, while preserving the core +aspects of Zcash’s issuance policy and the 21-million-coin cap. At the same +time, it introduces the first mechanism to recreate and distribute ZEC that has +been removed from circulation, as well as unclaimed transaction fees, across +future block subsidies.
+ +Smoothing the issuance curve is possible using an exponential decay formula +that satisfies the following requirements:
+ +TODO daira: add a requirement that makes the initial total issuance -match the previous total issuance
-BLOCK_SUBSIDY_FRACTION
= 4126 / 10,000,000,000 or
-0.0000004126
DEPLOYMENT_BLOCK_HEIGHT
= TBD
\(\mathsf{BLOCK\_SUBSIDY\_FRACTION} = 4126 / 10\_000\_000\_000 = 0.0000004126\)
+ +\(\mathsf{DEPLOYMENT\_BLOCK\_HEIGHT} = \mathsf{TBD}\)
+The block height will be chosen by the following criteria:
+This selection is intended to achieve Key Objective 6 while still
-being a constant height. An alternative would be to have a dynamic
-âlatchâ style activation which would calculate the activation height by
-testing the âless thanâ conditional with every block after the second
-halving. We prefer the pre-defined constant height parameter to give
-everyone more time certainty at the cost of issuance
-level certainty. The difference in up-front calculation versus
-dynamic calculation is whether or not burns are accounted for (since
-future burns cannot be calculated up-front). This means with the
-pre-defined constant parameter approach, issuance will jump up
-some amount at activation. This amount should be equivalent to all ZEC
-burnt prior to that height times BLOCK_SUBSIDY_FRACTION
.
-For example, if a total of 100,000 ZEC were burnt prior to the
-pre-defined constant activation height, then at activation the issuance
-would be larger than BTC-style issuance by
-100_000 ZEC * BLOCK_SUBSIDY_FRACTION
which we calculate
-equals 0.04126 ZEC
. This example is chosen to demonstrate
-that a very large burn amount (much larger than expected) would elevate
-issuance by a relatively small amount. For this reason, we believe a
-pre-defined constant is a better approach to achieving Key Objective 6
-than a âdynamic latchâ logic because it is so much simpler to implement
+
+
This selection is intended to achieve Key Objective 6 while still being at +a constant, predictable height. An alternative would be to have a dynamic +“latch”-style activation, which would calculate the activation height by +testing the “less than” conditional with every block after the second halving. +We prefer the pre-defined constant height parameter, to give everyone more +time certainty at the cost of issuance level certainty.
+ +The difference in up-front calculation versus dynamic calculation is in +whether or not burns are accounted for (since future burns cannot be +calculated up-front). This means with the pre-defined constant parameter +approach, issuance will jump up some amount at activation. This amount +should be equivalent to all ZEC burnt prior to that height times +\(\mathsf{BLOCK\_SUBSIDY\_FRACTION}\). For example, if a total of 100,000 ZEC +were burnt prior to the pre-defined constant activation height, then at +activation the issuance would be larger than BTC-style issuance by +\(100\_000\textsf{ ZEC} \cdot \mathsf{BLOCK\_SUBSIDY\_FRACTION}\), +which we calculate equals \(0.04126\) ZEC. This example is chosen to +demonstrate that a very large burn amount (much larger than expected) would +elevate issuance by a relatively small amount. For this reason, we believe +a pre-defined constant is a better approach to achieving Key Objective 6 +than a “dynamic latch” logic because it is so much simpler to implement and reason about.
-MoneyReserveAfter(block_height)
= The value of the Money
-Reserve after the specified block height.
At the DEPLOYMENT_BLOCK_HEIGHT
, nodes should switch from
-the current issuance calculation, to the following:
BlockSubsidy(block_height) = ceiling(BLOCK_SUBSIDY_FRACTION * MoneyReserveAfter(block_height - 1))
\(\mathsf{MoneyReserveAfter}(\mathsf{height}) =\) The value of the Money Reserve +after the specified block height.
+ +At the \(\mathsf{DEPLOYMENT\_BLOCK\_HEIGHT}\), nodes should switch from the current issuance +calculation, to the following:
+ +\(\mathsf{BlockSubsidy}(\mathsf{height}) = \mathsf{ceiling}(\mathsf{BLOCK\_SUBSIDY\_FRACTION} \cdot \mathsf{MoneyReserveAfter}(\mathsf{height} - 1))\)
+ +All of these changes apply identically to Mainnet and Testnet.
+ +BLOCK_SUBSIDY_FRACTION
Let IntendedMoneyReserveFractionRemainingAfterFourYears
-= 0.5.
The value 4126 / 10_000_000_000
satisfies the
-approximation within +0.002%:
(1 - BLOCK_SUBSIDY_FRACTION)^PostBlossomHalvingInterval â IntendedMoneyReserveFractionRemainingAfterFourYears
Meaning after a period of 4 years around half of Money Reserve will -be issued as block subsidies, thus satisfying Requirement -4.
-The largest possible value in the Money Reserve is
-MAX_MONEY
, in the theoretically possible case that all
-issued funds are burned. If this happened, the largest interim sum in
-the block subsidy calculation would be
-MAX_MONEY * 4126 / 10000000000
.
This uses 62.91 bits, which is just under the 63 bit limit for 64-bit -signed twoâs-complement integer amount types.
+ +Let \(\mathsf{IntendedMoneyReserveFractionRemainingAfterFourYears} = 0.5\).
+ +The value \(4126 / 10\_000\_000\_000\) satisfies the approximation within \(\pm 0.002\%\):
+ +\((1 - \mathsf{BLOCK\_SUBSIDY\_FRACTION})^\mathsf{PostBlossomHalvingInterval} \approx \mathsf{IntendedMoneyReserveFractionRemainingAfterFourYears}\)
+ +This implies that after a period of 4 years around half of Money Reserve will +have been issued as block subsidies, thus satisfying Requirement 4.
+ +The largest possible value in the Money Reserve is \(\mathsf{MAX\_MONEY}\), in the +theoretically possible case that all issued funds are burned. If this happened, +the largest interim sum in the block subsidy calculation would be +\(\mathsf{MAX\_MONEY} \cdot 4126 / 10\_000\_000\_000\).
+ +This uses 62.91 bits, which is just under the 63-bit limit for signed +two’s complement 64-bit integer amount types.
+The numerator could be brought closer to the limit by using a larger -denominator, but the difference in the amount issued would be very -small. So we chose a power-of-10 denominator for simplicity.
+denominator, but the difference in the amount issued would be very small. So we +chose a power-of-10 denominator for simplicity. +TODO for ZIP owners: How many ZEC per day?
-The following graph compares issuance for the current halving-based -step function vs the smoothed curve.
+ +The following graph compares issuance for the current halving-based step +function vs the smoothed curve.
+ -The graph below shows the balance of the Money Reserve assuming -smooth issuance is implemented.
+ +The graph below shows the balance of the Money Reserve assuming smooth issuance +is implemented.
+ -The implementation of this ZIP MUST be deployed at the same time or -after the Network Sustainability Mechanism Burning function is deployed -(ZIP-0233).
-The NSM -Simulator allows us to simulate the effects of this ZIP on the Money -Reserve and the block subsidy, as well as generate plots like the ones -above. Its output:
-Last block is 47917869 in ~113.88 years
-indicates that, assuming that no ZEC is ever burned, the Money -Reserve will be depleted after 113.88 years, and the block subsidy will -be 0 ZEC after that point.
+ +The NSM Simulator allows us to +simulate the effects of this ZIP on the Money Reserve and the block subsidy, as +well as generate plots like the ones above. Its output:
+ +Last block is 47917869 in ~113.88 years
+
+
+indicates that, assuming that no ZEC is ever burned, the Money Reserve will be +depleted after 113.88 years, and the block subsidy will be 0 ZEC after that +point.
+This fragment of the output:
+Halving 1 at block 1680000:
NSM subsidies: 262523884819889 (~ 2625238.848 ZEC, 1.563 ZEC per block)
legacy subsidies: 262500000000000 (~ 2625000.000 ZEC, 1.562 ZEC per block)
- difference: 23884819889 (~ 238 ZEC), NSM/legacy: 1.0001
-shows that the difference between the smoothed out and the current -issuance schemes is 238 ZEC after 1680000 blocks (around 4 years).
-Future protocol changes may not increase the payout rate to a -reasonable approximation beyond the four year half-life constraint.
-[1] RFC-2119: https://datatracker.ietf.org/doc/html/rfc2119
-[2] ZIP-200: Network Upgrade Mechanism
-[3] ZIP_233: Network Sustainability Mechanism: -Burning
+ difference: 23884819889 (~ 238 ZEC), NSM/legacy: 1.0001 + + +shows that the difference between the smoothed out and the current issuance +schemes is 238 ZEC after 1680000 blocks (around 4 years).
+ +Future protocol changes may not increase the payout rate to a reasonable +approximation beyond the four year half-life constraint.
+ +This ZIP is proposed to activate with Network Upgrade 7. 10 +It MUST be deployed at the same time or after ZIP 233 (“NSM: Burning” 6).
+ +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” ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6] or later ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 2: Notation ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.7.3 Difficulty Adjustment ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 5.3: Constants ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.17 Chain Value Pool Balances ↩︎
+The key words âMUSTâ, âSHOULDâ, âSHOULD NOTâ, âMAYâ, âRECOMMENDEDâ, -âOPTIONALâ, and âREQUIREDâ in this document are to be interpreted as -described in RFC 2119. [1]
-The term ânetwork upgradeâ in this document is to be interpreted as -described in ZIP 200. [2]
-âBlock Subsidyâ - the algorithmic issuance of ZEC on block creation. -Part of the consensus rules. Split between the miner and the Dev Fund. -Also known as Block Reward.
-âIssuanceâ - The method by which ZEC becomes available for -circulation on the network.
-âWeâ - the ZIP authors, owners listed in the above front matter
-We propose to burn 60% of transaction fees, while the remaining 40% -be directed as before, providing a deflationary effect, and building the -groundwork for long-term support of the Zcash network via the new block -subsidy rules proposed by ZIP-234.
-ZIP-233 (âNetwork Sustainability Mechanism: Burningâ) describes a +Discussions-To: <https://github.com/zcash/zips/issues/924> + + +
The key word “MUST” in this document is to be interpreted as described in +BCP 14 1 when, and only when, it appears in all capitals.
+ +The term “network upgrade” in this document is to be interpreted as described +in ZIP 200. 2
+ +The character § is used when referring to sections of the Zcash Protocol +Specification. 3
+ +The terms “Mainnet” and “Testnet” are to be interpreted as described in +§ 3.12 âMainnet and Testnetâ. 4
+ +The symbol “\(\,\cdot\,\)” means multiplication, as described in § 2 âNotationâ. +5
+ +“ZEC/TAZ” refers to the native currency of Zcash on a given network, i.e. +ZEC on Mainnet and TAZ on Testnet.
+ +The terms “Block Subsidy”, “Issuance”, and “Burning” are to be interpreted +as described in ZIP 233. 6
+ +This ZIP proposes to burn 60% of transaction fees, while the remaining 40% is +directed as before, providing a deflationary effect, and building the groundwork +for long-term support of the Zcash network via the new block subsidy rules +proposed by ZIP 234 7.
+ +ZIP 233 (“Network Sustainability Mechanism: Burning” 6) describes a method by which ZEC can be burned to support network sustainability.
-By introducing a requirement that a certain proportion of transaction -fees be burned, we ensure that ZEC will be removed from circulating -supply to contribute to the long-term sustainability of the network as -described below:
-By introducing a requirement that a certain proportion of transaction fees be +burned, we ensure that ZEC will be removed from circulating supply to contribute +to the long-term sustainability of the network as described below:
+ +For a given block, the coinbase transaction MUST have a
-burnAmount
that is greater than or equal to
-floor(transactionFees * 6 / 10)
.
Previous transaction versions are not supported for coinbase -transactions, due to there being no explicit mechanism to burn the -required funds.
-The implementation of this ZIP MUST be deployed at the same time or -after ZIP-233 (âNSM: Burningâ), and ZIP-234 (âNSM: Issuance -Smoothingâ).
-We believe the proposed changes to be relatively low-impact in terms -of implementation and protocol changes. Additionally, transaction fees -are currently small enough that the reduction in miner fees is unlikely -to be a concern.
-Over 100,000 blocks starting at block 2235515, there were 316130 -transactions. 60608 of them are categorized as âsandblastingâ -transactions. The remaining transactions have an average of 5.46 logical -actions (see ZIP-317 [4]).
-The total fees paid to miners from those transactions, assuming the -ZIP-317 regime, would be 87.86 ZEC. 100,000 blocks is approximately 3 -months of blocks. Extrapolating to a year, we would expect 351.44 ZEC in -fees paid to miners over a year.
-If 60% of these fees burned, that would be 210.864 ZEC per year. -[5]
-If transaction fees were to increase, further modifications can -easily be proposed to alter the 60%/40% split. Finding the optimal fee -split may require an iterative approach involving adjustments based on -real-world data and network dynamics.
-Looking further into the future, there may come a time when the -transaction fees become greater than the block subsidy issuance. At that -time we may need to reconsider the 60/40 split. However, this will -likely not be the case for the next 8-10 years due to forecasts based on -issuance models and network traffic.
-Further ZIPs may be proposed to burn ZEC in various ways to support -network sustainability, including but not limited to:
+ +For a given block, the coinbase transaction MUST have a \(\mathsf{burn\_amount}\), +as defined in 6, that is greater than or equal to +\(\mathsf{floor}(\mathsf{transactionFees} \cdot 6 / 10)\).
+ +The version of a coinbase transaction MUST be v6 or later 9.
+ +All of these changes apply identically to Mainnet and Testnet.
+ +We believe the proposed changes to be relatively low-impact in terms of +implementation and protocol changes. Additionally, transaction fees are +currently small enough that the reduction in miner fees is unlikely to be a +concern.
+ +There is no explicit mechanism in prior transaction versions to burn the +required funds. Since \(\mathsf{burn\_amount} = 0\) for transaction versions +prior to v6, absent the rule about the coinbase transaction version it +would be technically possible to satisfy the constraint on \(\mathsf{burn\_amount}\) +with earlier versions than v6, but only when \(\mathsf{transactionFees} = 0\). +That would introduce a corner case in the transaction consensus rules that +is not useful, since it is expected that the \(\mathsf{transactionFees}\) +will normally be non-zero.
+ +Over 100,000 blocks starting at block 2235515, there were 316130 transactions. +60608 of them are categorized as ‘sandblasting’ transactions. The remaining +transactions have an average of 5.46 logical actions (see ZIP 317 10).
+ +The total fees paid to miners from those transactions, assuming the ZIP 317 +regime, would be 87.86 ZEC. 100,000 blocks is approximately 3 months of blocks. +Extrapolating to a year, we would expect 351.44 ZEC in fees paid to miners over +a year.
+ +If 60% of these fees burned, that would be 210.864 ZEC per year. 11
+ +If transaction fees were to increase, further modifications can easily be +proposed to alter the 60%/40% split. Finding the optimal fee split may require +an iterative approach involving adjustments based on real-world data and network +dynamics.
+ +Looking further into the future, there may come a time when the transaction fees +become greater than the block subsidy issuance. At that time we may need to +reconsider the 60/40 split. However, this will likely not be the case for the +next 8–10 years due to forecasts based on issuance models and network traffic.
+ +Further ZIPs may be proposed to burn ZEC in various ways to support network +sustainability, including but not limited to:
+[1] RFC-2119: https://datatracker.ietf.org/doc/html/rfc2119
-[2] ZIP 200: Network Upgrade Mechanism
-[3] ZIP 233: Establish the Zcash Sustainability -Fund on the Protocol Level
-[4] ZIP 317: Proportional Transfer Fee -Mechanism
-[5] https://github.com/eigerco/zsf-fee-estimator
+ +The implementation of this ZIP MUST be deployed at the same time or after +ZIP 233 (“NSM: Burning” 6), and ZIP 234 (“NSM: Issuance Smoothing” +7).
+ +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” ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6] or later ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 2: Notation ↩︎
+ZIP 234: Network Sustainability Mechanism: Issuance Smoothing ↩︎
+The nonmalleable transaction identifier specified by this ZIP will be used in the place of the current malleable transaction identifier within the Merkle tree committed to by the hashMerkleRoot
value. However, this change now means that hashMerkleRoot
is not sufficient to fully commit to the transaction data, including witnesses, that appear within the block.
As a consequence, we now need to add a new commitment to the block header. This commitment will be the root of a Merkle tree having leaves that are transaction authorizing data commitments, produced according to the Authorizing Data Commitment part of this specification. The insertion order for this Merkle tree MUST be identical to the insertion order of transaction identifiers into the Merkle tree that is used to construct hashMerkleRoot
, such that a path through this Merkle tree to a transaction identifies the same transaction as that path reaches in the tree rooted at hashMerkleRoot
.
This new commitment is named hashAuthDataRoot
and is the root of a binary Merkle tree of transaction authorizing data commitments having height
- \(\mathsf{ceil(log_2(tx\_count))}\)
+ \(\mathsf{ceil(log_2(tx\_count))}\!\)
, padded with leaves having the "null" hash value [0u8; 32]
. Note that
\(\mathsf{log_2(tx\_count)}\)
is well-defined because
- \(\mathsf{tx\_count} > 0\)
+ \(\mathsf{tx\_count} > 0\!\)
, due to the coinbase transaction in each block. Non-leaf hashes in this tree are BLAKE2b-256 hashes personalized by the string "ZcashAuthDatHash"
.
Changing the block header format to allow space for an additional commitment is somewhat invasive. Instead, the name and meaning of the hashLightClientRoot
field, described in ZIP 221 4, is changed.
hashLightClientRoot
is renamed to hashBlockCommitments
. The value of this hash is the BLAKE2b-256 hash personalized by the string "ZcashBlockCommit"
of the following elements:
The key word âMUSTâ in this document are to be interpreted as -described in BCP 14 1 when, and only when, they appear in -all capitals.
-The term ânetwork upgradeâ in this document is to be interpreted as -described in ZIP 200 2.
-The terms âTestnetâ and âMainnetâ are to be interpreted as described -in section 3.12 of the Zcash Protocol Specification 3.
-The key word “MUST” in this document are to be interpreted as described in +BCP 14 1 when, and only when, they appear in all capitals.
+ +The term “network upgrade” in this document is to be interpreted as described in ZIP 200 2.
+ +The terms “Testnet” and “Mainnet” are to be interpreted as described in +section 3.12 of the Zcash Protocol Specification 3.
+ +This proposal defines the deployment of the NU6 network upgrade.
-The primary sources of information about NU6 consensus protocol -changes are:
+ +The primary sources of information about NU6 consensus protocol changes are:
+The network handshake and peer management mechanisms defined in ZIP -201 9 also apply to this upgrade.
-The following ZIPs have been updated in varying degrees to take into -account NU6:
+ +The network handshake and peer management mechanisms defined in ZIP 201 8 also apply to this upgrade.
+ +The following ZIPs have been updated in varying degrees to take into account NU6:
+The following network upgrade constants 12 -are defined for the NU6 upgrade:
+ +The following network upgrade constants 2 are defined for the NU6 upgrade:
+0xC8E71055
-0xC8E71055
170110
-170120
-170110
170120
For each network (Testnet and Mainnet), nodes compatible with NU6 -activation on that network MUST advertise a network protocol version -that is greater than or equal to the MIN_NETWORK_PROTOCOL_VERSION (NU6) -for that activation.
-Prior to the network upgrade activating on each network, NU6 and -pre-NU6 nodes are compatible and can connect to each other. However, NU6 -nodes will have a preference for connecting to other NU6 nodes, so -pre-NU6 nodes will gradually be disconnected in the run up to -activation.
-Once the network upgrades, even though pre-NU6 nodes can still accept -the numerically larger protocol version used by NU6 as being valid, NU6 -nodes will always disconnect peers using lower protocol versions.
-NU6 does not define a new transaction version or impose a new minimum -transaction version. NU6 transactions are therefore in the same v4 or v5 -formats as NU5 transactions. This does not imply that transactions are -valid across the NU6 activation, since signatures MUST use the -appropriate consensus branch ID.
-For each network (Testnet and Mainnet), nodes compatible with NU6 activation on that network MUST advertise a network protocol version that is greater than or equal to the MIN_NETWORK_PROTOCOL_VERSION (NU6) for that activation.
+ +Prior to the network upgrade activating on each network, NU6 and pre-NU6 nodes are compatible and can connect to each other. However, NU6 nodes will have a preference for connecting to other NU6 nodes, so pre-NU6 nodes will gradually be disconnected in the run up to activation.
+ +Once the network upgrades, even though pre-NU6 nodes can still accept the numerically larger protocol version used by NU6 as being valid, NU6 nodes will always disconnect peers using lower protocol versions.
+ +NU6 does not define a new transaction version or impose a new minimum transaction version. NU6 transactions are therefore in the same v4 or v5 formats as NU5 transactions. This does not imply that transactions are valid across the NU6 activation, since signatures MUST use the appropriate consensus branch ID.
+ +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ââŠď¸
Zcash Protocol Specification, -Version 2024.5.1 [NU6]. Section 3.12: Mainnet and TestnetâŠď¸
Zcash -Protocol Specification, Version 2024.5.1 or laterâŠď¸
ZIP 1015: -Block Reward Allocation for Non-Direct Development FundingâŠď¸
ZIP 214: -Consensus rules for a Zcash Development FundâŠď¸
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” ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet ↩︎
+ZIP 1015: Block Reward Allocation for Non-Direct Development Funding ↩︎
+The key word âMUSTâ in this document are to be interpreted as -described in BCP 14 1 when, and only when, they appear in -all capitals.
-The term ânetwork upgradeâ in this document is to be interpreted as -described in ZIP 200 2.
-The terms âTestnetâ and âMainnetâ are to be interpreted as described -in section 3.12 of the Zcash Protocol Specification 3.
-The key word “MUST” in this document is to be interpreted as described in +BCP 14 1 when, and only when, it appears in all capitals.
+ +The term “network upgrade” in this document is to be interpreted as described +in ZIP 200. 2
+ +The character § is used when referring to sections of the Zcash Protocol +Specification. 3
+ +The terms “Mainnet” and “Testnet” are to be interpreted as described in +§ 3.12 âMainnet and Testnetâ. 4
+ +This proposal defines the deployment of the NU7 network upgrade.
-The primary sources of information about NU7 consensus protocol -changes are:
+ +The primary sources of information about NU7 consensus protocol changes are:
+The network handshake and peer management mechanisms defined in ZIP -201 6 also apply to this upgrade.
-The following network upgrade constants 7 are -defined for the NU7 upgrade:
+ +The network handshake and peer management mechanisms defined in ZIP 201 +5 also apply to this upgrade.
+ +The following network upgrade constants 2 are defined for the +NU7 upgrade:
+0x77190AD8
-0x77190AD8
170130
-170140
-170130
170140
For each network (Testnet and Mainnet), nodes compatible with NU7 -activation on that network MUST advertise a network protocol version -that is greater than or equal to the MIN_NETWORK_PROTOCOL_VERSION (NU7) -for that activation.
-Prior to the network upgrade activating on each network, NU7 and -pre-NU7 nodes are compatible and can connect to each other. However, NU7 -nodes will have a preference for connecting to other NU7 nodes, so -pre-NU7 nodes will gradually be disconnected in the run up to -activation.
-Once the network upgrades, even though pre-NU7 nodes can still accept -the numerically larger protocol version used by NU7 as being valid, NU7 -nodes will always disconnect peers using lower protocol versions.
-For each network (Testnet and Mainnet), nodes compatible with NU7 activation +on that network MUST advertise a network protocol version that is greater +than or equal to the MIN_NETWORK_PROTOCOL_VERSION (NU7) for that activation.
+ +Prior to the network upgrade activating on each network, NU7 and pre-NU7 +nodes are compatible and can connect to each other. However, NU7 nodes will +have a preference for connecting to other NU7 nodes, so pre-NU7 nodes will +gradually be disconnected in the run up to activation.
+ +Once the network upgrades, even though pre-NU7 nodes can still accept the +numerically larger protocol version used by NU7 as being valid, NU7 nodes +will always disconnect peers using lower protocol versions.
+ +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ââŠď¸
Zcash Protocol Specification, -Version 2024.5.1 [NU6]. Section 3.12: Mainnet and TestnetâŠď¸
Zcash -Protocol Specification, Version 2024.5.1 or laterâŠď¸
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” ↩︎
+Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.12: Mainnet and Testnet ↩︎
+The inputs to the signature algorithm are:
The inputs to the verification algorithm are:
The signature MUST be verified as follows:
@@ -212,20 +214,20 @@ \(coinType\) be the 4-byte little-endian encoding of the coin type in its index form, not its hardened form (i.e. 133 for mainnet Zcash).The raw form of a ZIP 304 signature is - \(\mathsf{nf}\,||\,\mathsf{LEBS2OSP}_{256}(\mathsf{repr}_{\mathbb{J}}(\mathsf{rk}))\,||\,zkproof\,||\,spendAuthSig\) + \(\mathsf{nf}\,||\,\mathsf{LEBS2OSP}_{256}(\mathsf{repr}_{\mathbb{J}}(\mathsf{rk}))\,||\,zkproof\,||\,spendAuthSig\!\) , for a total size of 320 bytes.
When encoding a ZIP 304 signature in a human-readable format, implementations SHOULD use standard Base64 for compatibility with the signmessage
and verifymessage
RPC methods in zcashd
. ZIP 304 signatures in this form are 428 bytes. The encoded form is the string
- \(\texttt{"zip304:"}\)
+ \(\texttt{âzip304:â}\)
followed by the result of Base64-encoding 2 the raw form of the signature.
We use a note value of \(1\) zatoshi instead of zero to ensure that the payment address is fully bound to - \(zkproof\) + \(zkproof\!\) . Notes with zero value have certain constraints disabled inside the circuit.
We set \(\mathsf{rcm}\) @@ -287,7 +289,7 @@
The one component that is inherently malleable is - \(zkproof\) + \(zkproof\!\) . The zero-knowledge property of a Groth16 proof implies that anyone can take a valid proof, and re-randomize it to obtain another valid proof with a different encoding. We prevent this by binding the encoding of \(zkproof\) to - \(spendAuthSig\) + \(spendAuthSig\!\) , by including \(zkproof\) in the message digest.
diff --git a/rendered/zip-0307.html b/rendered/zip-0307.html index 07a72407c..eaf3dcc7e 100644 --- a/rendered/zip-0307.html +++ b/rendered/zip-0307.html @@ -3,7 +3,9 @@We also define the following notation here:
@@ -173,12 +175,12 @@ means the sequence of values inclusive of \(a\) and exclusive of - \(b\) + \(b\!\) .Given a payment disclosure - \(\mathsf{pd}\) + \(\mathsf{pd}\!\) , a transaction - \(\mathsf{tx}\) + \(\mathsf{tx}\!\) , and the height of the block in which \(\mathsf{tx}\) was mined (which we assume was verified by the caller), the verifier proceeds as follows:
@@ -385,21 +387,21 @@Payment disclosures that prove Sapling spend authority are not required to reveal a sender address. This is because it is impossible: we can "prove" the transaction came from any of the diversified addresses linked to the spending key. Fundamentally, the "sender" of a transaction is anyone who has access to the corresponding spend authority; in the case of Sapling, a spend authority corresponds to multiple diversified addresses. In situations where a sender address is already known to the verifier of the payment disclosure (or publically), it may still be useful to have the option of linking the payment disclosure to that address.
The types Scalar, Element, and G are defined in 7, as well as the notation for elliptic-curve arithmetic, which uses the additive notation. Note that this notation differs from that used in the Zcash Protocol Specification. For example, G.ScalarMult(P, k)
is used for scalar multiplication, where the protocol spec would use
\([k] P\)
with the group implied by
- \(P\)
+ \(P\!\)
.
An additional per-ciphersuite hash function is used, denote HR(m)
, which receives an arbitrary-sized byte string and returns a Scalar. It is defined concretely in the Ciphersuites section.
G.Order()
.G.Order()
. (This is equivalent to
- \(\mathsf{H}^\circledast(m)\)
+ \(\mathsf{H}^\circledast(m)\!\)
, as defined by the
\(\mathsf{RedJubjub}\)
scheme instantiated in 12.)G.Order()
.G.Order()
. (This is equivalent to
- \(\mathsf{H}^\circledast(m)\)
+ \(\mathsf{H}^\circledast(m)\!\)
, as defined by the
\(\mathsf{RedPallas}\)
scheme instantiated in 12.)R
value from the signature is not influenced by the randomizer so we just need to focus on the z
value (using FROST notation). Recall that z
must equal to r + (c * sk)
, and that each signature share is z_i = (hiding_nonce + (binding_nonce * binding_factor)) +
(lambda_i * c * sk_i)
. The first terms are not influenced by the randomizer so we can only look into the second term of each top-level addition, i.e. c
* sk
must be equal to sum(lambda_i * c * sk_i)
for each participant i
. Under re-randomization these become c * (sk + randomizer)
(see
- \(\mathsf{RedDSA.RandomizedPrivate}\)
+ \(\mathsf{RedDSA.RandomizedPrivate}\!\)
, which refers to the randomizer as
- \(\alpha\)
+ \(\alpha\!\)
) and sum(lambda_i * c * (sk_i + randomizer))
. The latter can be rewritten as c * (sum(lambda_i * sk_i) + randomizer *
sum(lambda_i)
. Since sum(lambda_i * sk_i) == sk
per the Shamir secret sharing mechanism used by FROST, and since sum(lambda_i) == 1
18, we arrive at c * (sk + randomizer)
as required.randomizer_generate
generates randomizer uniformly at random as required by
- \(\mathsf{RedDSA.GenRandom}\)
+ \(\mathsf{RedDSA.GenRandom}\!\)
; and signature generation is compatible with
- \(\mathsf{RedDSA.RandomizedPrivate}\)
+ \(\mathsf{RedDSA.RandomizedPrivate}\!\)
,
- \(\mathsf{RedDSA.RandomizedPublic}\)
+ \(\mathsf{RedDSA.RandomizedPublic}\!\)
,
\(\mathsf{RedDSA.Sign}\)
and
diff --git a/rendered/zip-0316.html b/rendered/zip-0316.html
index 03c97e750..594829c81 100644
--- a/rendered/zip-0316.html
+++ b/rendered/zip-0316.html
@@ -3,7 +3,9 @@
The Human-Readable Part is as specified for a Unified Viewing Key in Revisions.
@@ -309,8 +311,8 @@When deriving a UIVK from a UFVK containing Typecodes \(\mathtt{0xE0}\) and/or - \(\mathtt{0xE1}\) + \(\mathtt{0xE1}\!\) , these Metadata Items MUST be retained unmodified in the derived UIVK.
When deriving a Unified Address from a UFVK or UIVK containing a Metadata Item having Typecode - \(\mathtt{0xE0}\) + \(\mathtt{0xE0}\!\) , the derived Unified Address MUST contain a Metadata Item having Typecode \(\mathtt{0xE0}\) such that the Address Expiry Height of the resulting address is less than or equal to the Expiry Height of the viewing key.
When deriving a Unified Address from a UFVK or UIVK containing a Metadata Item having Typecode - \(\mathtt{0xE1}\) + \(\mathtt{0xE1}\!\) , the derived Unified Address MUST contain a Metadata Item having Typecode \(\mathtt{0xE1}\) such that the Address Expiry Time of the resulting address is less than or equal to the Expiry Time of the viewing key.
@@ -467,7 +469,7 @@ be the remaining \(32\) bytes of - \(I_\mathsf{ovk}\) + \(I_\mathsf{ovk}\!\) .Since an external P2PKH FVK encodes the chain code and public key at the Account level, we can derive both external and internal child keys from it, as described in BIP 44 34. It is possible to derive an internal P2PKH FVK from the external P2PKH FVK (i.e. its parent) without having the external spending key, because child derivation at the Change level is non-hardened.
@@ -501,6 +503,9 @@ inclusive.Note: A diversifier index of 0 may not generate a valid Sapling diversifier (with probability + \(1/2\!\) + ). Some wallets (either prior to the deployment of ZIP 316, in violation of the above requirement, or because they do not include a Sapling component in their UAs) always generate a Transparent P2PKH address at diversifier index 0. Therefore, all Zcash wallets, whether or not they support Unified Addresses, MUST assume that there may be transparent funds associated with diversifier index 0 for each ZIP 32 account, even in cases where the wallet implementation would not generate a Unified Address with that index for a given account. This is necessary to ensure reliable recovery of funds if key material is imported between wallets.
The following derivations are applied to each component IVK using the diversifier index:
We instantiate \(H_i(u)\) by - \(\mathsf{BLAKE2bâ}(8\ell_L)(\texttt{âUA_F4Jumble_Hâ} \,||\,\) + \(\mathsf{BLAKE2bâ}(8\ell_L)(\texttt{âUA\_F4Jumble\_Hâ} \,||\,\) \([i, 0, 0], u),\) with \(\ell_H = 64.\) @@ -653,7 +658,7 @@ as the first \(\ell_R\) bytes of the concatenation of - \([\mathsf{BLAKE2bâ}512(\texttt{âUA_F4Jumble_Gâ} \,||\, [i] \,||\,\) + \([\mathsf{BLAKE2bâ}512(\texttt{âUA\_F4Jumble\_Gâ} \,||\, [i] \,||\,\) \(\mathsf{I2LEOSP}_{16}(j), u) \text{ for } j \text{ from}\) \(0 \text{ up to } \mathsf{ceiling}(\ell_R/\ell_H)-1].\)
@@ -731,7 +736,7 @@ is close to \(c.\) ( - \(b'\) + \(\!b'\) and \(d'\) will not be close to @@ -806,7 +811,7 @@ part of the jumbled encoding three times from a less memory-constrained device. It is essential that the streamed value of \(d\) is the same on each pass, which can be verified using a Message Authentication Code (with key held only by the Consumer) or collision-resistant hash function. After the first pass of - \(d\) + \(d\!\) , the implementation is able to compute \(y;\) after the second pass it is able to compute diff --git a/rendered/zip-0317.html b/rendered/zip-0317.html index bf2e70936..8dab6cbe0 100644 --- a/rendered/zip-0317.html +++ b/rendered/zip-0317.html @@ -3,7 +3,9 @@Let \(min\_actions\) be the minimum number of logical actions that can be used to execute economically relevant transactions that produce change. Due to the aforementioned padding, - \(min\_actions = 2\) + \(min\_actions = 2\!\) .
Having a grace window size greater than \(min\_actions\) would increase the cost to create such a minimal transaction. If the cost we believe that users will tolerate for a minimal transaction is - \(B\) + \(B\!\) , then possible choices of \(marginal\_fee\) are bounded above by - \(B / \max(min\_actions, grace\_actions)\) + \(B / \max(min\_actions, grace\_actions)\!\) . Therefore, the optimal choice of \(grace\_actions\) to maximize the per-logical-action cost of denial-of-service attacks for a given - \(B\) + \(B\!\) , is - \(grace\_actions = min\_actions = 2\) + \(grace\_actions = min\_actions = 2\!\) . This also ensures that a denial-of-service adversary does not gain a significant per-logical-action cost advantage by using transactions with a smaller or larger number of logical actions.
The specified formula calculates the contribution of transparent inputs and outputs based on their total size relative to a typical input or output. Another considered approach was to calculate this contribution simply as - \(\mathsf{max}(transparent\_inputs, transparent\_outputs)\) + \(\mathsf{max}(transparent\_inputs, transparent\_outputs)\!\) . However, this would allow a denial-of-service adversary to create transactions with transparent components containing arbitrarily large scripts.
The chosen values for \(p2pkh\_standard\_input\_size\) @@ -298,7 +300,7 @@ \(unpaid\_actions(tx) = \begin{cases}\mathsf{max}\!\left(0,\, \mathsf{max}(grace\_actions,\, tx.\!logical\_actions) - \mathsf{floor}\!\left(\frac{tx.fee}{marginal\_fee}\right)\right),&\textsf{if }tx\textsf{ is a non-coinbase transaction} \\ 0,&\textsf{if }tx\textsf{ is a coinbase transaction.}\end{cases}\)
Let - \(block\_unpaid\_actions(block) = \sum_{tx \,\in\, block}\, unpaid\_actions(tx)\) + \(block\_unpaid\_actions(block) = \sum_{tx \,\in\, block}\, unpaid\_actions(tx)\!\) .
The following algorithm is RECOMMENDED for constructing a block template from a set of transactions in a node's mempool:
"tex"
.For Testnet addresses, the required lead bytes of a P2PKH address in step 2 are
- \([\mathtt{0x1D}, \mathtt{0x25}]\)
+ \([\mathtt{0x1D}, \mathtt{0x25}]\!\)
, and the "textest"
HRP is used when reencoding in step 3.
A TEX address can be parsed by reversing this encoding, i.e.:
There is some ambiguity in the specification of a transaction's "memory size", allowing implementations to use different approximations. Currently, zcashd uses a size computed by the RecursiveDynamicUsage
function, and zebrad uses the serialized size. This has been changed from a previous version of this ZIP that specified use of the serialized size, to reflect how the implementation in zcashd has worked since it was first deployed 7.
The threshold 10000 for the cost function is chosen so that the size in bytes of a minimal fully shielded Orchard transaction with 2 shielded actions (having a serialized size of 9165 bytes) will fall below the threshold. This has the effect of ensuring that such transactions are not evicted preferentially to typical transparent or Sapling transactions because of their size. This constant has been updated 6 from 4000 to 10000 in parallel with the changes for deployment of ZIP 317 5; the previous value had been chosen based on the typical size of fully shielded Sapling transactions.
The proposed eviction policy differs significantly from that of Bitcoin Core 8, which is primarily fee-based. This reflects differing philosophies about the motivation for fees and the level of fee that legitimate users can reasonably be expected to pay. The proposed eviction weight function does involve a penalty for transactions with a fee lower than the ZIP 317 5 conventional fee, but since there is no further benefit (as far as mempool limiting is concerned) to increasing the fee above the conventional fee value, it creates no pressure toward escalating fees. For transactions with a memory size up to 10000 bytes, this penalty makes a transaction that pays less than the conventional fee five times as likely to be chosen for eviction (because - \(10000 + 40000 = 50000 = 10000 \times 5\) + \(10000 + 40000 = 50000 = 10000 \times 5\!\) ).
The fee penalty is not included in the cost that determines whether the mempool is considered full. This ensures that a DoS attacker does not have an incentive to pay less than the conventional fee in order to cause the mempool to be considered full sooner.
The default value of 80000000 for mempooltxcostlimit
represents no more than 40 blocksâ worth of transactions in the worst case, which is the default expiration height after the Blossom network upgrade 2. It would serve no purpose to make it larger.
ZIP: 1015 -Title: Block Reward Allocation for Non-Direct Development Funding +Title: Block Subsidy Allocation for Non-Direct Development Funding Owners: Jason McGee <aquietinvestor@gmail.com> @Peacemonger (Zcash Forum) Kris Nuttycombe <kris@nutty.land> @@ -32,7 +32,7 @@The proposed lockbox addresses significant issues observed with ZIP 1014 3, such as regulatory risks, inefficiencies due to funding of organizations instead of projects, and centralization. While the exact disbursement mechanism for the lockbox funds is yet to be determined and will be addressed in a future ZIP, the goal is to employ a decentralized mechanism that ensures community involvement and efficient, project-specific funding. This approach is intended to potentially improve regulatory compliance, reduce inefficiencies, and enhance the decentralization of Zcash's funding structure.
Starting at Zcash's second halving in November 2024, under pre-existing consensus rules 100% of the block subsidies would be allocated to miners, and no further funds would be automatically allocated to any other entities. Consequently, unless the community takes action to approve new block-reward-based funding, existing teams dedicated to development or outreach or furthering charitable, educational, or scientific purposes would likely need to seek other sources of funding; failure to obtain such funding would likely impair their ability to continue serving the Zcash ecosystem. Setting aside a portion of the block subsidy to fund development will help ensure that both existing teams and new contributors can obtain funding in the future.
+Starting at Zcash's second halving in November 2024, under pre-existing consensus rules 100% of the block subsidies would be allocated to miners, and no further funds would be automatically allocated to any other entities. Consequently, unless the community takes action to approve new block-subsidy-based funding, existing teams dedicated to development or outreach or furthering charitable, educational, or scientific purposes would likely need to seek other sources of funding; failure to obtain such funding would likely impair their ability to continue serving the Zcash ecosystem. Setting aside a portion of the block subsidy to fund development will help ensure that both existing teams and new contributors can obtain funding in the future.
It is important to balance the incentives for securing the consensus protocol through mining with funding crucial charitable, educational, and scientific activities like research, development, and outreach. Additionally, there is a need to continue to promote decentralization and the growth of independent development teams.
For these reasons, the Zcash Community wishes to establish a new Zcash Development Fund after the second halving in November 2024, with the intent to put in place a more decentralized mechanism for allocation of development funds. The alternatives presented here are intended to address the following:
The funding stream mechanism defined in ZIP 207 11 is modified such that a funding stream may deposit funds into the deferred pool.
The following paragraph is added to the section Motivation:
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.
@@ -50,7 +52,7 @@Modifications to ZIP 207 \(\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}\!\) + \(\mathsf{DEFERRED\_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:
@@ -63,14 +65,14 @@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}\) + \(\mathsf{DEFERRED\_POOL}\) for transactions in the block chain.
Equivalently, \(\mathsf{ChainValuePoolBalance^{Deferred}}\) @@ -97,11 +99,11 @@
The effect of the definition of \(\mathsf{ChainValuePoolBalance^{Deferred}}\) above is that payments to the - \(\mathsf{DEFERRED}\_\mathsf{POOL}\) + \(\mathsf{DEFERRED\_POOL}\) cause \(\mathsf{FundingStream[FUND].Value}(\mathsf{height})\) to be added to \(\mathsf{ChainValuePoolBalance^{Deferred}}\) for the block chain including that block.
-In the section Deployment 14, the following sentence is added:
+In the section Deployment 14, the following sentence is added:
-Changes to support deferred funding streams are to be deployed with NU6. 15
+Changes to support deferred funding streams are to be deployed with NU6. 15
In section 4.17 Chain Value Pool Balances 5 (which is new in version 2024.5.1 of the protocol specification), include the following:
+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 + 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})\!\) @@ -165,7 +167,7 @@
Modifications to ZIP 207 8, instead of: +
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}}\!\) @@ -176,7 +178,7 @@
Modifications to ZIP 207 \(\mathsf{height}\) + \(\mathsf{height}\!\) :
- define the "total output value" of its coinbase transaction to be the total value in zatoshi of its transparent outputs, minus @@ -198,8 +200,8 @@
Modifications to ZIP 207 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.
+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.
The key word "MUST" in this document is to be interpreted as described in BCP 14 1 when, and only when, it appears in all capitals.
The term "network upgrade" in this document is to be interpreted as described in ZIP 200. 7
-The terms "Testnet" and "Mainnet" are to be interpreted as described in section 3.12 of the Zcash Protocol Specification. 4
-The character § is used when referring to sections of the Zcash Protocol Specification 2.
+The character § is used when referring to sections of the Zcash Protocol Specification. 2
+The terms "Mainnet" and "Testnet" are to be interpreted as described in § 3.12 âMainnet and Testnetâ. 4
This proposal adds an explicit fee
field to the v6 transaction format. Instead of fees being implicit in the difference between the input value and output value of the transaction, all value transfers, including fee transfers to miners, will be explicit and committed to via the txid.
Finally, this change will make it possible for light clients to determine the fee paid by a transaction without needing to download and inspect transparent inputs to the transaction.
There must not be any potentially error-prone calculations needed to compute the fee for a given transaction. That is, the fee must be obvious from the encoding of the transaction.
+Parties that see a transaction, even in isolation, reliably know its fee. That is, the fee must be explicit in the encoding of the transaction, and no potentially error-prone calculations or additional chain data are needed to compute it.
The following field is added to the v6 transaction format 8.
+The following field is appended to the Common Transaction Fields of the v6 transaction format after nExpiryHeight
9:
Note: If both this ZIP and ZIP 233 are selected for inclusion in the same Network Upgrade, then the ambiguity in ordering of the fields added by these ZIPs would need to be resolved.
The following changes are to be made to the Zcash Protocol Specification 2.
-In § 3.4 âTransactions and Treestatesâ 3 (last modified by ZIP 236 9), add the following consensus rule and note:
+In § 3.4 âTransactions and Treestatesâ 3 (last modified by ZIP 236 10), add the following consensus rule and note:
- [NU7 onward] For v6 and later transactions, the remaining value in the transparent transaction value pool, in zatoshis, MUST be equal to the value of the transactionâs
@@ -69,31 +72,22 @@fee
field.In § 7.1 âTransaction Encoding and Consensusâ 5, add:
[NU7 onward]
fee
MUST be in the range - \(\{ 0 .. \mathsf{MAX\_MONEY} \}\) + \(\{ 0 .. \mathsf{MAX\_MONEY} \}\!\) .
The transaction signature hashing algorithm defined in ZIP 244 is to be modified for v6 transactions as follows:
-Section T.1: header_digest 10 is specified in draft-txv6-sighash 11 to read:
--+A BLAKE2b-256 hash of the following values
-T.1a: version (4-byte little-endian version identifier including ``fOverwintered`` flag) -T.1b: version_group_id (4-byte little-endian version group identifier) -T.1c: consensus_branch_id (4-byte little-endian consensus branch id) -T.1d: lock_time (4-byte little-endian ``nLockTime`` value) -T.1e: expiry_height (4-byte little-endian block height) -T.1f: fee (8-byte little-endian fee value)-The personalization field of this hash is set to:
-"ZTxIdHeadersHash"-
Relative to the sighash algorithm defined in ZIP 244, the sighash algorithm that applies to v6 transactions differs by appending the fee
field to the Common Transaction Fields that are the input to the digest in T.1: header_digest 12:
T.1f: fee (8-byte little-endian fee amount)+
Note: If both this ZIP and ZIP 233 are selected for inclusion in the same Network Upgrade, then the ambiguity in ordering of the fields added by these ZIPs would need to be resolved.
All of these changes apply identically to Mainnet and Testnet.
This ZIP is proposed to be deployed with the next transaction version change, which is assumed to be v6.
+This ZIP is proposed to be deployed with the next transaction version change, which is assumed to be v6. 8
TBD
@@ -155,7 +149,7 @@8 | @@ -163,18 +157,34 @@
---|
9 | +ZIP 230: Version 6 Transaction Format. Specification: Transaction Format | +
---|
10 | ZIP 236: Blocks should balance exactly |
---|
11 | +ZIP 244: Transaction Identifier Non-Malleability | +
---|
10 | +12 | ZIP 244: Transaction Identifier Non-Malleability. Section T.1: Header Digest |
---|
11 | +13 | ZIP draft: Version 6 Transaction Signature Validation |
---|
8 | -Draft ZIP 233: Network Sustainability Mechanism: Burning | +ZIP 233: Network Sustainability Mechanism: Burning |
---|
9 | -Draft ZIP 234: Network Sustainability Mechanism: Issuance Smoothing | +ZIP 234: Network Sustainability Mechanism: Issuance Smoothing |
---|
The key word "MUST" in this document is to be interpreted as described in BCP 14 1 when, and only when, it appears in all capitals.
The term "network upgrade" in this document is to be interpreted as described in ZIP 200. 4
-The terms "Testnet" and "Mainnet" are to be interpreted as described in section 3.12 of the Zcash Protocol Specification. 3
-The character § is used when referring to sections of the Zcash Protocol Specification 2.
+The character § is used when referring to sections of the Zcash Protocol Specification. 2
+The terms "Mainnet" and "Testnet" are to be interpreted as described in § 3.12 âMainnet and Testnetâ. 3
ZIP 213 6 added the ability for coinbase outputs to be shielded. An unfortunate side effect of this was to make consensus dependent on the details of note encryption. This has unnecessarily complicated the specification and implementation of consensus rules.
@@ -36,25 +38,22 @@The consensus rule change specified in this ZIP must, from transaction version 6 onward, make the implementation and specification of shielded coinbase outputs independent of note encryption.
In § 5.4.3 'Symmetric Encryption', rename \(Sym\) to \(NoteSym\) and add the following text:
--
- Let - \(\mathsf{NullSym.}\mathbf{K} := \mathbb{B}^{[256]}\) - ,
-- - \(\mathsf{NullSym.}\mathbf{P} := \mathbb{B^Y}^{\mathbb{N}}\) - , and - \(\mathsf{NullSym.}\mathbf{C} := \mathbb{B^Y}^{\mathbb{N}}\) - .
-Let - \(\mathsf{NullSym.Encrypt_K}(\mathsf{P}) := \mathsf{P} || [0x00]^{16}\) + \(\mathsf{NullSym.}\mathbf{K} := \mathbb{B}^{[256]}\!\) + , + \(\mathsf{NullSym.}\mathbf{P} := \mathbb{B^Y}^{\mathbb{N}}\!\) + , and + \(\mathsf{NullSym.}\mathbf{C} := \mathbb{B^Y}^{\mathbb{N}}\!\) + .
+Let + \(\mathsf{NullSym.Encrypt_K}(\mathsf{P}) := \mathsf{P} \,||\, [0x00]^{16}\!\) .
Define \(\mathsf{NullSym.Decrypt_K}(\mathsf{C})\) @@ -63,11 +62,11 @@
- If the last 16 bytes of \(\mathsf{C}\) are not - \([0x00]^{16}\) + \([0x00]^{16}\!\) , return - \(\bot\) + \(\bot\!\) . Otherwise discard those 16 bytes and return the remaining prefix of - \(\mathsf{C}\) + \(\mathsf{C}\!\) .
Note: These definitions intentionally ignore the key; @@ -90,14 +89,14 @@
[Pre-NU7] let \(\mathsf{Sym}\) be - \(\mathsf{NoteSym}\) + \(\mathsf{NoteSym}\!\) .
[NU7 onward] if the note to be decrypted is in an output of a version 6 or later coinbase transaction, let \(\mathsf{Sym}\) be - \(\mathsf{NullSym}\) + \(\mathsf{NullSym}\!\) , otherwise let it be - \(\mathsf{NoteSym}\) + \(\mathsf{NoteSym}\!\) .
These changes apply identically to Mainnet and Testnet.
@@ -105,7 +104,7 @@This ZIP is proposed to be deployed with the next transaction version change, which is assumed to be v6.
+This ZIP is proposed to be deployed with the next transaction version change, which is assumed to be v6. 7
TBD.
@@ -162,6 +161,14 @@7 | +ZIP 230: Version 6 Transaction Format | +
---|
If this is your first time writing a ZIP, the structure and format -may look intimidating. But really, itâs just meant to reflect -common-sense practice and some technical conventions. Feel free to start -with a simple initial draft that gets ideas across, even if it doesnât -quite follow this format. The community and ZIP editors will help you -figure things out and get it into shape later.
+Pull-Request: <https://github.com/zcash/zips/pull/???> + + +If this is your first time writing a ZIP, the structure and format may look +intimidating. But really, it’s just meant to reflect common-sense practice and +some technical conventions. Feel free to start with a simple initial draft that +gets ideas across, even if it doesn’t quite follow this format. The community +and ZIP editors will help you figure things out and get it into shape later.
+{Delete this section.}
-{Edit this to reflect the key words that are actually used.} 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.
-{Avoid duplicating definitions from other ZIPs. Instead use wording -like this:}
-The terms âMainnetâ and âTestnetâ in this document are to be -interpreted as defined in the Zcash protocol specification 2.
-The term âfull validatorâ in this document is to be interpreted as -defined in the Zcash protocol specification 3.
+ +{Edit this to reflect the key words that are actually used.} +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.
+ +{Avoid duplicating definitions from other ZIPs. Instead use wording like this:}
+ +The terms “Mainnet” and “Testnet” in this document are to be interpreted as +defined in the Zcash protocol specification 2.
+ +The term “full validator” in this document is to be interpreted as defined in +the Zcash protocol specification 3.
+The terms below are to be interpreted as follows:
-{Definition.}
-{Definition.}
-{Term to be defined}
+ +:{Definition.} +
+ +{Another term}
+ +:{Definition.} +
+ +{Describe what this proposal does, typically in a few paragraphs.
-The Abstract should only provide a summary of the ZIP; the ZIP should -remain complete without the Abstract.
-Use links where applicable, e.g. 4 5.}
-The Abstract should only provide a summary of the ZIP; the ZIP should remain +complete without the Abstract.
+ +Use links where applicable, e.g. 4 5.}
+ +{Why is this proposal needed?
-This is one of the most important sections of the ZIP, and should be -detailed and comprehensive. It shouldnât include any of the actual -specification â donât put conformance requirements in this section.
+ +This is one of the most important sections of the ZIP, and should be detailed +and comprehensive. It shouldn’t include any of the actual specification – +don’t put conformance requirements in this section.
+Explain the status quo, why the status quo is in need of improvement, -and if applicable, the history of how this area has changed. Then -describe at a high level why this proposed solution addresses -the perceived issues. It is ok if this is somewhat redundant with the -abstract, but here you can go into a lot more detail.}
-{Describe design constraints on, or goals for the solution â -typically one paragraph for each constraint or goal. Again, donât -actually specify anything here; this section is primarily for use as a -consistency check that what is specified meets the requirements.}
-{This section is entirely optional. If it is present, it describes -issues that the proposal is not attempting to address, that -someone might otherwise think it does or should.}
-{Describe design constraints on, or goals for the solution – typically one +paragraph for each constraint or goal. Again, don’t actually specify anything +here; this section is primarily for use as a consistency check that what is +specified meets the requirements.}
+ +{This section is entirely optional. If it is present, it describes issues that +the proposal is not attempting to address, that someone might otherwise think +it does or should.}
+ +{Replace this entire section.}
-The Specification section describes what should change, using precise -language and conformance key words. Anything that is required in -order to implement the ZIP (or follow its process, in the case of a -Process ZIP) should be in this section.
-Avoid overspecification! Also avoid underspecification. Specification -is hard. Donât be afraid to ask for help.
-Feel free to copy from other ZIPs doing similar things, e.g. defining -RPC calls, consensus rules, etc.
-ZIPs MUST take into account differences between the Zcash Mainnet and -Testnet 6 where applicable. A consensus ZIP -MUST be able to be deployed on both Mainnet and Testnet.
-Unless the specification is particularly simple, you will need to -organise it under subheadings.
-At least while the ZIP is in Draft, we encourage writing open -questions and TODOs.
-The Specification section describes what should change, using precise language and +conformance key words. Anything that is required in order to implement the ZIP +(or follow its process, in the case of a Process ZIP) should be in this section.
+ +Avoid overspecification! Also avoid underspecification. Specification is hard. +Don’t be afraid to ask for help.
+ +Feel free to copy from other ZIPs doing similar things, e.g. defining RPC calls, +consensus rules, etc.
+ +ZIPs MUST take into account differences between the Zcash Mainnet and Testnet +2 where applicable. A consensus ZIP MUST be able to be deployed +on both Mainnet and Testnet.
+ +Unless the specification is particularly simple, you will need to organise it under +subheadings.
+ +At least while the ZIP is in Draft, we encourage writing open questions and TODOs.
+ +TODO: define byte encoding for the Jabberwock.
-Like RFCs, ZIPs are precise technical documents that SHOULD give -enough implementation information to implement part of a Zcash-related -protocol or follow a Zcash-related process 7.
+ +Like RFCs, ZIPs are precise technical documents that SHOULD give enough +implementation information to implement part of a Zcash-related protocol or follow a +Zcash-related process 6.
+ZIPs are different from RFCs in the following ways:
+Embedded LaTeX xâ
+â
y is allowed and
-encouraged in ZIPs. The syntax for inline math is
-â:math:
latex
-code`" in reStructuredText or "
latexcode`â
-in Markdown. The rendered HTML will use KaTeX 8,
-which only supports a subset of LaTeX, so you will need to double-check
-that the rendering is as intended.
In general the conventions in the Zcash protocol specification SHOULD -be followed. If you find this difficult, donât worry too much about it -in initial drafts; the ZIP editors will catch any inconsistencies in -review.
-â.. note::
â in reStructuredText, or
-â:::info
â (terminated by â:::
â) in Markdown,
-can be used for an aside from the main text.
The rendering of notes is colourful and may be distracting, so they -should only be used for important points.
-â.. warning::
â in reStructuredText, or
-â:::warning
â (terminated by â:::
â) in
-Markdown, can be used for warnings.
Warnings should be used very sparingly â for example to signal that a -entire specification, or part of it, may be inapplicable or could cause -significant interoperability or security problems. In most cases, a -âMUSTâ or âSHOULDâ conformance requirement is more appropriate.
-This is optional before publishing a PR, but to check whether a
-document is valid reStructuredText or Markdown, first install
-rst2html5
and pandoc
. E.g. on Debian-based
-distros::
sudo apt install python3-pip pandoc perl sed
-pip3 install docutils==0.19 rst2html5
-Then, with draft-myzip.rst
or
-draft-myzip.md
in the root directory of a clone of this
-repo, run::
make draft-myzip.html
-(or just âmake
â) and view draft-myzip.html
-in a web browser.
Each reference should be given a short name, e.g. âsnarkâ 9. The syntax to cite that reference
-is â[#snark]_
â in reStructuredText, or
-â[^snark]
â in Markdown.
The corresponding entry in the References -section should look like this in reStructuredText:
-.. [#snark] `The Hunting of the Snark <https://www.gutenberg.org/files/29888/29888-h/29888-h.htm>_. Lewis Carroll, with illustrations by Henry Holiday. MacMillan and Co. London. March 29, 1876.
Embedded \(\LaTeX\), e.g. \(x + y\), is allowed and encouraged in ZIPs. The syntax for
+inline math is “$latex code$
” in either Markdown or (as a
+non-standard extension) reStructuredText. This syntax does not work in tables for
+reStructuredText; in that case use “:math:`latex code`
” instead.
The rendered HTML will use KaTeX 7, which only supports a subset of \(\LaTeX\), +so you will need to double-check that the rendering is as intended.
+ +In general the conventions in the Zcash protocol specification SHOULD be followed. +If you find this difficult, don’t worry too much about it in initial drafts; the +ZIP editors will catch any inconsistencies in review.
+ +:::info
+“.. note::
” in reStructuredText, or “:::info
” (terminated by
+“:::
”) in Markdown, can be used for an aside from the main text.
+
.. warning::
” in reStructuredText, or “:::warning
” (terminated by
+“:::
”) in Markdown, can be used for warnings.This is optional before publishing a PR, but to check whether a document is valid
+reStructuredText or Markdown, first install docutils
and rst2html5
, and
+build MultiMarkdown-6
. E.g. on Debian-based distros::
sudo apt install python3-pip perl sed cmake
+pip3 install 'docutils==0.21.2' 'rst2html5==2.0.1'
+git clone -b develop https://github.com/Electric-Coin-Company/MultiMarkdown-6
+cd MultiMarkdown-6
+make release
+cd build
+make
+sudo make install
+
+
+Then, with draft-myzip.rst
or draft-myzip.md
in the root directory of a clone
+of this repo, run::
make draft-myzip.html
+
+
+(or just “make
”) and view draft-myzip.html
in a web browser.
Each reference should be given a short name, e.g. “snark” 8. The syntax to cite
+that reference is “[#snark]_
” in reStructuredText, or “[^snark]
” in Markdown.
The corresponding entry in the References section should look like this in +reStructuredText:
+ +.. [#snark] `The Hunting of the Snark <https://www.gutenberg.org/files/29888/29888-h/29888-h.htm>_. Lewis Carroll, with illustrations by Henry Holiday. MacMillan and Co. London. March 29, 1876.
+
+
or like this in Markdown::
-[^snark] [The Hunting of the Snark](https://www.gutenberg.org/files/29888/29888-h/29888-h.htm). Lewis Carroll, with illustrations by Henry Holiday. MacMillan and Co. London. March 29, 1876.
Note that each entry must be on a single line regardless of how long -that makes the line. In Markdown there must be a blank line between -entries.
-The current rendering of a Markdown ZIP reorders the references -according to their first use; the rendering of a reStructuredText ZIP -keeps them in the same order as in the References section.
+ +[^snark] [The Hunting of the Snark](https://www.gutenberg.org/files/29888/29888-h/29888-h.htm). Lewis Carroll, with illustrations by Henry Holiday. MacMillan and Co. London. March 29, 1876.
+
+
+Note that each entry must be on a single line regardless of how long that makes the +line. In Markdown there must be a blank line between entries.
+ +The current rendering of a Markdown ZIP reorders the references according to +their first use; the rendering of a reStructuredText ZIP keeps them in the same +order as in the References section.
+To link to another section of the same ZIP, use
-`Section title`_
`Section title`_
+
+
in reStructuredText, or
-[Section title]
[Section title]
+
+
in Markdown.
-For references to the Zcash protocol specification, prefer to link to
-a section anchor, and name the reference as
-[^protocol-<anchor>]
. This makes it more likely that
-the link will remain valid if sections are renumbered or if content is
-moved. The anchors in the protocol specification can be displayed by
-clicking on a section heading in most PDF viewers. References to
-particular sections should be versioned, even though the link will point
-to the most recent stable version.
Do not include the âhttps://zips.z.cash/
â part of URLs
-to ZIPs or the protocol spec.
{This section is entirely optional; if present, it usually gives -links to zcashd or zebrad PRs.}
-For references to the Zcash protocol specification, prefer to link to a section
+anchor, and name the reference as [^protocol-<anchor>]
. This makes it more likely
+that the link will remain valid if sections are renumbered or if content is moved.
+The anchors in the protocol specification can be displayed by clicking on a section
+heading in most PDF viewers. References to particular sections should be versioned,
+even though the link will point to the most recent stable version.
Do not include the “https://zips.z.cash/
” part of URLs to ZIPs or the protocol spec.
{This section is entirely optional; if present, it usually gives links to zcashd or +zebrad PRs.}
+ +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ââŠď¸
Zcash Protocol Specification, -Version 2022.3.8. Section 3.12: Mainnet and TestnetâŠď¸
Zcash Protocol Specification, -Version 2022.3.8. Section 3.3: The Block ChainâŠď¸
Zcash -Protocol Specification, Version 2022.3.8 or laterâŠď¸
Zcash Protocol Specification, -Version 2022.3.8. Section 1: IntroductionâŠď¸
Zcash Protocol Specification, -Version 2022.3.8. Section 3.12: Mainnet and TestnetâŠď¸
KaTeX - -The fastest math typesetting library for the webâŠď¸
The -Hunting of the Snark. Lewis Carroll, with illustrations by Henry -Holiday. MacMillan and Co. London. March 29, 1876.âŠď¸
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” ↩︎
+Zcash Protocol Specification, Version 2022.3.8. Section 3.12: Mainnet and Testnet ↩︎
+Zcash Protocol Specification, Version 2022.3.8. Section 3.3: The Block Chain ↩︎
+Zcash Protocol Specification, Version 2022.3.8. Section 1: Introduction ↩︎
+The Hunting of the Snark. Lewis Carroll, with illustrations by Henry Holiday. MacMillan and Co. London. March 29, 1876. ↩︎
+Embedded
- \(\LaTeX\)
- is allowed and encouraged in ZIPs. The syntax for inline math is ":math:`latex code`
" in reStructuredText or "$latex code$
" in Markdown. The rendered HTML will use KaTeX 6, which only supports a subset of
+ \(\LaTeX\!\)
+ , e.g.
+ \(x + y\!\)
+ , is allowed and encouraged in ZIPs. The syntax for inline math is "$latex code$
" in either Markdown or (as a non-standard extension) reStructuredText. This syntax does not work in tables for reStructuredText; in that case use ":math:`latex code`
" instead.
The rendered HTML will use KaTeX 6, which only supports a subset of \(\LaTeX\!\) , so you will need to double-check that the rendering is as intended.
In general the conventions in the Zcash protocol specification SHOULD be followed. If you find this difficult, don't worry too much about it in initial drafts; the ZIP editors will catch any inconsistencies in review.
@@ -95,9 +100,15 @@This is optional before publishing a PR, but to check whether a document is valid reStructuredText or Markdown, first install rst2html5
and pandoc
. E.g. on Debian-based distros:
sudo apt install python3-pip pandoc perl sed -pip3 install docutils==0.19 rst2html5+
This is optional before publishing a PR, but to check whether a document is valid reStructuredText or Markdown, first install docutils
and rst2html5
, and build MultiMarkdown-6
. E.g. on Debian-based distros:
sudo apt install python3-pip perl sed cmake +pip3 install 'docutils==0.21.2' 'rst2html5==2.0.1' +git clone -b develop https://github.com/Electric-Coin-Company/MultiMarkdown-6 +cd MultiMarkdown-6 +make release +cd build +make +sudo make install
Then, with draft-myzip.rst
or draft-myzip.md
in the root directory of a clone of this repo, run:
make draft-myzip.html
(or just "make
") and view draft-myzip.html
in a web browser.
\$latex code\$
" in either Markdown or (as a
+non-standard extension) reStructuredText. This syntax does not work in tables for
+reStructuredText; in that case use ":math:\`latex code\`
" instead.
+
+The rendered HTML will use KaTeX [^katex], which only supports a subset of $\LaTeX$,
+so you will need to double-check that the rendering is as intended.
In general the conventions in the Zcash protocol specification SHOULD be followed.
If you find this difficult, don't worry too much about it in initial drafts; the
@@ -174,11 +177,17 @@ or "SHOULD" conformance requirement is more appropriate.
## Valid markup
This is optional before publishing a PR, but to check whether a document is valid
-reStructuredText or Markdown, first install `rst2html5` and `pandoc`. E.g. on
-Debian-based distros::
-
- sudo apt install python3-pip pandoc perl sed
- pip3 install docutils==0.19 rst2html5
+reStructuredText or Markdown, first install `docutils` and `rst2html5`, and
+build ``MultiMarkdown-6``. E.g. on Debian-based distros::
+
+ sudo apt install python3-pip perl sed cmake
+ pip3 install 'docutils==0.21.2' 'rst2html5==2.0.1'
+ git clone -b develop https://github.com/Electric-Coin-Company/MultiMarkdown-6
+ cd MultiMarkdown-6
+ make release
+ cd build
+ make
+ sudo make install
Then, with `draft-myzip.rst` or `draft-myzip.md` in the root directory of a clone
of this repo, run::
diff --git a/zips/zip-guide.rst b/zips/zip-guide.rst
index 048594048..cba38add9 100644
--- a/zips/zip-guide.rst
+++ b/zips/zip-guide.rst
@@ -151,11 +151,13 @@ ZIPs are different from RFCs in the following ways:
Using mathematical notation
---------------------------
-Embedded :math:`\LaTeX` is allowed and encouraged in ZIPs. The syntax for inline
-math is "``:math:`latex code```" in reStructuredText or "``$latex code$``" in
-Markdown. The rendered HTML will use KaTeX [#katex]_, which only supports a subset
-of :math:`\LaTeX\!`, so you will need to double-check that the rendering is as
-intended.
+Embedded $\LaTeX$, e.g. $x + y$, is allowed and encouraged in ZIPs. The syntax for
+inline math is "``\$latex code\$``" in either Markdown or (as a non-standard
+extension) reStructuredText. This syntax does not work in tables for
+reStructuredText; in that case use "``:math:`latex code```" instead.
+
+The rendered HTML will use KaTeX [#katex]_, which only supports a subset of
+$\LaTeX$, so you will need to double-check that the rendering is as intended.
In general the conventions in the Zcash protocol specification SHOULD be followed.
If you find this difficult, don't worry too much about it in initial drafts; the
@@ -184,11 +186,17 @@ Valid markup
------------
This is optional before publishing a PR, but to check whether a document is valid
-reStructuredText or Markdown, first install ``rst2html5`` and ``pandoc``. E.g. on
-Debian-based distros::
-
- sudo apt install python3-pip pandoc perl sed
- pip3 install docutils==0.19 rst2html5
+reStructuredText or Markdown, first install ``docutils`` and ``rst2html5``, and
+build ``MultiMarkdown-6``. E.g. on Debian-based distros::
+
+ sudo apt install python3-pip perl sed cmake
+ pip3 install 'docutils==0.21.2' 'rst2html5==2.0.1'
+ git clone -b develop https://github.com/Electric-Coin-Company/MultiMarkdown-6
+ cd MultiMarkdown-6
+ make release
+ cd build
+ make
+ sudo make install
Then, with ``draft-myzip.rst`` or ``draft-myzip.md`` in the root directory of a
clone of this repo, run::