A blockchain is a set of blocks each of which records details of several transactions. Together, it creates a distributed ledger that is nearly immutable and is able to process transactions in a much efficient manner.
Blockchains issue cryptocurrencies which are can be transacted cheaply and almost instantly. This led to the creation of a new era of finance called as Decentralized Finance.
Table of Contents
History of Blockchains
Though blockchains existed since 1996 when Nick Szabo brought the concept of cryptocurrencies. However, then cryptocurrencies could not exist in a way that prevented double spending.
Why early cryptocurrencies met failure?
In early cryptocurrencies, anyone could copy them and spend them a number of times. This made it difficult to see whose transaction was original because every transaction was identical.
This problem was called as double spending.
Bitcoin Solves Double Spending
The first cryptocurrency which prevented double spending was Bitcoin. It solved the problem through an innovative method called proof of work. Each transaction was broadcasted to the entire network and was verified multiple times. Further, a copy of all transactions was available with everyone, which prevented fake transactions.
The people who validated the transactions had to go through a complex process to obtain a value called Nonce, which was unique to each transaction. Since every verifier could obtain the Nonce value independently, they were able to see that a transaction was valid.
The transaction verifiers are paid a part of blockchain transaction fees. For proof of work blockchains, they are called as miners and for proof of stake blockchains they are known as validators.
Automation of Blockchains with Ethereum
The second generation of blockchain started when Ethereum was launched in 2015, its founder Vitalik Buterin and other co-founders added a feature called smart contracts which automated transactions. Now transactions need not to be initiated by humans, the blockchain was itself capable of doing so.
The application was seen in betting, auctioning, decentralized exchanges, liquidity pools, cryptocurrency swapping protocols and several other areas.
New Era of Cross-Chain Functionality
Even the second generation of blockchains could not transfer assets among each other.
This was solved with cross-chain transfers. Tokens were either locked or burnt on one blockchain and minted on the other. The value of tokens burnt on one chain were of the same value as those minted on the other chain.
This was possible for all kinds of tokens, whether fungible (cryptocurrencies) or non-fungible (NFTs).
Emergence of New Applications
After the maturing of blockchain technology by 2018, new trends emerged in blockchain which catered to data management (The Graph), Internet of Things (IOTA Chain), data transfers to and from blockchains (Chainlink) and non-traceable blockchains(Monero).
Trends which were till now suppressed due to reasons such as lack of adoption also re-emerged.
One such application was asset tokenization. This application made it possible to convert the ownership of real world assets like cars, land and property into blockchain tokens which made it possible to transfer them within record time (as compared to traditionally several weeks).
Blockchain Terminology
- Atomic Swaps: These are cross-chain transfers between two addresses without the need of any centralized party. Asset is either locked or burnt on one chain and minted on another.
- Coins: Those cryptocurrencies which exist on their own blockchain are called as coins. For example BTC on Bitcoin’s blockchain or ETH on Ethereum’s blockchain.
- Consensus Mechanism: Consensus mechanism is a way through which multiple nodes in a blockchain agree that a certain transaction is valid or invalid.
- Cryptocurrencies: These are assets on the blockchain which carry real monetary value. They can be converted in cash. These tokens are fungible which means they can be divided into small denominations (fungibility). For example, Bitcoin can be divided into 100 Million Satoshi, which is the smallest unit of a Bitcoin.
- Difficulty: This is the numerical measure of complexity which is encountered while validating a blockchain transaction.
- Finality: This is the step where blockchain transactions are permanently recorded in a block and few blocks have already passed. It ensures that a transaction is already final. Bitcoin’s finality is 6 blocks which means that after your transaction is added, 6 blocks should pass before receiver is able to use those funds.
- Gas Fee: These are the transaction fees which are paid for transacting on the blockchain. Though initially meant for Ethereum transaction fees only, now it is a widely used term.
- Gas Price: The price required to be paid to sign and initiate a transaction. In Ethereum, gas is calculated in terms of Gwei.
- Gas Wars: A gas war is the auction for priority of keeping a transaction before everyone else. In blockchain, transactions are auctioned and bidders who are bidding higher fees are included first in a block.
- Genesis Block: This is the first block of a blockchain and unlike other blocks it does not have any hash function of previous block since it is the very first one.
- Halving: This is the schedule where Bitcoin’s rewards for miners reduced by half for each new block.
- Hash: A hash is a data set that is obtained after processing earlier data in a way that the process is not possible backwards. For example, if the hash of data X creates data Y, the hash of data Y does not create data X.
- Hash Rate: Hash Rate is the number of cryptographic hashes that can be done in one second.
- Immutability: This is the blockchain feature which makes it almost impossible to change blockchain transactions after they are finalized.
- Forks: A fork is a change in the blockchain. Hard forks are changes that make irreconcilable differences between the original and the new blockchains while soft forks are changes that do not impact the compatibility of original blockchains. No new blockchain is created as a result of soft fork.
- Mainnet and Testnet: Mainnets are the main blockchain networks on which transactions occur while testnets are the functional replicas of mainnet used for testing of new blockchain features, tokens or Dapps.
- Merkle Root: Merkle Root of a block is the hash result of all the transactions present in that block.
- Merkle Tree: The pathway using which Merkle Root was generated is called the Merkle Block.
- Mining: In proof of work blockchains the process of validating transactions and adding them to the blocks is known as mining.
- NFTs: Non Fungible Tokens are those which cannot be divided. These are mostly assets which can be:
- Text
- Audio
- Video
- Image
- Code
- Software
- Node: A node is a blockchain verifier that has full rights to add transactions to a blockchain. In a proof of work blockchain, these nodes are called as miners and in a proof of stake blockchain they are called as validators.
- Nonce Value: The nonce value is a number which is obtained after hashing the transaction details and hash value of previous transaction in a block. Nonce values are unique for each transaction.
- Oracles: Oracles are softwares that send information to blockchain smart contracts in a secure and verified manner. Examples are Chainlink, QED, etc. They can be either centralized or decentralized.
- Orphan Block: Orphan blocks are those blocks which contain verified transactions but are not accepted in a blockchain because the transactions were already included in other blocks which were produced faster.
- Optimistic Rollups: This is a mechanism where transaction data is written on an empty part of a block which was meant for storing metadata. Since writing metadata on blocks does not require validation, it costs cheaper than recording transactions in a blockchain. The transactions are written on a blockchain but in a cheaper way.
- Private key: These are basically passkeys which allow you to send and receive cryptocurrencies. You can only send a cryptocurrency if you sign the transaction with your private key. If someone else accesses your private keys, they can access your funds, or even steal them.
- Public Address: Also known as public key, this is the address on the blockchain using which you can receive cryptocurrencies. The public address is usually an alphanumeric string.
- Ring Signature: A ring signature is a shared signature which is used to sign blockchain transactions. The ring signature could be used by anyone of the ring members.
- Sharding: This is the process of dividing the single giant blockchain consensus network into numerous smaller ones which can process transactions independently. This increases the speed of the blockchains since each shard acts as an independent chain.
- Smart Contract: A smart contract is a piece of code on a blockchain which can automate transactions based on a pre-determined instruction. For example, if a certain thing happens, pay X amount to someone.
- Staking: This is the process of collateralizing cryptocurrencies so that you are given the right to validate transactions and earn rewards. Even if not validating transactions, anyone can stake their crypto to earn rewards indirectly (through a validator).
- Tokens: Tokens are cryptocurrencies which are not on their own blockchain or might have no blockchain of their own. For example, USDT is a token on Ethereum’s Blockchain while ETH is a coin on Ethereum.
- Token Standards: These are standardized protocols of creating new blockchain tokens which makes it possible for swapping with each other. For example USDT and USDC are stablecoins which both exist as ERC-20 tokens. ERC-20 is an Ethereum token standard.
- Turing Complete: It means that a certain computer can execute any conceivable program or software. Ethereum is Turing Complete.
- Wallet: A wallet is a software which stores your public addresses and private keys and lets you send and receive cryptocurrencies. For example: Lightning Network Wallet for Bitcoin.
- Hot Wallet: These are wallets which exist as a software and are meant for easy access.
- Cold Wallet: These are wallets which exist on hardware and are meant for secured storage.
- Wrapped Tokens: These are tokens which locked in one chain and minted on another which makes it seem like they have been transferred across chains. For example, Bitcoin can be wrapped to create WBTC and transferred to Ethereum as an ERC-20 token.
- Zero Knowledge Rollups: This is a mechanism which allows for the validation of a blockchain(L1) transaction outside of the blockchain (on another chain{L2}). At the end the summary of transaction is validated at once to see if there is any error.
How does a Blockchain Work?
All blockchains work basically in a similar way which starts with initiating a transaction, which is then verified and after that is finalized. The following stepwise process illustrates the working of a blockchain along with a flowchart.
- A transaction is initiated by a user.
- The transaction is broadcasted to all the nodes (verifiers).
- Each node runs computations to verify the transaction.
- Transactions are added to a block.
- The newly added block is broadcasted to the network.
- The block is finalized when a certain number of new blocks is added after it.
Hacking in Blockchain
- Re-Entrancy Attack: In this attack, a function in the code is externally invoked which leads it to run multiple times in a single transaction. Hackers are able to repeat the same transfer of funds multiple times.
- 51% Attack: Blockchain transactions work on majority rule. If more than 51% of nodes are hacked, then the hacker can do whatever with other people’s balance. This was seen in the Axie Infinity Hack where 51% (11/21 nodes) were hacked by Lazarus Group and at the end resulted in a $625 million loss.
- DAO Attack: On June 17, 2016 Ethereum was hacked and hackers were able to steal 3.6 million of the total 11.5 Million ETH. This lead to the creation of Ethereum Classic which opposed the rollback (hard fork).
- Frontrunning: Frontrunning is the process of buying tokens before a buyer and then selling the tokens to that original buyer for a higher price.