When you're starting out in the domain of blockchain , information can be quite overwhelming. There are lots of buzzwords that you come across which do sound good but aren't very clear. I faced similar issues when I started out . So , I've tried my level best to simplify it for absolute beginners to blockchain. You may skip this if you're an expert in the domain.
What is Blockchain?
Blockchain, at its core, is an immutable ledger, a record of transactions that cannot be altered. Information is hashed using cryptographic algorithms into blocks which are then connected to each other. Hence , the term 'block'+'chain'.
How Does a Blockchain Work?
Here's a simplified explanation:
1 -> Transaction: When a transaction occurs, it's broadcasted to all nodes in the network. The transaction details include the sender's and receiver's addresses and the amount transferred.
2 -> Block Creation: Transactions are grouped into a 'block'. Each block contains a unique code called a 'hash' and the hash of the previous block in the chain, linking the blocks in a chronological 'chain'.
3 -> Verification: Nodes validate the transactions in the block, checking if the sender has sufficient balance for the transaction and if the transaction hasn't been tampered with.
If any block is tampered , that shall change the hash value and so all other blocks will reject it. This is why blockchain is secure.
4 -> Consensus: Once a block is verified, it needs to be added to the blockchain. The nodes agree on the block's validity through a process called 'consensus'. In Bitcoin, this is achieved through 'Proof of Work'. However, there are many other consensus algorithms. This basically checks whether the provided information satisfies the rules of the network and the state of ledger.
5 -> Adding the Block: After consensus is reached, the block is added to the chain. This update is propagated throughout the network, and the block becomes a permanent transaction record.
For more information, check this link. It lets you simulate the workflow.
Types of Blockchain
Based on its architecture and operation, blockchain can be classified into two types:
Public Blockchain: This is the well-known version that includes cryptocurrencies like Bitcoin and Ethereum. As the name suggests, it's open to everyone and truly decentralized.
Private Blockchain: This version is less popular. It operates on the same fundamentals but is permissioned, meaning not everyone is allowed. An example is Hyperledger Fabric.
In simple terms, the differences are:
- Public Blockchain:
- 💰 Transaction fees is applied to every transaction. (e.g., Ethereum, Solana).
- ✅ Open to Everyone.
- Private Blockchain:
- ❌ No transaction fees (e.g., Hyperledger Fabric, R3 Corda).
- 🛗 Only selected individuals are welcome.
Image Credits : This image is from : 101 Blockchains
Hyperledger Fabric
I'll be focusing on private blockchain, specifically Hyperledger Fabric, as it's the one I've worked with most.
Hyperledger Fabric is akin to a Lego set for building blockchains. It helps businesses create secure, private blockchains to track transactions or any other data. Access to these chains can be restricted based on company policies.
You can host your Hyperledger Fabric network on your own infrastructure, whether it's Docker-based or Kubernetes. Kubernetes is commonly used for production-grade networks.
Components of a Hyperledger Fabric Network
Here's a basic introduction to the components in a Hyperledger Fabric network. I'll cover them in more detail in the next blog:
Certificate Authority (CA): Your identity in a Hyperledger Fabric-based network is created and managed using certificates generated by the Certificate Authority. All the access within the network is regulated using these certificates.
Orderer Nodes: These nodes apply consensus and operations related to adding blocks and validations. There are various consensus algorithms that these can run.
Chaincodes: This is where the business logic is written for different organization members. This is where you write code. As of now , it can be written in go, java or javascript.
Peers: Peers are nodes owned by organizations. They maintain the ledger, run the chaincode (business logic), and participate in the validation and addition of transactions to the blockchain.
Channels: These are sub-networks within the blockchain network. These sub-networks are isolated from each other.
In the next blog, I'll delve into detailed explanations of network components and also steps to setting up a network on the Kubernetes cluster.
Top comments (0)