Basically, blockchain is a ledger.
The ledger contains valid transactions in an orderly manner plus some relevant information.
Generally, cryptocurrencies live on top of the blockchain. And Bitcoin is the first successful cryptocurrency.
Blockchain looks like a chain of blocks. And each block connects to one elder block and one younger block.
What do these blocks contain?
Each block consists of transactions and some relevant data. Simply put, a book with transaction entries and other information. And anyone can access this data anytime.
Let’s understand how blockchain works.
There are few people in the ecosystem, namely, Alice, Bob, Cole, Donald, and Emily.
Alice has 10 dollars. And Bob has 15 dollars.
The ledger (blockchain) has information about the holdings of Alice and Bob.
Cole, Donald, and Emily have nothing. But these people and few enthusiasts maintain the ledger. They will update it whenever necessary – for example, verifying a transaction. And all these people will have a copy of the ledger.
The people who maintain the blockchain are nothing but Miners.
Now, Alice sends 5 dollars to Bob.
A message is sent to the miners.
The miners will verify the transaction by going through the ledger. And they will add the new transaction to the ledger after validating.
Now the balance of Alice is 5 dollars, and that of Bob is 20 dollars.
And for verifying the transactions, the Miner will get the transaction fees Alice has spent to send the money.
How does it work in reality?
Instead of updating the ledger when there is a new transaction, the ledger will be updated with a batch of transactions in the form of a block. Hence, the ledger will have a series of blocks.
Each block would have a reference to its previous block.
These blocks will be published promptly. For example, one block for every 10 minutes, which is the typical case for Bitcoin.
Once the block is published, other miners will check the block for authenticity.
Here, only the miner – sometimes a group of miners – who published a block will receive transaction fee as a reward.
This causes miners to rush to publish a block and win the reward. And in the process, some miners might do dishonest work that cripples the blockchain with improperly verified transactions.
There are few mechanisms to prevent bad mining.
Proof of Work
A miner who solves a complex mathematical problem can publish a block.
And the difficulty level of this problem varies based on the total problem-solving capacity of the network.
This way, a time gap can be set between two blocks. And the rate of cheating goes down dramatically as the miner works to solve the problem. If he found guilty of misbehavior, his block will be rejected. And his hard work goes in vain.
Proof of Stake
Instead of solving a mathematical problem, the miners must put a certain amount of funds in custody. Based on that, all the miners will elect one miner to publish a specific block.
If the elected miner has done something wrong, he will lose his funds.
Who creates the money?
Anyone can create a cryptocurrency. The value of a currency increases as the demand goes up.
Some cryptocurrencies will be created in the beginning. And it will be distributed based on selected criteria.
Otherwise, for every new block, the cryptocurrency is minted and is given to the miner who publishes that block. And that is a right way of keeping distribution fair and gaining public trust.
Uses of Blockchain
Cryptocurrencies are just one application of blockchain.
Blockchain is also used to implement:
- Smart Contracts:Self-executing programs that do certain actions when a condition is triggered. Most kinds of traditional contracts like agreements, delivery obligations, etc., can be implemented through smart contracts. When there is a dispute, the smart contract automatically provides a solution.
- Distributed Applications (dApps):These are the applications that run on multiple different computers with no single point of failure. Blockchain can help distributed applications to be run more securely and reliably. One example is any dApp that runs on Ethereum blockchain.
- Decentralized Autonomous Organizations (DAO):Blockchain helps to form decentralized governing bodies. The members will have voting rights based on the value they hold with the organization. And they can participate in decision-making
Moreover, there are many more use cases like distributed data storage, online privacy, digitalizing physical assets, and preventing identity theft.