Skip to content

Commit

Permalink
specify coinbase validity rules (#442)
Browse files Browse the repository at this point in the history
Adds validity rules for coinbase transactions

fixes: #286

---------

Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
  • Loading branch information
3 people authored Feb 27, 2023
1 parent 433ab79 commit e74dd91
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/protocol/tx_validity.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,14 @@ If change outputs are present, they must have:
### State Changes

Transaction processing is completed by removing spent UTXOs from the state and adding created UTXOs to the state.

### Coinbase Transaction

The coinbase transaction is a mechanism for block creators to convert fees into spendable UTXOs.

In order for a coinbase transaction to be valid:

1. It must be a [Mint](../protocol/tx_format/transaction.md#TransactionMint) transaction.
2. The coinbase transaction must be the first transaction within a block, even if there are no other transactions in the block and the fee is zero.
3. The total output value of the coinbase transaction cannot exceed the total amount of fees processed from all other transactions within the same block.
4. The `asset_id` for coinbase transaction outputs must match the `asset_id` that fees are paid in (`asset_id == 0`).

0 comments on commit e74dd91

Please # to comment.