Expand description
Constants and calculations for Block Subsidy and Funding Streams
This module contains the consensus parameters which are required for verification.
Some consensus parameters change based on network upgrades. Each network upgrade happens at a particular block height. Some parameters have a value (or function) before the upgrade height, at the upgrade height, and after the upgrade height. (For example, the value of the reserved field in the block header during the Heartwood upgrade.)
Typically, consensus parameters are accessed via a function that takes a
Network
and block::Height
.
Structs§
- Funding
Stream Recipient - A funding stream recipient as specified in protocol specification §7.10.1
- Funding
Streams - Funding stream recipients and height ranges.
- POST_
NU6_ FUNDING_ STREAMS_ MAINNET - The post-NU6 funding streams for Mainnet as described in ZIP-1015.
- POST_
NU6_ FUNDING_ STREAMS_ TESTNET - The post-NU6 funding streams for Testnet as described in ZIP-1015.
- PRE_
NU6_ FUNDING_ STREAMS_ MAINNET - The pre-NU6 funding streams for Mainnet as described in [protocol specification §7.10.1][7.10.1] [7.10.1]: https://zips.z.cash/protocol/protocol.pdf#zip214fundingstreams
- PRE_
NU6_ FUNDING_ STREAMS_ TESTNET - The pre-NU6 funding streams for Testnet as described in [protocol specification §7.10.1][7.10.1] [7.10.1]: https://zips.z.cash/protocol/protocol.pdf#zip214fundingstreams
Enums§
- Funding
Stream Receiver - The funding stream receiver categories.
- Subsidy
Error - Block subsidy errors.
Constants§
- BLOSSOM_
POW_ TARGET_ SPACING_ RATIO - Used as a multiplier to get the new halving interval after Blossom.
- FIRST_
HALVING_ 🔒REGTEST - The first halving height in the regtest is at block height
287
. - FIRST_
HALVING_ 🔒TESTNET - The first halving height in the testnet is at block height
1_116_000
as specified in protocol specification §7.10.1 - FUNDING_
STREAMS_ NUM_ ADDRESSES_ MAINNET - Number of addresses for each funding stream in the Mainnet.
In the spec (protocol specification §7.10) this is defined as:
fs.addressindex(fs.endheight - 1)
however we know this value beforehand so we prefer to make it a constant instead. - FUNDING_
STREAMS_ NUM_ ADDRESSES_ TESTNET - Number of addresses for each funding stream in the Testnet.
In the spec (protocol specification §7.10) this is defined as:
fs.addressindex(fs.endheight - 1)
however we know this value beforehand so we prefer to make it a constant instead. - FUNDING_
STREAM_ ADDRESS_ CHANGE_ INTERVAL - Address change interval function here as a constant as described in protocol specification §7.10.1.
- FUNDING_
STREAM_ ECC_ ADDRESSES_ MAINNET - List of addresses for the ECC funding stream in the Mainnet.
- FUNDING_
STREAM_ ECC_ ADDRESSES_ TESTNET - List of addresses for the ECC funding stream in the Testnet.
- FUNDING_
STREAM_ MG_ ADDRESSES_ MAINNET - List of addresses for the Major Grants funding stream in the Mainnet.
- FUNDING_
STREAM_ MG_ ADDRESSES_ TESTNET - List of addresses for the Major Grants funding stream in the Testnet.
- FUNDING_
STREAM_ RECEIVER_ DENOMINATOR - Denominator as described in protocol specification §7.10.1.
- FUNDING_
STREAM_ SPECIFICATION - The specification for pre-NU6 funding stream receivers, a URL that links to ZIP-214.
- FUNDING_
STREAM_ ZF_ ADDRESSES_ MAINNET - List of addresses for the Zcash Foundation funding stream in the Mainnet.
- FUNDING_
STREAM_ ZF_ ADDRESSES_ TESTNET - List of addresses for the Zcash Foundation funding stream in the Testnet.
- LOCKBOX_
SPECIFICATION - The specification for post-NU6 funding stream and lockbox receivers, a URL that links to ZIP-1015.
- MAX_
BLOCK_ SUBSIDY - The largest block subsidy, used before the first halving.
- POST_
BLOSSOM_ HALVING_ INTERVAL - After Blossom the block time is reduced to 75 seconds but halving period should remain around 4 years.
- POST_
NU6_ FUNDING_ STREAMS_ NUM_ ADDRESSES_ MAINNET - Number of addresses for each post-NU6 funding stream on Mainnet.
In the spec (protocol specification §7.10) this is defined as:
fs.addressindex(fs.endheight - 1)
however we know this value beforehand so we prefer to make it a constant instead. - POST_
NU6_ FUNDING_ STREAMS_ NUM_ ADDRESSES_ TESTNET - Number of addresses for each post-NU6 funding stream in the Testnet.
In the spec (protocol specification §7.10) this is defined as:
fs.addressindex(fs.endheight - 1)
however we know this value beforehand so we prefer to make it a constant instead. - POST_
NU6_ FUNDING_ STREAM_ FPF_ ADDRESSES_ MAINNET - List of addresses for the Major Grants post-NU6 funding stream on Mainnet administered by the Financial Privacy Fund (FPF).
- POST_
NU6_ FUNDING_ STREAM_ FPF_ ADDRESSES_ TESTNET - List of addresses for the Major Grants post-NU6 funding stream on Testnet administered by the Financial Privacy Fund (FPF).
- POST_
NU6_ 🔒FUNDING_ STREAM_ NUM_ BLOCKS - The number of blocks contained in the post-NU6 funding streams height ranges on Mainnet or Testnet, as specified in ZIP-1015.
- POST_
NU6_ 🔒FUNDING_ STREAM_ START_ HEIGHT_ MAINNET - The start height of post-NU6 funding streams on Mainnet as described in ZIP-1015.
- POST_
NU6_ 🔒FUNDING_ STREAM_ START_ HEIGHT_ TESTNET - The start height of post-NU6 funding streams on Testnet as described in ZIP-1015.
- POST_
NU6_ 🔒FUNDING_ STREAM_ START_ RANGE_ MAINNET - The post-NU6 funding stream height range on Mainnet
- POST_
NU6_ 🔒FUNDING_ STREAM_ START_ RANGE_ TESTNET - The post-NU6 funding stream height range on Testnet
- PRE_
BLOSSOM_ HALVING_ INTERVAL - Halving is at about every 4 years, before Blossom block time is 150 seconds.
Traits§
- Parameter
Subsidy - Functionality specific to block subsidy-related consensus rules
Functions§
- block_
subsidy BlockSubsidy(height)
as described in protocol specification §7.8- funding_
stream_ address_ period - Returns the address change period as described in protocol specification §7.10
- funding_
stream_ values - Returns the
fs.Value(height)
for each stream receiver as described in protocol specification §7.8 - halving_
divisor - The divisor used for halvings.
- height_
for_ halving - The first block height of the halving at the provided halving index for a network.
- miner_
subsidy MinerSubsidy(height)
as described in protocol specification §7.8- num_
halvings - The halving index for a block height and network.
- output_
amounts - Returns all output amounts in
Transaction
.