A Comprehensive Guide to Ethereum Blockchain (Part 1)
This guide will only contain must-have information regarding key elements in Blockchain & practical walkthroughs as well. Blockchain technology has many flavors which are designed according to industry needs, here we will focus primarily on two flavors, called Ethereum & Hyperledger Fabric.
Basically, a blockchain consists of these elements:
- Genesis block (first block)
- Chain of blocks
- Each block have data, hash, previous block hash (If data changes -> hash will change)
- Consensus mechanisms (PoW, PoS)
- Consensus of Nodes (in Peer-to-Peer network)
There are two types of Blockchain.
- Public blockchain
- Private blockchain
1.1 Public blockchain
Apublic blockchain network is completely open. Anyone can join and participate in the network. The network typically has an incentivizing mechanism to encourage more participants to join the network. Bitcoin is one of the largest public blockchain networks in production today while Ethereum comes second.
1.2 Private blockchain
A private blockchain involves a separate, essentially closed network, of blockchain participants (also known as nodes). Each participant has their own copy of the blockchain, essentially a ledger, with a locked-down history of all of the transactions that took place in the network. Hyperledger Fabric is an example of a private blockchain.
Now let’s move to the platform you are going to use first. It is Ethereum, which is used to develop DApps (Decentralized Apps).
Ethereum is an open-source decentralized platform featuring smart contract functionality. It provides a decentralized virtual machine, the Ethereum Virtual Machine (EVM), that can execute peer-to-peer contracts using a crypto-fuel called Ether.
2.1 How it works
- Ethereum blockchain network is simply lots of EVM (Ethereum Virtual Machines) or “nodes” connected to every other node to create a mesh. An EVM can be visualized as a simple nodejs (or any other) process for example which behaves like a full-fledged Ethereum instance.
- Each node runs a copy of the entire blockchain and competes to mine the next block or validate a transaction.
- Whenever a new block is added, the blockchain gets updated and this change is propagated to the entire network, such that each node is in sync.
To become a node in the Ethereum network, your computer will have to download (and keep updated) a copy of the entire Ethereum blockchain through CLI tools that Ethereum provides. Geth is one such tool that is intended for web development.
Geth is a command-line interface (CLI) tool that communicates with the Ethereum Network and acts as a link between your computer and the rest of the Ethereum nodes (or network computers) just like you would download a torrent client to become part of a torrent network.
You can download Geth client from here.
With Geth client you can:
- mine Ethers (ether is the cryptocurrency fueling the Ethereum network)
- transfer funds between addresses
- create smart contracts and transact with them
- explore block history and much much more
Once you download and open Geth client, it will try to connect to the main Ethereum network where you need real Ethers to perform transactions. At this stage, you should connect to the Private BlockChain instead and the process will be defined in the next article ( Create & Deploy your First Smart Contract on Private BlockChain), So stay tuned. Thanks
Please reach out to me in case of any query email@example.com
Originally published at https://cfarhanhabib.medium.com on July 12, 2021.