Blockchain: Deep Dive — Fundamentals 101 – Atharva

0 4

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.

Blockchain schematic-diagram

Types of Blockchain

  1. 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.
  2. 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.
  3. 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.
  4. 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.
    Eg- Dragonchain.
A typical block diagram for any blockchain

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:

  1. 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.
  2. 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.
  3. 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.
  4. Nonce — Nonce or number only used once a unique 32-bit random number generated for mining of a block in the blockchain.
  5. 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:

  1. The sender’s public address.
  2. The sender’s public address.
  3. Amount (in cryptocurrency).
SHA- 256 Hashing Encryption

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

  1. Wallet
    A wallet is a virtual account where a user stores their cryptocurrency.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

Mining is the process of validating a candidate block using the Proof-of-Work consensus mechanism before adding it to the blockchain. Mining is carried out by the special nodes called miners.

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.

A node is a computer/device that communicates with the blockchain platform and is connected with every other node to form a network. Every blockchain platform has different types of nodes.

Bitcoin Blockchain has four types of nodes: full nodes, supernodes, light nodes, and mining nodes.

  1. Mining Nodes — These nodes produce blocks for mining.
  2. Full Nodes — These nodes maintain and distribute the copies of the entire blockchain ledger.
  3. 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.
  4. 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.

Ethereum Blockchain has two types of nodes: full nodes and light nodes.

  1. Full Nodes — These nodes verify the block that is broadcast into the network as per the rules defined in the Ethereum specifications.
  2. 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.

  1. Orderer Nodes — These nodes form the ordering service, i.e a communication fabric that provides delivery guarantees.
  2. Peer Nodes — These nodes commit transactions and maintain a copy of the ledger.
  3. 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:

  1. Proof-of-Work (PoW)
  2. Casper or Proof-of-Stake (PoS)
  3. Delegated Proof-of-Stake (DPoS)
  4. Proof of Elapsed Time (PoET)
  5. Proof of Authority (PoA)
  6. 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.


You might also like
WhatsApp chat