Skip to content

Draft RFC: Block subsidy#1129

Merged
teor2345 merged 62 commits intomainfrom
oxarbitrage-patch-1
Mar 30, 2021
Merged

Draft RFC: Block subsidy#1129
teor2345 merged 62 commits intomainfrom
oxarbitrage-patch-1

Conversation

@oxarbitrage
Copy link
Copy Markdown
Contributor

@oxarbitrage oxarbitrage commented Oct 6, 2020

TODO

See #338

Transaction Fee Validation Rules

4.11 In Bitcoin, all inputs to and outputs from a transaction are transparent. The total value of transparent outputs must not exceed the total value of transparent inputs. The net value of transparent inputs minus transparent outputs is transferred to the miner of the block containing the transaction; it is added to the miner subsidy in the coinbase transaction of the block.

The total amount of transparent outputs from a coinbase transaction, minus the amount of the value Balance field if present, MUST NOT be greater than the amount of miner subsidy plus the total amount of transaction fees paid by transactions in this block.

As a consequence ofcoinbase transactions having no Spend descriptions, the valueBalance field of a coinbase transaction must have a negative or zero value. The negative case can only occur after Heartwood activation, for transactions with [ZIP-213] shielded outputs.

Coinbase Source Validation Rules

A transaction with one or more transparent inputs from coinbase transactions MUST have no transparent outputs (i.e.tx_out_count MUST be 0). Inputs from coinbase transactions include Founders’ Reward outputs.

A transaction MUST NOT spend a transparent output of a coinbase transaction from a block less than 100 blocks prior to the spend. Note that transparent outputs of coinbase transactions include Founders’ Reward outputs and transparent funding stream outputs.

Prior to the Heartwood network upgrade, it was not possible for coinbase transactions to have shielded outputs, and therefore the “coinbase maturity” rule and the requirement to spend coinbase outputs only in transactions with no transparent outputs, applied to all coinbase outputs.

Summary

Zebra manages semantic verification in the zebra-consensus crate, this is done for all incoming blocks. Inside each block the coinbase transaction is special, it holds the subsidy rewards that are paid to different participants(miners, founders, stream receivers). This RFC describes how to implement the needed calculations and verification for block subsidy and miner fees.

More information

Feature Name: block_subsidy

Start Date: 2020-10-05

Design PR: ZcashFoundation/zebra#1129

Zebra Issue: None by now

Document

Rendered.

Zebra Team Approval

Everyone on the Zebra team should review design RFCs:

Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Copy link
Copy Markdown
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start for a design!

Thanks for the tables and the headings, they make things a lot easier to read.

There's just a few things we need to tweak before we start implementing.

Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md
teor2345 and others added 2 commits February 23, 2021 06:30
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Copy link
Copy Markdown
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make changes based on Daira's suggestions.

@oxarbitrage
Copy link
Copy Markdown
Contributor Author

I addressed all comments from @daira . Very appreciated, feel free to revisit the changes and let me know if any of them still need improvements.

Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
oxarbitrage and others added 2 commits February 25, 2021 19:44
Co-authored-by: teor <teor@riseup.net>
Co-authored-by: teor <teor@riseup.net>
Comment thread book/src/dev/rfcs/xxxx-block-subsidy.md Outdated
Co-authored-by: teor <teor@riseup.net>
@teor2345
Copy link
Copy Markdown
Contributor

teor2345 commented Mar 8, 2021

Since we're checkpointing on Canopy, we can ignore Founders Reward validation. So we need to decide if we want to:

  • move the Founders Reward sections into a separate draft RFC, or
  • delete the Founders Reward sections

@teor2345 teor2345 changed the title RFC: Block subsidy Draft RFC: Block subsidy Mar 30, 2021
@teor2345
Copy link
Copy Markdown
Contributor

We've decided to merge this RFC as a draft for now, see #338 for more details.

Comment thread book/src/dev/rfcs/drafts/xxxx-block-subsidy.md Outdated
Comment thread book/src/dev/rfcs/drafts/xxxx-block-subsidy.md
@teor2345 teor2345 merged commit 1302ffe into main Mar 30, 2021
@teor2345 teor2345 deleted the oxarbitrage-patch-1 branch March 30, 2021 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docs Area: Documentation C-design Category: Software design work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants