Blockchain: Deep Dive — Fundamentals 101 – Atharva
Everyone around is going crazy about this new buzzword in the market — Blockchain, now more than ever. There’s a lot of speculation about its future and how it will affect the economies around the globe. Undoubtedly blockchain is a rising star and is already disrupting the industry, but what exactly is a blockchain?
Bitcoin is an application of blockchain and not the blockchain itself. It was invented by the mysterious pseudonymous developer Satoshi Nakamoto in 2008. It was the first-ever created cryptocurrency that uses cryptography hash function for its encryption. We’ll talk about Bitcoin in detail in the upcoming articles.
Blockchain is a complex amalgamation of existing technologies mixed in the right proportions to form a decentralized system of transactions.
In other words, blockchain can be defined as a series of blocks of immutable data, encrypted using hashing algorithms connected to form a chain of blocks that are publicly distributed among every user on the network and has no single authority governing over it.
Types of Blockchain
- Public Blockchain
A public blockchain is a permissionless blockchain and is accessible to everyone on the internet, i.e anyone can participate in the network and carry out a transaction as well as become the validator.
Eg- Bitcoin, Ethereum.
- Private Blockchain
A private blockchain is a restricted blockchain and requires the invitation from the network administrators to join the network.
Eg- Hyperledger Fabric, Corda.
- Consortium Blockchain
A consortium blockchain is a semi-decentralized blockchain. It has restrictions as that of a private blockchain but works across different organizations.
Eg- Hyperledger, Quorum.
- Hybrid Blockchain
A hybrid blockchain makes the best of both worlds. The nodes or the users of the network can manage access control for the data.
A block is a digital record of transactions on a blockchain. A block has two components — a header and a body.
A Block header contains the following information:
- Block Number — Every block in a blockchain has a number attached to it which represents the position of the block in the chain.
The first block in a blockchain is commonly known as a Genesis block or block zero. It is always hardcoded into any blockchain-based protocol.
- Previous Block Hash — Every block header stores the hash of the previous block in the chain. A block hash is a reference number of fixed length generated using hashing algorithms.
- Merkle Root — A Merkle root is the hash of all the hashes of all the transactions that are part of a block in a blockchain network. A Merkle tree, also known as a hash tree is a binary tree that stores the hash of the transaction data of a blockchain. Every leaf node in the Merkle tree is the hash of a data block in the chain. The hash value of the leaf nodes is added together to form a new hash that is assigned to their parent node. All the internal nodes are assigned the hash value of its successor nodes added together.
- Nonce — Nonce or number only used once a unique 32-bit random number generated for mining of a block in the blockchain.
- Creation Timestamp — This is the timestamp of the block creation.
The time of block creation is not the same as the time of block added to the chain.
A Block body contains the actual data of the transaction:
- The sender’s public address.
- The sender’s public address.
- Amount (in cryptocurrency).
Hashing is the process of generating a value of a fixed length from the input string of any length, using mathematical functions known as hashing algorithms.
A transaction is a peer-to-peer to transfer of cryptocurrency, whose transaction data is stored in a block.
Components of a transaction
A wallet is a virtual account where a user stores their cryptocurrency.
- Wallet Address
A wallet address is 26–35 digit alphanumeric code which is unique to the blockchain and is assigned to the wallet. A wallet address is one time generated link by a wallet.
- Public Key
The public key is a uniquely generated pair of cryptographic codes during the first-ever transaction with a cryptocurrency.
The public key, as the name suggests, is public and can be accessed by anyone on the network. The public key of the recipient is used by the sender to transfer the funds to their wallet.
- Private Key
The private key is a uniquely generated pair of cryptographic codes during the first-ever transaction with a cryptocurrency.
A private key is like a password to your account which is kept secret at all times. A private key is used to authorize transactions. A public key is derived from the private key using a sophisticated cryptographic algorithm.
- Digital Signature
A digital signature is a cryptographic mechanism used to verify the authenticity and integrity of the digital data.
The private key is used to sign the transaction and the receiver can validate it using the public key which is attached along by the sender.
Miners in a blockchain network utilize their time and processing power to solve computationally expensive cryptographic hard puzzles.
Upon solving the puzzle, the block is verified and added to the blockchain and reward is given to the miner node.
- Mining Nodes — These nodes produce blocks for mining.
- Full Nodes — These nodes maintain and distribute the copies of the entire blockchain ledger.
- Super Nodes — They connect full nodes to each other and acts as information or redistribution relays to ensure everyone has the correct copy of the blockchain.
- Light Nodes or Thin Nodes — These are similar to the full nodes except they only store a very small portion of the blockchain and usually connect to the parent node or the full node.
- Full Nodes — These nodes verify the block that is broadcast into the network as per the rules defined in the Ethereum specifications.
- Light Nodes — These nodes contain the partial information of the network and rely on the full nodes to fill in the missing details.
Hyperledger Fabric has three types of nodes: Orderer nodes, Peer nodes, Client nodes.
- Orderer Nodes — These nodes form the ordering service, i.e a communication fabric that provides delivery guarantees.
- Peer Nodes — These nodes commit transactions and maintain a copy of the ledger.
- Client Nodes — These nodes act on the behalf of the end-user, submits an actual transaction, connects to peer nodes for communicating on the blockchain and broadcast transaction-proposals to the orderer nodes.
A candidate block is a temporary block created by collecting and organizing multiple unconfirmed transaction records from a pool of such records that a miner node is trying to mine.
Upon failure of verification the candidate block is discarded and upon success added to the blockchain.
A memory pool is waiting area for unconfirmed Bitcoin transaction records maintained by a full node.
A transaction pool is waiting area for unconfirmed Ethereum transaction records stored on a special device.
A consensus mechanism is a protocol followed by all the participants in the network to reach an agreement for the authenticity of the distributed ledger.
There are various consensus algorithms:
- Proof-of-Work (PoW)
- Casper or Proof-of-Stake (PoS)
- Delegated Proof-of-Stake (DPoS)
- Proof of Elapsed Time (PoET)
- Proof of Authority (PoA)
- Delegated Byzantine Fault Tolerance (dBFT)
So, that’s all for the introduction of the blockchain. Detailed articles on each topic will be uploaded soon. Thank you for reading.
Never Stop Building.