Module subsidy

Source
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§

FundingStreamRecipient
A funding stream recipient as specified in protocol specification §7.10.1
FundingStreams
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§

FundingStreamReceiver
The funding stream receiver categories.
SubsidyError
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§

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