Zebra: Validate that only the first transaction in a block is a coinbase transaction

Created on 10 Mar 2020  路  4Comments  路  Source: ZcashFoundation/zebra

image

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

We'll need to check:

  1. there is at least one transaction in the block
  2. the first transaction in the block is a coinbase transaction
  3. there are no other coinbase transactions in the block

Checks 1 and 2 are already implemented by Block.coinbase_height().is_some():
https://github.com/ZcashFoundation/zebra/blob/main/zebra-chain/src/block.rs#L47

We validate blocks in the zebra-consensus BlockValidator:
https://github.com/ZcashFoundation/zebra/blob/main/zebra-consensus/src/verify/block.rs#L97

A-consensus spec-readthrough

All 4 comments

@oxarbitrage you might like to do this ticket, you can start it as soon as you have time.

Note: after NU3 activation, the consensus rules on coinbase transactions change, so we'll need to handle that.

Note: after NU3 activation, the consensus rules on coinbase transactions change, so we'll need to handle that.

This ticket is about Coinbase inputs and the "one coinbase transaction per block" rule. That rule doesn't change in Heartwood.

I opened #608 for Shielded Coinbase Outputs, which are allowed by Heartwood ZIP-213:
https://zips.z.cash/zip-0213

Fixed by #593

Was this page helpful?
0 / 5 - 0 ratings

Related issues

teor2345 picture teor2345  路  5Comments

oxarbitrage picture oxarbitrage  路  6Comments

dconnolly picture dconnolly  路  4Comments

teor2345 picture teor2345  路  3Comments

dconnolly picture dconnolly  路  5Comments