Understanding Public Blockchain Basics
Understanding Public Blockchain Basics
Public Blockchain
Introduction to Public Blockchain
● Public blockchains are decentralized networks that allow anyone to
participate, read, and write data without needing permission from a central
authority.
● They operate on an open-source framework, ensuring transparency and
security through cryptographic principles.
● Transactions on public blockchains are validated by a consensus
mechanism allowing for trustless interactions among users. Public
blockchains promote innovation, transparency, and inclusivity in the digital
economy.
● It was the model that Satoshi Nakamoto suggested back in 2009. Can call it the
mother technology.
● Later, enterprise companies started showing interest in blockchain technology and
tweaked the nature of the decentralized ledger and introduced the private
blockchains.
● In public blockchain architecture, you can download the protocol
anytime, and you will not need any permission from anyone.
● The public blockchains portray the ideal model that makes the
technology industry so profitable.
● Thus, it’s completely decentralized, no single organization controls the
ecosystem. Whereas a private blockchain can be changed and
altered by the owning organization.
● A public blockchain surpassed the necessity of a third party. The
system has a natural flow of its own – just like a flowing river. No one
controls the flow path, yet everyone uses it. So it is a self-governed,
purely decentralized and autonomous digital public ledger.
Key Characteristics
● Almost all the big names in the crypto world are based upon the public blockchain
like – Bitcoin, Ethereum, and Litecoin etc.
● Ethereum is actually the most popular public blockchain at the moment. In reality,
Ethereum took the concept of a public blockchain to a whole new level. At
present, there are so many applications based on this blockchain.
Popular Public Blockchains
Here are some popular blockchains:
1. Bitcoin (BTC): The first and most well-known cryptocurrency, created by an anonymous
person or group known as Satoshi Nakamoto in 2009. It is primarily used for peer-to-peer
transactions and as a digital store of value.
2. Ethereum (ETH): Launched in 2015, Ethereum is a decentralized platform that enables the
creation of smart contracts and decentralized applications (DApps). It supports various
applications, including decentralized finance (DeFi), non-fungible tokens (NFTs), and more.
3. Cardano (ADA): Founded in 2017, Cardano is known for its research-driven approach and a
layered architecture that separates the settlement and computation layers. It supports smart
contracts and aims to provide a more sustainable and scalable blockchain for DApps.
4. Solana (SOL): Known for its high throughput and low transaction fees, Solana was launched
in 2020 and uses a unique Proof of History (PoH) consensus mechanism. It is ideal for
decentralized applications, particularly in the DeFi and NFT spaces, with capabilities for
high-speed transactions.
5. Polkadot (DOT): Launched in 2020, Polkadot enables different blockchains to interoperate
and share information through its unique architecture of parachains. It facilitates the creation
of custom blockchains while enabling them to communicate and work together.
6. Binance Smart Chain (BSC): Developed by Binance, BSC is known for its fast transaction
times and low fees, supporting smart contracts and DApps. It is popular for DeFi applications
and trading platforms, enabling users to execute transactions with greater efficiency.
Use Cases of Public Blockchains
1. Cryptocurrency Transactions: The primary use case of public blockchains like Bitcoin
and Ethereum, allowing peer-to-peer transfers of digital currencies without
intermediaries.
2. Decentralized Finance (DeFi): Public blockchains enable a range of financial services,
such as lending, borrowing, and trading, without traditional banks. Platforms like Aave
and Uniswap operate on Ethereum.
3. Non-Fungible Tokens (NFTs): NFTs represent ownership of unique digital assets (art,
collectibles, etc.) on public blockchains. Ethereum is the leading platform for minting
and trading NFTs.
4. Supply Chain Management: Public blockchains enhance transparency and traceability
in supply chains, allowing stakeholders to verify the origin and journey of products.
Companies like VeChain utilize blockchain for this purpose.
5. Voting Systems: Public blockchains can facilitate secure and transparent voting
processes, reducing fraud and increasing trust in election outcomes. Examples include
projects aimed at digital voting.
6. Identity Verification: Public blockchains can provide decentralized identity solutions,
allowing users to manage and verify their identities without relying on centralized
authorities. Projects like uPort and Civic are examples.
Challenges and Limitations
1. Scalability: As the number of users and transactions increases, public blockchains can
experience slower transaction speeds and higher latency. This can hinder their ability to
handle large volumes of transactions effectively.
2. Energy Consumption: Consensus mechanisms like Proof of Work (PoW) require
significant computational power, leading to high energy consumption. This raises
environmental concerns and sustainability issues.
3. Privacy Concerns: While transparency is a strength, it can also pose privacy risks. All
transactions are visible on the blockchain, which may expose sensitive user information.
4. Regulatory Uncertainty: The decentralized nature of public blockchains often creates
challenges in regulatory compliance. Governments are still developing frameworks to
address issues related to cryptocurrencies and blockchain technologies.
5. Vulnerability to Attacks: Although public blockchains are generally secure, they are
still susceptible to certain attacks, such as Sybil attacks or 51% attacks, where an entity
gains control over a majority of the network's computational power.
Ethereum
● Ethereum is a decentralized software platform built on blockchain technology, known for its
native cryptocurrency, ether (ETH), and is widely used for developing decentralized
finance applications.
● In 2016, Ethereum experienced a significant event known as "The DAO hack," leading to a
split that created Ethereum Classic (ETC) after a portion of the community chose to retain
the original blockchain.
● Ethereum transitioned from a proof-of-work to a proof-of-stake consensus mechanism in
2022, significantly reducing energy usage and processing power compared to traditional
mining.
● The Dencun upgrade in March 2024 introduced proto-danksharding, a key step toward
enhancing the Ethereum blockchain's scalability, promising faster and cheaper
transactions in the future.
● Ethereum's ecosystem supports various use cases, including gaming, the development of
decentralized autonomous organizations (DAOs), and non-fungible tokens (NFTs),
signaling its potential influence on future internet applications.
Ethereum and its components
Ethereum is a Blockchain network that introduced a built-in Turing-complete
programming language that can be used for creating various decentralized
applications(also called Dapps). The Ethereum network is fueled by its own
cryptocurrency called 'ether'.
● The Ethereum network is currently famous for allowing the implementation of
smart contracts. Smart contracts can be thought of as 'cryptographic bank lockers'
which contain certain values.
● These cryptographic lockers can only be unlocked when certain conditions are
met.
● Unlike bitcoin, Ethereum is a network that can be applied to various other sectors.
● Ethereum is often called Blockchain 2.0 since it proved the potential of blockchain
technology beyond the financial sector.
● The consensus mechanism used in Ethereum is Proof of Stakes(PoS), which is
more energy efficient when compared to that used in the Bitcoin network, that is,
Proof of Work(PoW). PoS depends on the amount of stake a node holds.
History of Ethereum
● 2013: Ethereum was first described in Vitalik Buterin's white paper in 2013 with the goal
of developing decentralized applications.
● 2014: In 2014, EVM was specified in a paper by Gavin Wood, and the formal
development of the software also began.
● 2015: In 2015, Ethereum created its genesis block marking the official launch of the
platform.
● 2018: In 2018, Ethereum took second place in Bitcoin in terms of market capitalization.
● 2021: In 2021, a major network upgrade named London included Ethereum
improvement proposal 1559 and introduced a mechanism for reducing transaction fee
volatility.
● 2022: In 2022, Ethereum has shifted from PoW( Proof-of-Work ) to PoS( Proof-of-State
) consensus mechanism, which is also known as Ethereum Merge. It has reduced
Ethereum's energy consumption by ~ 99.95%.
Features of Ethereum
1. Smart contracts: Ethereum allows the creation and deployment of smart contracts.
Smart contracts are created mainly using a programming language called solidity.
Solidity is an Object Oriented Programming language that is comparatively easy to
learn.
2. Ethereum Virtual Machine (EVM): It is designed to operate as a runtime environment
for compiling and deploying Ethereum-based smart contracts.
3. Ether: Ether is the cryptocurrency of the Ethereum network. It is the only acceptable
form of payment for transaction fees on the Ethereum network.
4. Decentralized applications (Daaps): Dapp has its backend code running on a
decentralized peer-to-peer network. It can have a frontend and user interface written in
any language to make calls and query data from its backend. They operate on
Ethereum and perform the same function irrespective of the environment in which they
get executed.
5. Decentralized autonomous organizations (DAOs): It is a decentralized organization
that works in a democratic and decentralized fashion. DAO relies on smart contracts for
decision-making or decentralized voting systems within the organization.
Components of the Ethereum Network
1. Ethereum Nodes
Nodes are individual computers that participate in the Ethereum network, maintaining the
blockchain and validating transactions.
1. Full Nodes: Store a complete copy of the Ethereum blockchain and validate all
transactions and blocks. They ensure the integrity of the network.
2. Light Nodes: Store only a subset of the blockchain data, relying on full nodes for
transaction verification. They are less resource-intensive, making them suitable for
devices with limited storage.
3. Archive Nodes: Store all historical states of the Ethereum blockchain, allowing
users to access past versions of the blockchain for analysis or research.
2. Ethereum Virtual Machine (EVM)
The EVM is the decentralized runtime environment that executes smart contracts on the
Ethereum network. It allows developers to deploy and run their code in a consistent
manner across all nodes. The EVM is crucial for executing complex computations,
facilitating the development of dApps.
3. Smart Contracts
Smart contracts are self-executing agreements with the terms of the contract directly
written into code.
1. Automation: They automatically execute actions when predefined conditions are
met, reducing the need for intermediaries.
2. Transparency: The code and conditions are visible and verifiable on the
blockchain, ensuring trust among participants.
3. Programmable Logic: Developers can create complex logic and workflows using
programming languages like Solidity.
4. Transactions
Transactions are the primary units of data on the Ethereum network, representing
the transfer of value or information.
1. Transaction Structure: Each transaction contains details like sender and
recipient addresses, value (in Ether), gas limit, and nonce (transaction count).
2. Gas and Transaction Fees: Gas is a unit that measures the computational
effort required to execute operations. Users pay gas fees in Ether to
incentivize miners or validators for processing their transactions.
5. Consensus Mechanisms
The consensus mechanism ensures that all nodes in the network agree on the
validity of transactions and the state of the blockchain.
1. Proof of Work (PoW): Originally used by Ethereum, where miners solve
complex mathematical problems to validate transactions.
2. Proof of Stake (PoS): Ethereum is transitioning to PoS with Ethereum 2.0,
where validators are chosen based on the amount of Ether they hold and are
willing to "stake." This mechanism aims to improve scalability and reduce
energy consumption.
Supporting Components of the Ethereum Network
1. Ether (ETH)
DeFi protocols are financial applications built on the Ethereum blockchain that
operate without traditional intermediaries.
1. Lending and Borrowing: Platforms like Aave and Compound allow users
to lend and borrow assets through smart contracts.
2. Decentralized Exchanges (DEXs): Protocols such as Uniswap and
SushiSwap facilitate token trading directly from users’ wallets without a
centralized entity.
3. Yield Farming: Users can earn rewards by providing liquidity to various pools
within these protocols.
4. Oracles
Oracles are third-party services that provide smart contracts with real-world data.
1. Data Integration: They enable smart contracts to access off-chain
information, such as market prices, weather data, and other external events.
2. Examples: Chainlink and Band Protocol are popular oracle services used in
DeFi and other applications.
5. Wallets
Wallets are tools that allow users to manage their Ether and tokens, enabling them to
send, receive, and interact with dApps.
1. Hot Wallets: Online wallets like MetaMask offer easy access to dApps but
are less secure than cold wallets.
2. Cold Wallets: Hardware wallets like Ledger and Trezor store private keys
offline, providing enhanced security for long-term storage.
Type of Ethereum Accounts
Ethereum has two types of accounts: An externally owned account (EOA), and a
Contract account.
● Externally owned account (EOA): Externally owned accounts are controlled
by private keys. Each EOA has a public-private key pair. The users can send
messages by creating and signing transactions.
● Contract Account: Contract accounts are controlled by contract codes.
These codes are stored with the account. Each contract account has an ether
balance associated with it. The contract code of these accounts gets
activated every time a transaction from an EOA or a message from another
contract is received by it. When the contract code activates, it allows to
read/write the message to the local storage, send messages and create
contracts.
Account Structure of the Ethereum
1. Address: A unique identifier for each account on the Ethereum network. It is a
42-character hexadecimal string that starts with 0x, followed by 40
hexadecimal characters (e.g., 0x1234567890abcdef...). It is used to send and
receive Ether (ETH) and interact with smart contracts.
2. Public Key: Public Key is a part of the cryptographic key pair used to derive
the Ethereum address. A longer hexadecimal string derived from the private
key. It is used to verify signatures but is not directly stored in the account. It
helps in identifying the account and verifying transactions.
3. Private Key: A secret key that controls the account and allows the owner to
sign transactions. It is a 64-character hexadecimal string. It must be kept
secure to prevent unauthorized access to the account. It is used to sign
transactions and access the account. It is not stored on the blockchain but
must be securely managed by the account owner.
4. Balance: The amount of Ether (ETH) held by the account. It is represented in
Wei, the smallest unit of ETH (1 ETH = 10^18 Wei). The balance is a
numerical value stored in the account’s state. It determines the amount of
ETH available for transactions or smart contract interactions.
5. Nonce: A counter that tracks the number of transactions sent from the account. It is
a non-negative integer. It ensures that transactions are processed in the correct order
and prevents replay attacks. Each new transaction increments the nonce value.
6. Contract Code (for Contract Accounts): The code that defines the logic and
behavior of a Contract Account. It is stored as a bytecode on the blockchain, executed
when functions are called. It automates functions and processes according to the rules
defined in the smart contract.
7. Storage (for Contract Accounts): A key-value store used to maintain the internal
state of a smart contract. It is organized in a data structure that the contract code can read
from and write to. It is used to store persistent data relevant to the contract's functionality.
8. Code Hash (for Contract Accounts): A hash of the smart contract’s bytecode. It is a
32-byte hash. It is used to identify and verify the smart contract code on the
blockchain.
Transactions and Account Interactions
Transactions from Externally Owned Accounts (EOAs):
1. Sending ETH: Initiate a transaction by specifying the recipient
address and amount of ETH.
2. Process:
1. Create: Define transaction details (recipient, amount, optional data).
2. Sign: Use your private key to authenticate the transaction.
3. Broadcast: Send the signed transaction to the Ethereum network.
4. Confirm: Miners include it in a block, confirming it through the network.
3. Fees: Transactions require gas fees, calculated as Gas Price x Gas
Used. Ensure sufficient ETH for this.
Interacting with Contract Accounts:
1. Calling Functions: Execute smart contract functions by sending
transactions with required parameters.
2. Process:
1. Specify Function: Provide the function and its parameters.
2. Send: Create and sign a transaction that triggers the function.
3. Execute: Contract logic is executed and can change the contract state.
4. Receive: Get a response or transaction receipt.
3. Event Logging: Contracts emit events to log significant actions,
which can be accessed for tracking.
Account Privacy and Security
1. Keep Private Keys Secure: Your private key grants full control over your
account. Store it offline in a secure location, such as a hardware wallet or
a secure physical backup.
2. Avoid Sharing: Never share your private key with anyone. Treat it as
confidential and private.
3. Use Strong Passwords: Protect any software wallets or services with
strong, unique passwords.
4. Hardware Wallets: Use hardware wallets (e.g., Ledger, Trezor) for
enhanced security. They store private keys offline, making them less
vulnerable to online attacks.
5. Software Wallets: If using a software wallet, ensure it's from a reputable
source and keep your software up to date.
6. Verify Addresses: Double-check recipient addresses before sending
transactions to avoid errors and fraud.
7. Review Contracts: Before interacting with or deploying smart contracts,
review the code or ensure it has been audited to avoid vulnerabilities.
Ethereum Account Lifecycle
Here is an overview of an Ethereum Account Lifecycle:
1. Creation
1. Externally Owned Accounts (EOAs): Created through wallet applications,
hardware wallets, or command-line tools. The process involves
generating a public/private key pair and creating an address.
2. Contract Accounts: Created by deploying smart contract code to the
Ethereum network. The contract code is compiled and sent as a
deployment transaction.
2. Active Use
1. EOAs: Used for sending and receiving Ether (ETH), interacting with
smart contracts, and participating in decentralized applications (dApps).
2. Contract Accounts: Executes functions based on the contract’s logic.
Interactions can modify internal states and trigger events.
3. Modification
1. EOAs: Modified by sending transactions that alter their balance or interact with
smart contracts. The nonce is incremented with each transaction to maintain
order.
2. Contract Accounts: Modified through interactions that change the contract’s
state or trigger updates. Contract upgrades may require deploying a new
version.
4. Deactivation
1. EOAs: While accounts don’t get “deactivated,” they may become inactive if not
used. The account remains on the blockchain but may not be interacted with.
2. Contract Accounts: Contracts do not get deactivated but may become obsolete
if replaced by newer versions. The contract code and state remain on the
blockchain unless explicitly removed (e.g., through a self-destruct function).
How Does Ethereum Work?
Ethereum implements an execution environment called Ethereum Virtual Machine (EVM).
● When a transaction triggers a smart contract all the nodes of the network will
execute every instruction.
● All the nodes will run the EVM as part of the block verification, where the nodes
will go through the transactions listed in the block and runs the code as triggered
by the transaction in the EVM.
● All the nodes on the network must perform the same calculations for keeping their
ledgers in sync.
● Every transaction must include:
○ Gas limit.
○ Transaction Fee that the sender is willing to pay for the transaction.
● If the total amount of gas needed to process the transaction is less than or equal
to the gas limit then the transaction will be processed and if the total amount of the
gas needed is more than the gas limit then the transaction will not be processed
the fees are still lost.
● Thus it is safe to send transactions with the gas limit above the estimate to
increase the chances of getting it processed.
Real-World Applications of Ethereum
● Voting: Voting systems are adopting Ethereum. The results of polls are available
publicly, ensuring a transparent fair system thus eliminating voting malpractices.
● Agreements: With Ethereum smart contracts, agreements and contracts can be
maintained and executed without any alteration. Ethereum can be used for creating
smart contracts and for digitally recording transactions based on them.
● Banking systems: Due to the decentralized nature of the Ethereum blockchain it
becomes challenging for hackers to gain unauthorized access to the network. It also
makes payments on the Ethereum network secure, so banks are using Ethereum as a
channel for making payments.
● Shipping: Ethereum provides a tracking framework that helps with the tracking of cargo
and prevents goods from being misplaced.
● Crowdfunding: Applying Ethereum smart contracts to blockchain-based crowdfunding
platforms helps to increase trust and information symmetry. It creates many possibilities
for startups by raising funds to create their own digital cryptocurrency.
● Domain names: Ethereum name service allows crypto users to buy and manage their
own domain names on Ethereum, thus simplifying decentralized transactions without
putting users to remember long, machine-readable addresses.
Benefits of Ethereum
● Availability: As the Ethereum network is decentralized so there is no
downtime. Even if one node goes down other computing nodes are available.
● Privacy: Users don't need to enter their personal credentials while using the
network for exchanges, thus allowing them to remain anonymous.
● Security: Ethereum is designed to be unhackable, as the hackers have to get
control of the majority of the network nodes to exploit the network.
● Less ambiguity: The smart contracts that are used as a basis for trade and
agreement on Ethereum ensure stronger contracts that differ from the normal
traditional contracts which require follow-through and interpretation.
● Rapid deployment: On Ethereum decentralized networks, enterprises can
easily deploy and manage private blockchain networks instead of coding
blockchain implementation from scratch.
● Network size: Ethereum network can work with hundreds of nodes and
millions of users.
● Data coordination: Ethereum decentralized architecture better allocates
information so that the network participants don't have to rely on a central
entity to manage the system and mediate transactions.
Drawback of Ethereum
Proof-of-Stake (PoS)
Proof of Stake (PoS) is the second-most frequently used consensus mechanism in
blockchain technology. Contrary to PoW, no mining is involved, which means the
energy consumption is far below that of PoW.
1. Decentralization: The EVM operates on a distributed network of nodes, ensuring that no single
entity controls the execution of contracts.
2. Turing Completeness: The EVM is Turing complete, meaning it can execute any computation
that can be described algorithmically, given sufficient resources.
3. Smart Contract Execution: When a smart contract is deployed, the EVM handles the contract’s
execution based on the inputs it receives, managing state changes on the blockchain.
4. Gas Mechanism: To prevent abuse of resources, every operation in the EVM requires a certain
amount of "gas," a measure of computational effort. Users pay gas fees to incentivize miners to
process their transactions.
5. Isolation: Each smart contract operates in isolation, which means that the execution of one
contract doesn’t directly affect the execution of another.
6. State Management: The EVM maintains a global state, tracking the current state of all accounts
and contracts on the Ethereum network.
How Does EVM Work
1. MetaMask :
● In the top-left of MetaMask, you can select an Ethereum network.
● Switch from the Main Ethereum Network to Goerli (or other testnet)
and you should see your balances and transaction history update of
that network.
● Now, when you create a transaction using MetaMask, it will be
transacted to network you have selected.
2. MyEtherWallet :
● MyEtherWallet and MyCrypto similarly allow you to select an alternate
network.
● Select your network in top right of screen.
● After this all transactions and contract calls are conducted on network
that you have chosen.
Ethereum testnets
There are a number of dedicated test networks in Ethereum, which are supported
by various clients.
● Goerli (All clients)
● Rinkeby (Geth only)
● Kovan (OpenEthereum only)
● Ropsten (Geth and OpenEthereum)
For development, its recommended you use the Rinkeby or Kovan test
networks. This is because they use a Proof of Authority (PoA) consensus
mechanism, ensuring transactions and blocks are created in a consistent and
timely manner. The Ropsten testnet, although closest to the Mainnet as it uses
Proof of Work (PoW) consensus, has been subject to attacks in the past and
tends to be more problematic for developers.
Types of Ethereum blockchain testnets
● Sepolia (Active)
● Holesky (Active)
● Ropsten (Deprecated)
● Rinkeby (Deprecated)
● Goerli (Deprecated)
Sepolia
Sepolia is the recommended default testnet for application development. The
Sepolia network uses a permissioned validator set controlled by client & testing
teams.
Sepolia is a test network for Ethereum launched in 2021 that operates
independently of the main network (mainnet) but closely simulates its conditions.
Key features:
● Ease of access
● Free to use
● Serves to run realistic tests
It provides decentralized application and developer tooling builders with an
environment for testing their solutions before moving to the Ethereum mainnet.
How Ethereum Sepolia works
The test network mirrors the mainnet’s functionality, including transaction processing,
block production, and smart contract deployment.
1. It lets developers see how their code will behave in a live environment:
estimate gas usage, deployment costs, test how applications interact with other
services, and process different transaction types.
2. The testnet has its own block explorers that allow users to view on-chain data
specific to Sepolia.
3. It used to test protocol upgrades and hard forks (like upcoming Pectra) before
they go live on mainnet so developers can test how these changes affect
dApps and smart contracts.
4. Supported by popular Ethereum development frameworks and tools like Remix,
Hardhat, and Foundry, it makes the transition from testing to development
easy.
5. Developers can interact with Sepolia using testnet Ethereum RPC (Remote
Procedure Call) endpoints, similar to how they would on the mainnet.
Ethereum Layer 2 Sepolia networks
Layer-2 (L2) networks work on top of Ethereum and have their own test
networks linked to Ethereum’s Sepolia testnet.
● Base Sepolia
● Arbitrum Sepolia
● Optimism Sepolia
● Scroll Sepolia
● High Validator Count: The testnet supports over 1.4 million validators,
which is more than the Ethereum Mainnet. This allows for more realistic
testing of staking infrastructure and potential scaling issues.
● Large HolETH Supply: Holesky was launched with an intentionally high
supply of 1.6 billion HolETH to prevent the token scarcity issues that
plagued the Goerli testnet.
● Proof-of-Stake Consensus: It accurately mirrors the PoS consensus
mechanism used on the Ethereum Mainnet, making it a comprehensive
testing environment for infrastructure and protocols.
Ropsten :
● Proof of Work
● Not immune to spam attacks
● Supported by geth and parity
● Chain Id: 3
● Network Id: 3
● Block time: sub-30 seconds
● Faucet: Ropsten testnet is deprecated so, Faucet link is not working.
2. Kovan :
● Proof of Authority
● Immune to spam attacks
● Supported by geth and parity
● Chain Id: 42
● Network Id: 42
● Block time: 4 seconds
● Faucet: Kovan testnet is deprecated so, Faucet link is not working.
3. Rinkeby :
● Proof of Authority
● Immune to spam attacks
● Supported by geth and parity
● Chain Id: 4
● Network Id: 4
● Block time: 15 seconds
● Faucet: Rinkeby testnet is deprecated so, Faucet link is not working.
4. Sokol :
● Proof of Authority
● Immune to spam attacks
● Supported by geth and parity
● Chain Id: 77
● Network Id: 77
● Block time: 5 seconds
● Faucet: The Sokol testnet is currently lacking validators so, Faucet link is not
working.
5. Goerli :
● Proof of Authority
● Immune to spam attacks
● Supported by multiple clients like Geth, Pantheon, Nethermind, and Parity
● Chain Id: 5
● Network Id: 5
● Block time: 15 seconds on average
● Faucet: [Link]
Most of the Ethereum testnets are deprecated. So if you want to deploy your Smart
Contract on Ethereum testnet, always use Goerli Faucet to get some test Ether and
deploy your Dapp's on Goerli testnet.
Metamask
2. Wallet Setup: A new wallet is set up by creating a strong password and securely
backing up a 12-word seed phrase.
3. Connection to dapps: Users can then connect their wallet to decentralized
applications to access their features and services.
4. Transactions: When interacting with dapps, users authorize transactions through
their wallet, which handles the necessary interactions with the Ethereum blockchain.
Transferring Ethers using Metamask
Account details
Step 2: For sending ETH into an address,
click “SEND” button. Put the destination
address and amount of ETH then click
“NEXT”
Sending to an address
For confirming transaction, you need to
adjust Gas Limit and Gas Price.
For knowing Gas Limit and Gas Price
during a Token Sale period, you should
check the announcement & guideline
of specific Token Sale for recommendation.
After you’re certain about making transaction,
you can click to “Submit” button.
There are also “Reset” button for reset
all value to default, and “Reject”
button in case you change your mind.
Checking transaction
You can click to any transaction for verifying the transaction status on
Etherscan
Hardhat
Truffle Suite
One of the most established frameworks, the Truffle Suite offers a comprehensive set of
tools for the entire dApp development lifecycle.
● Key features: Provides a contract compilation system, a migration system for
deployments, and integrates with Mocha and Chai for automated testing. It also
includes Ganache, a personal blockchain for local development.
● Best for: Beginners and teams working on mid-sized dApp projects. Its user-friendly
interface and extensive documentation make it a solid all-in-one solution.
OpenZeppelin
While not a full framework, OpenZeppelin is an essential set of reusable smart contract
libraries for building secure dApps.
● Key features: Offers a library of secure, community-audited smart contracts for
common token standards (ERC-20, ERC-721) and upgradeable contract patterns. The
Defender platform provides automation and security operations for live projects.
● Best for: All Ethereum developers looking to follow security best practices and
streamline development with battle-tested code.
Brownie
A Python-based framework, Brownie is popular among developers who prefer Python over
JavaScript.
● Key features: Integrates with the pytest framework for testing and [Link] for
interacting with the blockchain. Its console allows for easy interaction with deployed
contracts.
● Best for: Python developers building Ethereum applications, particularly in the DeFi
Scaffold-ETH
A development stack built on top of Hardhat that enables rapid prototyping and dApp
creation.
● Key features: Comes with a pre-built frontend powered by React that connects
directly to your smart contracts, allowing for instant UI updates as you write
Solidity code.
● Best for: Hackathons, MVPs, and developers who want to quickly build and test a
full-stack dApp with an integrated user interface.
Case study of Ganache for Ethereum blockchain
1. Logs: Event logs generated by the transaction execution are useful for tracking
contract interactions and other actions.
2. Status: Indicates whether the transaction was successful or failed.
3. Cumulative Gas Used: The total gas consumed by all transactions up to and
including the current block.
4. Bloom Filter: Helps efficiently search for log entries within the block.
Block Generation and Mining
Block Generation in Ethereum involves creating a new block and adding it to the blockchain.
1. Mining: Ethereum uses the Proof-of-Work consensus algorithm where miners compete
to solve a cryptographic puzzle. The first miner to solve the puzzle gets to create the
new block and is rewarded with Ether and transaction fees.
2. Block Creation: Miners gather unconfirmed transactions from the network's mempool
(pool of pending transactions). The miner assembles the block header, which includes
critical information like the parent hash, state root, transactions root, and nonce. The
miner adjusts the nonce in the block header to find a hash that meets the network's
difficulty target. This requires significant computational power and time.
3. Block Validation: Once a miner finds a valid hash, the new block is broadcast to the
network. Other nodes validate the block's solution and ensure it meets all criteria. If the
block is accepted by the majority of nodes, it is added to the blockchain, and the miner
receives the block reward.
4. Block Reward: The block reward includes newly minted Ether and transaction fees
from the transactions included in the block. This incentivizes miners to participate in the
network and secure it.
5. Transition to Proof-of-Stake (PoS): Ethereum is transitioning to Proof-of-Stake (PoS)
with Ethereum 2.0, which replaces mining with staking. Validators are chosen to
propose and validate new blocks based on the amount of Ether they stake, rather than
Block Validation and Consensus
Here is an overview of the block validation and consensus process in Ethereum:
1. Block Validation
1. Syntax and Structure Check: Nodes verify that the block follows the correct
structure and includes valid data.
2. Transaction Verification: Each transaction within the block is checked for
validity, including proper signatures, sufficient gas, and compliance with
Ethereum's rules.
3. State Changes: The block's state root is validated by applying all
transactions in the block and ensuring the resulting state matches the
reported state root in the block header.
4. Receipts and Logs: Nodes validate the transaction receipts and logs to
ensure they correspond correctly to the transactions executed in the block.
2. Consensus Mechanism