Blockchain is an immutable growing ledger that keeps track of all the transactions taking place in a decentralized, distributed and secure manner.
Blockchain was the underlying technology behind Bitcoin. Since then, it has been exploited and used in other cryptocurrencies like Ethereum, Bitcoin Cash. The important components of a blockchain system are Nodes, Miners/Validator, Consensus.
Decentralized: In Blockchain, the transactions are not stored in a centralized server. Instead, a copy of all the transactions taking place in the system is shared with every node. So even if a single node’s data is hacked and tampered, it won’t affect the system.
Distributed: In a distributed system, instead of running a system in a single location, it is distributed in multiple locations. It is done so that even if one of the components fails, it won’t affect the overall functioning of the system. In a Blockchain system, every node runs the respective blockchain protocol. So that even if one of the systems turns out to be malicious, it won’t hamper the system’s performance.
Immutable: The past transactions(data) in a Blockchain can not be changed. Blockchain uses a hash function to make itself immutable. Every block stores the hash of the previous block. So if a block has tampered, the hash of the block would change and would make the blockchain invalid.
Consensus: It is the heart of Blockchain. It makes sure that all the nodes agree with the new transactions added to the blockchain. Some of the well-known consensus protocols are Proof-of-Work and Proof of Stake.
A cryptocurrency is a digital asset class that can be used as a medium of exchange. The transactions are securely stored in a blockchain. It does not exist in physical form. Some of the well-known cryptocurrencies are Bitcoin, Ethereum, Ripple.
A Cryptographic hash function is a special type of function that maps a message of arbitrary size with a hash value of fixed length. The hash is usually a combination of alphanumeric characters. The most important feature of Cryptographic Hash Functions are –
1. One way function– When we input a message, a hash is generated. But if we enter the hash, it won’t generate the original message.
2. Avalanch effect– When there is a small change in the input message, there is a drastic change in the output hash.
In Proof-of-Work(PoW), the blockchain network leverages special participants known as Miners. Once transactions are done, the miners pick up the transactions from the mempool(usually the ones with higher transaction fees). Miners create block by grouping these transactions, along with nonce to find a target hash. It involves heavy computation, as the hash should start with a fixed number of zeros to make it eligible to be included in the next block.
In Proof-of-Stake(PoS), the blockchain network leverages special participants called validators. Validators stakes a certain amount of cryptocurrencies to vouch for the validity of the transactions.
A validator can either be delegated by other nodes or it can be selected at random based on the network protocol. The validator would choose a collection of transactions for validation.
The other nodes verify the transactions. If transactions found valid, they will be included in the next block, and the validator will receive a reward.
A 51% attack on a blockchain network refers to a group of miners trying to control over 50% of a network’s mining power. With this, the attacker has the power to mutilate the blockchain history and censor transactions.
Fault-Tolerance: Blockchains are the best fault-tolerance technology ever existed.
No central authority controls it, the system is decentralized and distributed all over the Globe. Blockchains are open, hence anyone can attack it. Yet, the best blockchains have never been taken over.
Security and resilience: Blockchain uses cryptography and hash functions to store transactions securely. The data is shared with all the nodes so that even if one node’s data is mutilated, the other nodes would still have the authentic data.
Pseudonymity: All the users in the blockchain network are pseudonymous i.e the users have a pseudo-identity(address), which doesn’t reveal the user’s real identity. It allows users to communicate with others in a generally anonymous way. It helps to maintain user privacy and enables free transactions without any security worries.
A collection of blocks makes the Blockchain. A typical block contains a block hash, nonce, hash of the previous block, and some metadata.
Some Blockchains like Ethereum also enables the smart contract. In such a block, the smart contract’s bytecode is stored in the Blockchain. The most important block is the Genesis block. It is the first block ever created in the blockchain network. It contains the initial number of cryptocurrencies and is usually created by the creator of the blockchain network. Since it is the first block, its previous hash parameter is null.