A Byte of Blockchain - Week 15 : Incentives in Blockchain - Mining & Transaction Fees
Photo by Olya Kobruseva from Pexels
Last week we introduced the topic of incentives in a blockchain. Why should nodes put in any effort to maintain and carry on a blockchain? What incentive do they get out of this?
Incentive design is a critical aspect in designing a blockchain so that the nodes stay motivated to maintain the network and help it grow to derive more value from the network as there is no centralized authority to decide on who gets what.
We extracted some key points from Satoshi Nakamoto's white paper on how he introduced the concept of incentives in the bitcoin blockchain. Let us see them again :
By convention, the first transaction in a block is a special transaction that starts a new coin owned by the creator of a block. This adds an incentive for nodes to support the network, and provides a way to initially distribute coins into circulation, since there is no central authority to issue them.
The steady addition of a constant amount of new coins is analogous to gold miners expending resources to add gold to circulation. In our case, it is CPU time and electricity that is expended.
The incentive can also be funded with transaction fees. If the output value of a transaction is less than its input value, the difference is a transaction fee that is added to the incentive value of the block containing the transaction.
The incentives may help encourage nodes to stay honest. If a greedy attacker is able to assemble more CPU power than the honest nodes, he would have to choose between using it to defraud people by stealing back his payments, or using it to generate new coins.
He ought to find it more MORE PROFITABLE TO PLAY BY THE RULES, such rules that favor him with more new coins than everyone else combined, than to undermine the system and validity of his own wealth.
From the first point above, we understand that the first transaction in a "block" is a special transaction and that starts a new coin which will be owned by the creator of that block. Now, what is a block?
Let us rewind back to week 6 where we considered an example of four people who got funding to start their own business. We saw they shared a common ledger as below:
Point 5 in the diagram 2 above is key to our discussion - If certain conditions are satisfied, the transaction is added to the common ledger.
A transaction is normally considered as part of "books of account" when it is recorded in the ledger and the individual ledgers include these transactions.
There are two stages of booking a transaction :
a. Input of the transaction in the system
b. Authorization of the transaction
In a normal corporate system, the above functions are done by two different people. It is more from a control perspective that the person inputting the transaction should not authorize the transaction. So, only when a transaction is authorized, it becomes part of the ledger.
We defined blockchain in Week 5 as a system that allows a network of connected computers to maintain a single, updated and secured ledger.
A BLOCK is actually the building block of a blockchain and blocks are where the transactions are recorded. So a block holds batches of valid transactions. A blockchain is actually composed of a chain of multiple blocks "chained" together (We will get into "chaining" at a later stage).
So, when we say that transactions should be "recorded" on the blockchain, it means that the block containing these transactions should be "added" to the blockchain and be a part of the blockchain. This "adding" of a new block to the blockchain is called "mining". When a transaction reaches a "mining" node, it is verified and may be included in a block.
Mining is the process of appending new blocks to the blockchain data structure.
So, when a block is "mined" (added to the blockchain data structure), the node which adds this block gets a "coin". Now, sounds easy right?? Well, it is not.
A mining node can add blocks to a blockchain only after solving hard cryptographic puzzles. And the mining nodes compete with each other to add blocks to the blockchain database. The first mining node to solve the hard cryptographic puzzle will get to add the block to the blockchain and earn the "coin" of that block.
If you refer to the first point above from Satoshi Nakamoto's white paper - By convention, the first transaction in a block is a special transaction that starts a new coin owned by the creator of a block. This adds an incentive for nodes to support the network, and provides a way to initially distribute coins into circulation, since there is no central authority to issue them.
So the mining node which gets to add the block creates an initial transaction which creates a "coin" and if the block gets added to the blockchain, the node gets the "coin".
To be clear, this is a very oversimplified explanation of mining in blockchain. There are lot of other technical aspects of mining which we will get into later as we are restricting our discussion to mining in relation to incentives.
Another way in which nodes are incentivized is by "transaction fees". What is transaction fees? It is defined in point 3 above reproduced below :
The incentive can also be funded with transaction fees. If the output value of a transaction is less than its input value, the difference is a transaction fee that is added to the incentive value of the block containing the transaction.
For example, if A sends 10 bitcoins to B, the transaction is initiated,verified and added to the blockchain. B will get 9 bitcoins. The one bitcoin goes to the miner who adds the block to the blockchain assuming the transaction fees is 1 Bitcoin for this transaction.
So, a blockchain is a self sustaining ecosystem where the participants themselves run the system and get rewarded by the system itself for maintaining it. Another way the network will benefit is when more users start using the network, the more valuable the network becomes and in turn the more valuable the "coin" of that blockchain becomes. This is called NETWORK EFFECT.
We will discuss points 4 & 5 and come back to other aspects of mining at a later stage as it involves several deep dives into other concepts.
In point 2, we saw that analogous to gold mining, the blockchain mining nodes have a cost factor when mining coins in a blockchain network. They have to solve a complex cryptographic puzzle and to solve that puzzle, their computer or laptop has to work very hard to solve that puzzle. The puzzle is so difficult to solve that now there are specialized hardware only to solve these puzzles. The cost factor here is the CPU time and electricity expended for this purpose.
The cost of mining a digital currency is actually the cost of electricity expended in the CPU process used for solving the cryptographic puzzle which results in mining that currency.