Why I Renamed the “Coinbase” Transaction to “Mint” and Moved it to the End of the Block

2024-07-25 · Ryan X. Charles

EarthBucks is a from-scratch implementation of a blockchain that bears some resemblance to Bitcoin. In Bitcoin, the “coinbase” transaction is the unique transaction in every block where new Bitcoins are minted. I have decided to rename this transaction from “coinbase” to “mint” to be less confusing (everybody thinks of the company Coinbase when they hear “coinbase,” which has nothing to do with the transaction in the blockchain). I have also decided to move the mint transaction to the end of the block so that Merkle trees can be updated differentially to enable instant block propagation.

Mint Transaction

In Bitcoin, the coinbase transaction includes new Bitcoins and mining fees that come from the transactions in the block. Consider that all transactions in a block are ordered chronologically except for the coinbase. If the coinbase transaction takes fees from the other transactions, shouldn’t it be after the transactions that it takes fees from, like every other transaction? Considered in this light, it is logical that the coinbase transaction should be at the end of the block.

In EarthBucks, there are no change fees, but there are other ways a mint transaction may take fees from the other transactions in a block, particularly mining. On EarthBucks, every mine is also a mining pool, and the users contribute hash, meaning the mint transaction must be updated constantly with new outputs reflecting the mining rewards for each miner. This means that as new transactions come in, the mint transaction is always chronologically last. Not only does it make sense to put the mint transaction at the end of the block based on chronology, but it also enables differential Merkle tree updates for efficient block propagation.

Merkle Tree Overview

The transactions in a block are contained inside a Merkle tree, which is a balanced binary tree of hashes with transactions as leaves. The primary purpose of the Merkle tree is to enable inclusion proofs, which are proofs that a transaction is included in a block. You can verify that a transaction was mined without necessarily downloading the entire block. All you need to do is download the block header and the Merkle path to the transaction you are interested in.

Differential Merkle Tree Updates

Bitcoin sends every transaction twice: once when it is created and broadcast initially, and a second time when the block is found. Every time a block is found, the entire block is sent even though every transaction has already been seen by every mine.

EarthBucks aims to send every transaction only once (albeit with many other “update” messages containing transaction IDs). When a mine sends a transaction to another mine, it also sends all relevant information for determining the order of the transaction in the next block, including all information necessary to update, but not rebuild, the current working Merkle tree. This is what I call “differential Merkle tree updates.” This is more efficient than sending every transaction twice because all the necessary bandwidth and computation are spread out throughout the duration of the block, rather than all at once when the block is found.

Differential Merkle tree updates require that the mint transaction is at the end of the block, because otherwise it would be updated at the start of the Merkle tree, complicating the logic of differential updates. It is much simpler if it is at the end like every other transaction so that the Merkle tree is updated in order.

Conclusion

In EarthBucks, the “coinbase” transaction has been renamed to “mint” and moved to the end of the block to enable differential Merkle tree updates and therefore instant block propagation.


Earlier Blog Posts


Back to Blog

Home · About · Blog · Privacy · Terms
X · Telegram · Discord · reddit · GitHub
Copyright © 2024 Ryan X. Charles LLC