What is a coin-based transaction?
What are coin based transactions
Not to be confused with the cryptocurrency exchange Coinbase, the term “coinbase transaction” refers to a specific type of transaction that occurs in each new block of a blockchain.
Coinbase transactions are a key part of the system that blockchains use to introduce new currencies that have never been sent into circulation. The first coinbase transaction was generated by Bitcoin’s (BTC) pseudonymous creator, Satoshi Nakamoto, while mining the first genesis block. The coin base was reportedly paid to the Bitcoin address “1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa” with a value of 50 BTC.
One of the biggest curiosities of the Bitcoin blockchain is that said block was never verified on the blockchain – something that has puzzled many blockchain researchers and developers.
One theory is that this happened because the first ever coinbase transaction was encoded in the genesis block’s source code. And because the entire blockchain is built on this origin block, the concept of confirmation was not applied to it.
Another theory suggests that Nakamoto designed it this way since, if the genesis block were to go unverified for any reason, it would cause a new blockchain to be built, rendering the original blockchain obsolete.
The Coinbase transaction is also used to reward miners for maintaining the blockchain. They are paid a certain amount of coins for each block they mine. This reward system creates an incentive for miners and helps keep the blockchain secure by deterring malicious behavior that could destabilize the network.
How a coinbase transaction works
Coinbase transactions have unique features including maturity, fork prevention and customizable texts. They also have a different structure to other transactions.
On the Bitcoin blockchain, all transactions performed on the chain are combined to form a block. When a block is created, it will be immediately added to the blockchain. These blocks are immutable and tamper-proof due to the Bitcoin blockchain’s near-perfect code. Each block must contain one or more transactions, the first of which is always called a coinbase transaction.
How a coinbase transaction works:
- Block Creation: To earn the block reward after creating a new block, a miner must first create a coinbase transaction.
- Inputs: A coinbase transaction has no inputs, unlike a typical transaction, which uses inputs from previous transactions. A coinbase transaction instead generates brand new coins out of thin air.
- Outputs: The coinbase transaction has one or more outputs that show the addresses to which the block reward will be sent. Miners have the ability to distribute the block reward to other addresses.
- Block reward: The block reward is currently BTC and it is halved approximately every 210,000 blocks. This reward is paid to the miner who verifies and adds the transactions to the blockchain.
- Mining Fee: Miners can also include a mining fee in the coinbase transaction, which is paid by the transaction creators to incentivize miners to include their transactions in the next block.
A miner can include a coin-based transaction, along with other transactions, in the block they have mined and broadcast the block to the network after creating it. The block is then vetted by other miners and, if approved, uploaded to the blockchain and paid for by the block reward plus any associated mining fees.
Some key features of coinbase transactions are discussed below.
What are Block Rewards and Bitcoin Halving
Block rewards are the rewards that miners receive for mining new blocks and adding them to the blockchain. The Bitcoin halving reduces the block reward by 50% approximately every four years.
Miners are responsible for creating blocks on proof-of-work (PoW) blockchains like Bitcoin. In return, they are rewarded with BTC after the successful creation of each block. The block reward depends on two things: the number of fees included in the transactions for each block and the number of blocks from the genesis block.
During the early days of Bitcoin, the block reward was 50 BTC per block, and this reward is included in the coinbase transaction. Due to the Bitcoin halving, the block reward is halved after every 210,000 blocks mined. Bitcoin’s halving happens roughly every four years.
The block grant distributed by the coinbase transaction is 6.25 BTC per block (per last halving). And because coinbase transactions create new coins, it is valid without any input, since the BTC it contains is newly created and not previously spent.
For example, the Blockstream coinbase transaction at block 650,000 has no inputs and the single output is the amount of 6.25 BTC in addition to the miner’s 0.244131 BTC with collected fees.
What is a coin based maturity rule
The coinbase expiration rule governs when the block reward from a coinbase transaction can be used.
The BTC involved in the coinbase transaction cannot be used until the block has received at least 100 block confirmations on the blockchain. Unlike regular Bitcoin transactions that contain data showing the movement of BTC from one wallet to another, coinbase transactions contain data about the generation of a new currency that has not yet been spent.
For this reason, the input data in these transactions remains blank. Structurally, therefore, coin base transactions can also be considered simple empty inputs. The maturity rule was put in place to protect the blockchain from forks, which are events that occur when a community decides to implement changes to the blockchain’s protocol or set of rules.
What is fork prevention in a coinbase transaction
Coinbase transactions help prevent forks by including special rules for creation and validation.
Blockchains like Bitcoin are open source and rely on communities to maintain and develop their code. As such, an event such as a fork will cause the chain to split and produce a second blockchain. This blockchain will contain the entire history while heading in a new direction.
In such a circumstance, a miner can create as much BTC as they want if the new blockchain does not have the maturity rule in place, thus working against Bitcoin’s halving algorithm that seeks to preserve the cryptocurrency’s scarcity.
What is a transaction value and customizable text property in a coinbase transaction
Coinbase transaction value is based on factors such as each individual transaction’s value, block height and halving. Miners can add any customizable text to the blocks they have created.
The value of a coin-based transaction is determined by several factors. These include the value of each transaction validated by the block, the height of the block (number of transactions) and the halving relative to the block. Once the block has reached 100 confirmations, the miner can spend BTC.
When a block is created, it contains approximately 100 bytes of data. There is also an allowance for miners to include any text they prefer. Nakamoto, for example, wrote the following message when they mined Bitcoin’s genesis block:
This message is a reference to a headline in the British newspaper The Times from January 3, 2009, and is often seen as a commentary on the state of the global financial system at the time of Bitcoin’s creation.
Nakamoto chose to embed this message in the genesis block to emphasize the need for a decentralized and trustless system of transactions, free from the influence of central authorities and intermediaries.
Furthermore, miners can add any information they choose to customize the block, sending an immutable message forever.
How coin base transactions are structured
Coinbase transactions are structured as the first transaction in a block, where the miner includes a newly minted amount of BTC as a reward for their efforts in solving a complex mathematical problem to validate transactions and create a new block on the blockchain.
Coinbase transactions have a special format. Compared to a normal transaction input, a coin base transaction has a different set of values that do not represent unused transaction output (UTXO).
As such, instead of a transaction hash, a coinbase transaction will have 32 bytes, all set to zero. The output index is also filled with 4 bytes, all set to 0xFF (255 decimal places).