Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calc Block Subsidy and Funding Streams #338

Closed
7 tasks
dconnolly opened this issue Mar 31, 2020 · 1 comment · Fixed by #3040
Closed
7 tasks

Calc Block Subsidy and Funding Streams #338

dconnolly opened this issue Mar 31, 2020 · 1 comment · Fixed by #3040
Assignees
Labels
A-consensus Area: Consensus rule updates NU-4 Canopy Network Upgrade: Canopy specific tasks NU-5 Network Upgrade: NU5 specific tasks

Comments

@dconnolly
Copy link
Contributor

dconnolly commented Mar 31, 2020

Motivation

When validating blocks and transactions, we need to calculate the block subsidy.

Specifications

Consensus rule: [Canopy onward] The coinbase transaction at block height height MUST contain at least one output per funding stream fs active at height, that pays fs.Value(height) zatoshi in the prescribed way to the stream’s recipient address represented by fs.AddressListfs.AddressIndex(height).

The “prescribed way” to pay a transparent P2SH address is to use a standard P2SH script of the form OP_HASH160 fs.RedeemScriptHash(height) OP_EQUAL as the scriptPubKey. Here fs.RedeemScriptHash(height) is the standard redeem script hash for the recipient address given by fs.AddressList fs.AddressIndex(height) in Base58Check form. The standard redeem script hash is specified in [Bitcoin-Multisig] for P2SH multisig addresses, or [Bitcoin-P2SH] for other P2SH addresses.

The “prescribed way "to pay a Sapling address is as defined in [ZIP-213], using the post-Heartwood consensus rules specified for Sapling outputs of coinbase transactions in § 7.1 ‘Transaction Encoding and Consensus’ on p. 116.

https://zips.z.cash/protocol/protocol.pdf#fundingstreams

Existing Work

Block Subsidy and Funding Streams Design RFC PR: #1129

Founders Reward Implementation PR: #1170

Remaining Work

Semantic Validation RFC

  • Since Zebra has a mandatory checkpoint at Canopy, we can ignore the founders reward
    • Delete the founders reward parts of the RFC and implementation
  • Review the funding streams parts of the RFC

Semantic Validation Implementation

  • Implement funding streams
  • Implement other semantic validation from the RFC

Contextual Validation

Requirements

image

https://zips.z.cash/protocol/protocol.pdf#subsidyconcepts
https://zips.z.cash/protocol/protocol.pdf#blockchain
https://zips.z.cash/protocol/protocol.pdf#subsidies
https://zips.z.cash/protocol/protocol.pdf#foundersreward

image

image

@dconnolly dconnolly added Poll::Pending A-consensus Area: Consensus rule updates labels Mar 31, 2020
@dconnolly dconnolly added this to the Validate transactions. milestone Mar 31, 2020
@hdevalence hdevalence added S-blocked Status: Blocked on other tasks and removed Poll::Pending labels Aug 17, 2020
@oxarbitrage oxarbitrage self-assigned this Sep 8, 2020
@mpguerra mpguerra removed this from the Transaction Validation milestone Jan 5, 2021
@teor2345 teor2345 removed the S-blocked Status: Blocked on other tasks label Jan 5, 2021
@mpguerra mpguerra added NU-2 Blossom Network Upgrade: Blossom specific tasks NU-4 Canopy Network Upgrade: Canopy specific tasks NU-3 Heartwood Network Upgrade: Heartwood specific tasks NU-5 Network Upgrade: NU5 specific tasks labels Jan 15, 2021
@dconnolly dconnolly mentioned this issue Mar 5, 2021
53 tasks
@teor2345 teor2345 changed the title Calc Block Subsidy and Founder's Reward Calc Block Subsidy, skip Founder's Reward Mar 8, 2021
@teor2345 teor2345 changed the title Calc Block Subsidy, skip Founder's Reward Calc Block Subsidy Mar 8, 2021
@mpguerra mpguerra removed the E-med label Mar 23, 2021
@teor2345 teor2345 changed the title Calc Block Subsidy Calc Block Subsidy and Funding Streams Mar 30, 2021
@teor2345 teor2345 added this to the 2021 Sprint 8 milestone Mar 31, 2021
@mpguerra mpguerra removed NU-2 Blossom Network Upgrade: Blossom specific tasks NU-3 Heartwood Network Upgrade: Heartwood specific tasks labels May 6, 2021
@teor2345
Copy link
Contributor

We've chosen to delay work on miner rewards and block subsidy until later, so I'm removing this from the sprint.

@teor2345 teor2345 removed this from the 2021 Sprint 13 milestone Jun 15, 2021
@teor2345 teor2345 added this to the 2021 Sprint 21 milestone Jul 22, 2021
mergify bot pushed a commit that referenced this issue May 23, 2023
* ZIPs were updated to remove ambiguity, this was tracked in #1267.

* #2105 was fixed by #3039 and #2379 was closed by #3069

* #2230 was a duplicate of #2231 which was closed by #2511

* #3235 was obsoleted by #2156 which was fixed by #3505

* #1850 was fixed by #2944, #1851 was fixed by #2961 and #2902 was fixed by #2969

* We migrated to Rust 2021 edition in Jan 2022 with #3332

* #1631 was closed as not needed

* #338 was fixed by #3040 and #1162 was fixed by #3067

* #2079 was fixed by #2445

* #4794 was fixed by #6122

* #1678 stopped being an issue

* #3151 was fixed by #3934

* #3204 was closed as not needed

* #1213 was fixed by #4586

* #1774 was closed as not needed

* #4633 was closed as not needed

* Clarify behaviour of difficulty spacing

Co-authored-by: teor <[email protected]>

* Update comment to reflect implemented behaviour

Co-authored-by: teor <[email protected]>

* Update comment to reflect implemented behaviour when retrying block downloads

Co-authored-by: teor <[email protected]>

* Update `TODO` to remove closed issue and clarify when we might want to fix

Co-authored-by: teor <[email protected]>

* Update `TODO` to remove closed issue and clarify what we might want to change in future

Co-authored-by: teor <[email protected]>

* Clarify benefits of how we do block verification

Co-authored-by: teor <[email protected]>

* Fix rustfmt errors

---------

Co-authored-by: teor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates NU-4 Canopy Network Upgrade: Canopy specific tasks NU-5 Network Upgrade: NU5 specific tasks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants