From a9fc3aed12780edec4505d49777645226988eae1 Mon Sep 17 00:00:00 2001
From: Daira-Emma Hopwood 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 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)\)
-
Sapling child key derivation
Deriving a child extended spending key
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}\) ) 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 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.32
cmu
byte[32]
32
32
cmx
byte[32]
32
ephemeralKey
byte[32]
580
We use hardened-only child key derivation as defined in ZIP 32 4 for the issuance authorizing key.
\(\mathsf{CKDsk}((\mathsf{sk}_{par},\mathsf{c}_{par}), i) \rightarrow (\mathsf{sk}_{i}, \mathsf{c}_{i})\) -
+ :During transaction construction, each output with memo data is
assigned a 32-byte memo key Kmemo. These keys SHOULD be
+class="math inline">\(\mathsf{K^{memo}}\). 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 .
+is replaced by \(\mathsf{K^{memo}}\).The transaction builder generates a 32-byte salt value salt from a CSPRNG. A new salt MUST be -generated for each memo bundle.
+class="math inline">\(\mathsf{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
+class="math inline">\(\mathsf{K^{memo}}\) as follows:
\(\hspace{2em}\mathsf{encryption\_key} = +\mathsf{PRF^{expand}_{K^{memo}}}([\mathtt{0xE0}] \,||\, +\mathsf{salt})\)
+The first byte \(\mathtt{0xE0}\) should be added to the documentation of inputs to PRFexpand in § 4.1.2 ‘Pseudo +class="math inline">\(\mathsf{PRF^{expand}}\) in § 4.1.2 ‘Pseudo Random Functions’ 7.
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 8 as follows:
IETF_AEAD_CHACHA20_POLY1305(encryption_key, nonce, memo_chunk)
-where nonce = I2BEOSP88(counter) || [final_chunk] .
+class="math inline">\(\hspace{2em}\mathsf{IETF\_AEAD\_CHACHA20\_POLY1305}(\mathsf{encryption\_key}, +\mathsf{nonce}, \mathsf{memo\_chunk})\) +where \(\mathsf{nonce} = +\mathsf{I2BEOSP}_{88}(\mathsf{counter}) \,||\, +[\mathsf{final\_chunk}]\).
This is a variant of the STREAM construction 9.
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 @@ -193,8 +196,9 @@
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:
encryption_key
as above, and then proceed as
+follows:
counter = 0
and
final_chunk = 0x00
.fAllPruned
uint8
nonceOrHash
byte[32]
nMemoChunks
compactSize
pruned
byte[
ceiling(n
M
e
m
o
C
h
u
n
k
s
/8)]
]
vMemoChunks
.vMemoChunks
MemoChunk[nMemoChunks]
Change
Each Sapling or Orchard note plaintext (denoted np) -consists of
-(leadByte ⦂ 𝔹𝕐, d ⦂ 𝔹[ℓd], rseed ⦂ 𝔹𝕐[𝟛𝟚], memo ⦂ 𝔹𝕐[𝟝𝟙𝟚])
+class="math inline">\(\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
@@ -333,15 +338,17 @@Changes to 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 ⦂ 𝔹𝕐[𝟝𝟙𝟚])
+class="math inline">\(\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 np) -consists of
-(leadByte ⦂ 𝔹𝕐, d ⦂ 𝔹[ℓd], rseed ⦂ 𝔹𝕐[𝟛𝟚], Kmemo ⦂ 𝔹𝕐[𝟛𝟚])
+class="math inline">\(\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 § 4.7.2 ‘Sending Notes (Sapling)’ Changes to the
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.
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.
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.
All of these changes apply identically to Mainnet and Testnet.
@@ -494,39 +504,29 @@- | 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%) | ||||||||||||||||||||||||||||||
512 | 20 @ 11220 (+ 9.57%) | 20 @ 11220 (+ 9.57%) | ||||||||||||||||||||||||||||||
256 | 40 @ 12200 (+19.14%) | 20 @ 11540 (+12.70%) | ||||||||||||||||||||||||||||||
256 20-out | 20 @ 6100 (-40.43%) | @@ -544,39 +544,29 @@ |
- | 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%) | ||||||
512 | 20 @ 10900 (+ 6.45%) | 20 @ 10900 (+ 6.45%) | ||||||
256 | 40 @ 11560 (+12.89%) | 20 @ 11220 (+ 9.57%) | ||||||
256 20-out | 20 @ 5780 (-43.55%) | @@ -596,21 +586,22 @@ | ||||||
Bytes | Name | Data Type | @@ -114,7 +119,7 @@||||||
8 | burnAmount |
uint64 |
@@ -122,9 +127,9 @@
The burn_amount of a transaction is
-defined to be the value of the burnAmount
field if present,
-and otherwise 0.
The \(\mathsf{burn\_amount}\) of a
+transaction is defined to be the value of the burnAmount
+field if present, and otherwise 0.
Notes:
-[NU7 onward] burn_amount MUST be in -the range {0..MAX_MONEY}.
+[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 burn_amount to the Common
-Transaction Fields that are the input to the digest in T.1:
-header_digest
\(\mathsf{burn\_amount}\)
+to the Common Transaction Fields that are the input to the digest in
+T.1: header_digest
15:
diff --git a/rendered/zip-0234.html b/rendered/zip-0234.html index 35ada1278..fac4f75ae 100644 --- a/rendered/zip-0234.html +++ b/rendered/zip-0234.html @@ -3,7 +3,9 @@T.1f: burn_amount (8-byte little-endian burn amount)
ZIP 234: Network Sustainability Mechanism: Issuance Smoothing - + + + @@ -35,7 +37,7 @@Terminology
The terms “Mainnet” and “Testnet” are to be interpreted as described in § 3.12 ‘Mainnet and Testnet’. 4
-The symbol “ ⋅ ” means +
The symbol “\(\,\cdot\,\)” means multiplication, as described in § 2 ‘Notation’. 5
“ZEC/TAZ” refers to the native currency of Zcash on a given network, @@ -43,11 +45,12 @@
Terminology
The terms “Block Subsidy”, “Issuance”, and “Burning” are to be interpreted as described in ZIP 233. 6
-Let PostBlossomHalvingInterval be as +
Let \(\mathsf{PostBlossomHalvingInterval}\) be as defined in 7.
-MAX_MONEY, as defined in § 5.3 -‘Constants’ \(\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 @@ -55,13 +58,13 @@
Terminology
“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 IssuedSupply(height) defined in § 4.17 ‘Chain -Value Pool Balances’. 9
+class="math inline">\(\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 MAX_MONEY − IssuedSupply(height) .
+by \(\mathsf{MAX\_MONEY} - +\mathsf{IssuedSupply}(\mathsf{height})\).Abstract
This ZIP proposes a change to how nodes calculate the block subsidy.
@@ -123,9 +126,10 @@Requirements
Specification
Parameters
--
B
L
O
C
K
_
S
U
B
S
I
D
Y
_
F
R
A
C
T
I
O
N
= 4126/10_000_000_000 = 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:
- It is after NU7 activation height.
@@ -146,26 +150,30 @@Parameters
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 -B
L
O
C
K
_
S
U
B
S
I
D
Y
_
F
R
A
C
T
I
O
N
. +\(\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 -ZEC ⋅B
L
O
C
K
_
S
U
B
S
I
D
Y
_
F
R
A
C
T
I
O
N
, -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(height) = The -value of the Money Reserve after the specified block height.
-Issuance Calculation
-At the
+class="math inline">\(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.DEPLOYMENT_BLOCK_HEIGHT
, nodes should switch from -the current issuance calculation, to the following:BlockSubsidy(height) = ceiling(
+class="math inline">\(\mathsf{MoneyReserveAfter}(\mathsf{height}) +=\) The value of the Money Reserve after the specified block +height. +B
L
O
C
K
_
S
U
B
S
I
D
Y
_
F
R
A
C
T
I
O
N
⋅ MoneyReserveAfter(height − 1))Issuance Calculation
+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))\)
Applicability
All of these changes apply identically to Mainnet and Testnet.
Rationale
@@ -177,20 +185,24 @@Rationale
BLOCK_SUBSIDY_FRACTION
Let IntendedMoneyReserveFractionRemainingAfterFourYears = 0.5 .
-The value 4126/10_000_000_000 -satisfies the approximation within ±0.002%:
-(1 −
+class="math inline">\(\mathsf{IntendedMoneyReserveFractionRemainingAfterFourYears} += 0.5\). +B
L
O
C
K
_
S
U
B
S
I
D
Y
_
F
R
A
C
T
I
O
N
)PostBlossomHalvingInterval ≈ IntendedMoneyReserveFractionRemainingAfterFourYearsThe 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 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/10_000_000_000 .
+class="math inline">\(\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 diff --git a/rendered/zip-0235.html b/rendered/zip-0235.html index 4b2213bf9..07a86bd7d 100644 --- a/rendered/zip-0235.html +++ b/rendered/zip-0235.html @@ -3,7 +3,9 @@
ZIP 235: Burn 60% of Transaction Fees - + + + @@ -35,23 +37,24 @@Terminology
The terms “Mainnet” and “Testnet” are to be interpreted as described in § 3.12 ‘Mainnet and Testnet’. 4
-The symbol “ ⋅ ” means -multiplication, as described in § 2 ‘Notation’. [^protocol-notation]
+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. 5
+interpreted as described in ZIP 233. 6Abstract
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 6.
+via the new block subsidy rules proposed by ZIP 234 7.Motivation
-ZIP 233 (“Network Sustainability Mechanism: Burning” 7) +
ZIP 233 (“Network Sustainability Mechanism: Burning” 8) describes a method by which ZEC can be burned to support network sustainability.
By introducing a requirement that a certain proportion of transaction @@ -62,8 +65,8 @@
Benefits to the Network
- Network Sustainability: This mechanism involves temporarily reducing the supply of ZEC, similar to asset burning in -Ethereum’s EIP-1559 8, but with long-term sustainability +Ethereum’s EIP-1559 9, but with long-term sustainability benefits, as the burned funds effectively boost future mining rewards, making it an attractive option for current and future Zcash users.
- Incentivizing Transaction Inclusion: By maintaining @@ -98,13 +101,14 @@
Requirements
Specification
Consensus Rule Changes
For a given block, the coinbase transaction MUST have a burn_amount, as defined in 9, -that is greater than or equal to floor(transactionFees ⋅ 6/10) .
-The version of a coinbase transaction MUST be v6 or later \(\mathsf{burn\_amount}\), as defined in 10.
+role="doc-noteref">10, 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 11.
Applicability
All of these changes apply identically to Mainnet and Testnet.
Rationale
@@ -117,28 +121,29 @@Rationale
for requiring the coinbase transaction to be v6 or laterThere is no explicit mechanism in prior transaction versions to burn the required funds. Since 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 burn_amount with earlier versions than v6, -but only when transactionFees = 0. That -would introduce a corner case in the transaction consensus rules that is -not useful, since it is expected that the transactionFees will normally be +class="math inline">\(\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.
Estimated impact on miners
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 11).
+actions (see ZIP 317 12).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. 12
+href="#fn13" class="footnote-ref" id="fnref13" +role="doc-noteref">13Considerations for the Future
If transaction fees were to increase, further modifications can @@ -161,10 +166,10 @@
Considerations for the
The implementation of this ZIP MUST be deployed at the same time or -after ZIP 233 (“NSM: Burning” 13), and ZIP 234 (“NSM: -Issuance Smoothing” 14).
+after ZIP 233 (“NSM: Burning” 14), and ZIP 234 (“NSM: +Issuance Smoothing” 15).ZIP 233: Network Sustainability
-Mechanism: Burning Zcash Protocol
+Specification, Version 2024.5.1 [NU6]. Section 2: Notation↩︎
ZIP 234: Network Sustainability
-Mechanism: Issuance Smoothing ZIP 234: Network Sustainability
+Mechanism: Issuance Smoothing↩︎
ZIP 234: Network Sustainability
-Mechanism: Issuance Smoothing ZIP 234: Network Sustainability
+Mechanism: Issuance Smoothing↩︎
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.\) @@ -656,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].\)
diff --git a/rendered/zip-0317.html b/rendered/zip-0317.html index bf2e70936..b8abefbf9 100644 --- a/rendered/zip-0317.html +++ b/rendered/zip-0317.html @@ -3,7 +3,9 @@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.
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 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 diff --git a/rendered/zip-guide.html b/rendered/zip-guide.html index ccc02ec80..840785f73 100644 --- a/rendered/zip-guide.html +++ b/rendered/zip-guide.html @@ -3,7 +3,9 @@
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
+ , 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.