Let’s start with the often used word:
The process by which a peer or a node earns coins is called mining. The node which is earning through mining is called a miner.
Okay…but what is mining?
If you remember our discussion on hashcash – email sender had to find a specific type of hash. The rule being that the hash needed to start with 20 zeros.
Mining is a similar process where a peer in the cryptocurrency network works to verify the transaction and generate a hash out of it. A peer(node) earns coins for his effort once he finds the correct hash. Every cryptocurrency has its own rule on what exactly is the correct hash. This type of mining is also known as Proof of Work (PoW).
Note: When someone says “finding a block”, they actually mean generating the correct hash for the next block.
Here’s what the transaction between Red and Green looks like when we include mining. This assumes we have only one node (peer):
They are of two types:
All cryptocurrencies start off with a fixed supply of coins. This is the maximum number of coins for a cryptocurrency. The distribution of these coins happens through “block rewards”. Any one who finds a block is given some coins from this fixed supply.
Fixed supply of coins means that these rewards need to be adjusted every now and then. This ensures adoption is fast as early adopters tend to get a lot of coins.
Cryptocurrencies also implement a feature called block generation time. This helps in controlling the supply. It also ensures block rewards are not paid out too quickly.
The rewards differ from coin to coin:
Bitcoin (BTC) 21 million coins is the total supply. Early block reward was 50 bitcoins. In Bitcoin, tapering happens in form of halving the block reward every 4 years. So, block reward reduced to 25 BTC in 2012. It further reduced to 12.5 BTC in 2016. The next reduction to 6.25 BTC will happen in 2020.
Bitcoin’s block generation is 10 minutes. So, a node can earn 1.25 new bitcoins every minute (12.5 BTC per 10 minutes). Currently ~80% of the BTC supply has been mined.
Ethereum initial supply was set to a quintillion (billion times billion). Ethereum developers wanted to have a coin unlike bitcoin. The idea is that the coin should be mine-able forever. Currently the block reward is 5 ETH. There has been discussions to reduce this down to 3 ETH.
Ethereum’s block generation is ~14-20 secs per block. So there is ~15-20 new ETH per minute.
With block reward reducing over time, cryptocurrency includes an additional incentive for miners. This incentive is the transaction fees. The node finding the new block earns all the fees from the
transaction he has included in the block.
At the time of writing this the fees for bitcoin is ~ 0.000678 BTC per transaction and, fees for ethereum is ~0.00092 ETH.
While transactions with zero fees are also acceptable, miners might delay in verifying those transactions. That is simply capitalism at play – everyone needs an incentive to do something. So, it is always better to add fees.
Going back to our above Red, Green and Blue example. If in the picture Red and Green were using bitcoin, then at the end actual transaction will be with Blue earning coins for his effort:
Red = Debit of 1 BTC for transaction + Debit of 0.000678 BTC for fees = 1.000678 BTC
Green = Credit of 1 BTC from Red
Blue = Credit of 12.5 BTC in block reward and 0.000678 BTC in fees= 12.500678 BTC earned
I have expanded on an example used earlier. Assume Red and Green are transacting a fictional coin called JeansCoin.
A full network from this pic:
- Red’s identity and balance is verified using a digital signature – Discussed here
- Verification is done by multiple people in the network or peer to peer – Discussed here
- Grey is only verifying identity against the blockchain. So, Grey is a node(peer) but not a miner.
- Red, Green and Blue are miners. So, they are not only verifying the transaction, they are also securing the network by hashing information. Discussed here
- There is actually a competition going on between – Red, Green and Blue. So, the first one to find the hash earns reward coins as described above.
- Let’s say Blue finds the block. He will earn coins from the supply and fees from Red. Now the blockchain has an additional block.
- Now a new block added to the old chain. Every node needs to update their blockchain too. So the block from Blue goes out to – Red, Green and Grey.
- Next round of verification and transfers happen on the extended chain.
For a mainstream coin like Bitcoin, there are tons of nodes who verify and secure the network. Mining in itself is extremely competitive. People use specialized software and hardware to mine and earn those extra coins.
I hope this series has given you insights on all three parts of a cryptocurrency. In addition, money generation and how other parts fit in should also be clear now.
Also published on Medium.