0% found this document useful (0 votes)
2 views32 pages

BL Mod3

The document provides a comprehensive overview of ERC20 tokens, detailing their characteristics, creation process, and the lifecycle of smart contracts. It also discusses various types of smart contracts, the role of oracles, and key transaction components on the Ethereum blockchain. Additionally, it differentiates between fungible and non-fungible tokens, highlighting the distinctions between ERC-20 and ERC-721 standards.

Uploaded by

Subuddhi Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views32 pages

BL Mod3

The document provides a comprehensive overview of ERC20 tokens, detailing their characteristics, creation process, and the lifecycle of smart contracts. It also discusses various types of smart contracts, the role of oracles, and key transaction components on the Ethereum blockchain. Additionally, it differentiates between fungible and non-fungible tokens, highlighting the distinctions between ERC-20 and ERC-721 standards.

Uploaded by

Subuddhi Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

1

An ERC20 token is a standardized type of token used on the Ethereum blockchain. The
ERC20 standard defines a common set of rules that all fungible Ethereum tokens must follow,
allowing them to interact seamlessly with wallets, exchanges, and other smart contracts.

Key Characteristics of ERC20 Tokens:

● Fungible: Each token is identical in type and value.

● Transferable: Tokens can be sent from one address to another.

● Interoperable: Can be used across different platforms and dApps that support ERC20.

● Smart Contract-Based: Logic and data are stored on the Ethereum blockchain.

Steps to Create an ERC20 Token


Step 1: Set Up Development Environment

You need:

● Node.js & npm (installed on your system)

● Hardhat or Truffle (Ethereum development frameworks)

● MetaMask (Ethereum wallet)

● Infura or Alchemy (for connecting to Ethereum network)

Install Hardhat (example):

npm install --save-dev hardhat

Step 2: Write the ERC20 Smart Contract

You can use OpenZeppelin's library to simplify the process.

Install OpenZeppelin:
2

npm install @openzeppelin/contracts

Create a file MyToken.sol:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract MyToken is ERC20 {


constructor(uint256 initialSupply) ERC20("MyToken", "MTK") {
_mint(msg.sender, initialSupply);
}
}

Explanation:

● "MyToken" is the token name.

● "MTK" is the symbol.

● initialSupply is the amount minted at deployment (in smallest unit, usually wei).

Step 3: Compile the Smart Contract


npx hardhat compile

Step 4: Deploy the Contract

Write a deploy script, e.g., deploy.js:

const { ethers } = require("hardhat");

async function main() {


const MyToken = await ethers.getContractFactory("MyToken");
const token = await MyToken.deploy(ethers.utils.parseUnits("1000000", 18)); // 1 million
tokens
await token.deployed();
console.log("Token deployed to:", token.address);
}
3

main().catch((error) => {
console.error(error);
process.exitCode = 1;
});

Then deploy to a network:

npx hardhat run scripts/deploy.js --network goerli

(Replace goerli with the testnet or mainnet you're targeting.)

Step 5: Verify and Interact

● Use Etherscan to verify your contract (optional).

● Interact using Remix, Web3.js, Ethers.js, or directly in a dApp.

Summary
Ste Action
p
1 Set up environment (Hardhat, MetaMask)

2 Write ERC20 contract using OpenZeppelin

3 Compile the contract

4 Deploy to Ethereum network

5 Verify & interact with your token

Let me know if you'd like a full working project example or to deploy your own test token!
4

Phases of Smart Contract Life Cycle


There are four phases of the smart contracts life cycle in the blockchain
ecosystem:

1. Create

2. Freeze

3. Execute

4. Finalize

Let's look at each of these phases in detail.

Lifecycle of a Smart Contract


5

1. Create

Contract reiteration and negotiation constitute a significant part of the first


phase. First, the parties must agree on the contract's overall content and
goals. This can be done online or offline. This is similar to traditional contract
negotiations. On the blockchain being used to draw up the smart contract, all
participants must have a wallet. Once the contents of the smart contract
have been finalized, they must be converted into code.

The following tasks are done in this phase:

1. Negotiation of multiple parties.

2. Smart contract's design, implementation, and validation.

2. Freeze

Validation of the transactions on a blockchain is done by a set of computers


across the network called nodes. These nodes are the blockchain miners. A
small fee must be paid to the miners in exchange for this service to keep the
ecosystem from being flooded with smart contracts. The smart contract and
its participants become open to the public on the public ledger during the
'freeze' phase. Digital assets of both involved parties in the smart contracts
are locked via freezing the corresponding digital wallets, and nodes operate
as a governance board that verifies whether the preconditions for smart
contract execution have been satisfied.

The following tasks are done in this phase:

1. Smart Contracts are stored on the blockchain.

2. Freezing of digital assets of involved parties.

3. Execute
6

Participating nodes read contracts that are stored on the distributed ledger.
The integrity of a smart contract is verified by the authenticating nodes, and
the code is executed by the smart contract's interference engine (or by the
compiler). When the inputs for the execution from one party are received in
the form of coins (commitment to goods through coins), the interference
engine creates a transaction triggered by the met criteria.

Now the new transaction data is added to the blockchain and to ensure
fulfillment according to the agreed-upon terms in the Smart contract the
governing nodes now verify it again. 'Consensus mechanism' governs this
verification process.

The following tasks are done in this phase:

1. Evaluation of smart contact condition

2. Auto execute smart contact statement triggered

4. Finalize

After a smart contract has been executed, the new states of all involved
parties are updated. Now the updated state information and resulting
transactions are put in the distributed ledger of the blockchain and the
consensus mechanism verifies that the assets transferred by the first party
have been received and unfreezes the assets for the receiving party.

The following tasks are done in this phase:

1. State updating and digital assets allocated.

2. Unfreezing of digital assets received from the first party.


7

The smart contract has completed the whole life cycle. During freezing,
execution, and finalization the sequence of transactions has been executed and
stored in the blockchain.

Types of smart contracts on blockchain


Smart contracts are incredibly versatile, and they come in various forms to cater to a
wide range of smart contracts use cases and industries. Here, we'll delve into the most
common types of smart contracts and their unique characteristics.

Smart legal contracts


Smart legal contracts are a blockchain-based evolution of traditional legal agreements.
They encode legal terms and conditions into self-executing code, allowing for automatic
enforcement and verification of legal agreements.

This type of smart contract is especially relevant in legal and real estate industries,
where trust and compliance are paramount. For example, a real estate transaction can
be facilitated using a smart legal contract, ensuring that the property title is
automatically transferred once payment is received.

Decentralized autonomous organizations (DAO)


Decentralized Autonomous Organizations, commonly referred to as DAOs, are a unique
type of smart contract that goes beyond traditional contracts. DAOs are essentially
automated organizations run by code and governed by token holders. They allow for
collective decision-making and fund management without a central authority.

An example of a DAO is a community-driven investment fund where participants vote on


investment decisions, and the smart contract autonomously executes those decisions.

Application logic contracts (ALC)


Application Logic Contracts are smart contracts designed to execute specific functions
or processes within decentralized applications (DApps). These contracts manage the
core logic and operations of DApps, ensuring they run smoothly and autonomously.
8

For example, in a decentralized gambling application, an ALC can manage bets,


payouts, and random number generation, all without human intervention.

Supply chain contracts


Supply Chain Contracts are utilized to track and verify the movement of goods across a
supply chain. They automate product tracking, quality control, and payment processes
as goods move from the manufacturer to the consumer.

Companies can use supply chain contracts to ensure the authenticity of products,
prevent counterfeiting, and streamline logistics.

Tokenization contracts
Tokenization contracts are integral to the creation and management of digital assets,
such as cryptocurrencies, security tokens, and non-fungible tokens (NFTs). These
contracts define the rules and properties of tokens, enabling their creation, transfer, and
management within the blockchain ecosystem.

For instance, NFT creators use tokenization contracts to define the unique properties
and ownership rules of digital collectibles.

These are just a few smart contract examples and the various types that have emerged
in the blockchain space. The flexibility and adaptability of smart contracts make them an
invaluable tool in multiple industries, revolutionizing the way agreements and processes
are handled.

What Is an Oracle Network?

Oracles provide a way for the decentralized Web3 ecosystem to access existing data
sources, legacy systems, and advanced computations. Decentralized oracle networks
(DONs) enable the creation of hybrid smart contracts, where onchain code and offchain
infrastructure are combined to support advanced decentralized applications (dApps) that
react to real-world events and interoperate with traditional systems.

MO

Types of Oracles

Input Oracles
9

The most widely recognized type of oracle today is known as an “input oracle,” which
fetches data from the real-world (offchain) and delivers it onto a blockchain network for
smart contract consumption. These types of oracles are used to power Chainlink Price
Feeds, providing DeFi smart contracts with onchain access to financial market data.

Output Oracles

The opposite of input oracles are “output oracles,” which allow smart contracts to send
commands to offchain systems that trigger them to execute certain actions. This can include
informing a banking network to make a payment, telling a storage provider to store the
supplied data, or pinging an IoT system to unlock a car door once the onchain rental
payment is made.

Cross-Chain Oracles

Another type of oracle are cross-chain oracles that can read and write information between
different blockchains. Cross-chain oracles enable interoperability for moving both data and
assets between blockchains, such as using data on one blockchain to trigger an action on
another or bridging assets cross-chain so they can be used outside the native blockchain
they were issued on.

Compute-Enabled Oracles

A new type of oracle becoming more widely used by smart contract applications are
“compute-enabled oracles,” which use secure offchain computation to provide decentralized
services that are impractical to do onchain due to technical, legal, or financial constraints.
This can include using Chainlink Automation to trigger the running of smart contracts when
predefined events take place, computing zero-knowledge proofs to generate data privacy,
or running a verifiable randomness function to provide a tamper-proof and provably fair
source of randomness to smart contracts.
10

Q Describe terms: Structure of Transaction,


Transaction Nonce, Transaction GAS, Recipient,
Values and data.

1. Transaction Structure Overview


An Ethereum transaction is a signed message sent from one account to another. It includes all
the information needed to execute something on the Ethereum blockchain—whether it's sending
ETH or calling a smart contract.

A raw transaction includes these main components:

1. Nonce

2. Gas Price

3. Gas Limit

4. To (Recipient)

5. Value

6. Data

7. Chain ID (for network identification)

8. Signature (v, r, s — cryptographic components)

Let’s now go into detail for the main terms you asked about:

1. Transaction Nonce

✅ What is it?
11

● A nonce is an integer (starting from 0) that increases with every transaction sent from an
Ethereum address.

● It ensures each transaction is unique and executed only once, in correct order.

💡 Why it matters:

● Prevents double-spending (sending the same ETH twice).

● Prevents replay attacks on the same network.

🧠 Example:

If your wallet has already sent 5 transactions, the next transaction's nonce must be 5.

2. Gas & Gas Price

⛽ Gas

● A unit representing the computational effort needed to process a transaction.

● Every operation (e.g., add, store, transfer) on the Ethereum Virtual Machine (EVM)
costs a certain amount of gas.

● Think of it like fuel for running code on Ethereum.

💰 Gas Price

● The fee per unit of gas, measured in gwei (1 gwei = 10⁻⁹ ETH).

● A higher gas price means faster transaction processing (miners prefer higher fees).

📉 Max Gas (Gas Limit)

● The maximum amount of gas the sender is willing to consume.


12

● Protects users from bugs or unexpected behavior (like infinite loops in contracts).

Example:

If a transaction uses 21,000 gas and the gas price is 50 gwei:

Transaction Fee = 21,000 * 50 gwei = 1,050,000 gwei = 0.00105 ETH

3. Recipient (To Address)

✅ What is it?

● The Ethereum address the transaction is sent to.

● It can be:

○ An externally owned account (EOA) → a user wallet.

○ A smart contract → executing some logic.

🧠 Example:
0x742d35Cc6634C0532925a3b844Bc454e4438f44e

4. Value

✅ What is it?

● The amount of ETH (in wei) to send with the transaction.

● 1 ETH = 1,000,000,000,000,000,000 wei (10¹⁸ wei).

Use cases:
13

● Sending ETH between users.

● Sending ETH to a smart contract (e.g., paying for an NFT).

🧠 Example:
value = 1000000000000000000 wei = 1 ETH

5. Data

✅ What is it?

● An optional field used to include data with the transaction.

● Most often used to call functions on smart contracts or deploy new contracts.

Format:

● Encoded in hexadecimal.

● Follows the Ethereum ABI (Application Binary Interface) format.

Example use cases:

● Interacting with a token contract:

transfer(address recipient, uint256 amount)

This function call is converted into a data payload like:

0xa9059cbb000000000000000000000000RecipientAddress...000000000000000000000000000
000000Amount

In Summary
14

Field Description

Nonce Counter of transactions from a sender. Ensures order and uniqueness.

Gas Limit Max computation allowed for the transaction. Prevents excessive
usage.
Gas Price Fee per gas unit. Higher price = faster confirmation.

Recipient Target address for the transaction. Could be a user or smart contract.

Value Amount of ETH (in wei) to send. Can be 0 for contract calls.

Data Optional code/data to send to smart contracts. Required for


interactions.

If you want, I can show you an actual decoded Ethereum transaction from Etherscan, or help
you build one manually.

Differentiate between Fungible and Non-fungible


tokens.

Feature Fungible tokens Non-fungible tokens

Value Each token is of equal Each token has a unique


value and value based on its
interchangeable with characteristics, scarcity, and
another token of the same demand
type

Divisibility Divisible into smaller Can be divided into smaller


units, e.g., 0.0001 BTC units, and ownership can be
fractionalized
15

Creation Created primarily through Created through smart


mining contracts

Storage On-chain Usually, only the metadata is


stored on-chain, while the
digital file is off-chain on a
distributed storage network
or centralized database

Governance May have governance Governance is typically


mechanisms that allow decided by the token creator
token holders to vote on and cannot be changed
network upgrades or
changes

Rarity Not rare or unique Rare and unique asset

Utility Generic utility as a Specific utility as digital


medium of exchange or assets, representing unique
store of value or rare items

ERC-20 Token vs ERC-721 Token


Below are some of the differences between the ERC-20 token and the ERC-
721 token.
16

Aspects ERC-20 ERC-721

A standard for
A standard for non-fungible
Definition fungible tokens on
tokens (NFTs) on Ethereum.
Ethereum.

First and foremost,


These tokens are non-
these tokens are
fungible in nature. Each NFT
Fungibility fungible in nature.
has a uint256 variable
There's nothing like a
known as tokenId.
tokenId.

They're easier for There is no scope for


Substitution
substitution. substitution.
17

NFTs, in-game assets like


money or in-game avatars,
and even tickets. One of the
most popular examples of
these tokens is
Tether (USDT), Dai
CryptoKitties. The purpose
(DAI), Bitcoin,
Examples of the game is for users to
Dogecoin, Wrapped
breed, buy and sell virtual
Bitcoin (WBTC)
cats. In this game, the user
fully owns an asset; a virtual
cat that is unique and
cannot be shared with
anyone else.

They're divisible;
ERC20 tokens can be
divided in a number of
Divisibility They're not divisible at all.
ways. Even sharing
0.1 % of the token is
possible.
18

1. The value

doesn't
1. The value
fluctuate,
fluctuates
since they're
according to rarity
not unique.
and uniqueness.
Fluctuation 2. Requires
2. Requires unique
one
smart contracts for
common
each token.
smart

contract.

No special ownership Special ownership functions


Ownership functions can be can be enabled by these
allocated. tokens.

These tokens are These tokens have limited


Adoption
commonly adopted. levels of acceptance.
19

These tokens are not These tokens can be


collectible, they're collected like fiat currencies,
Collectability interchangeable and they're not interchangeable
represent a single and represent a collection of
entity assets

There is no KYC The KYC verification is in-


Token identity
verification required. built.

In ERC20 standards,
The values of each token are
Values there's no difference
different.
in values.

ERC20 token faces


the challenge of them
ERC721’s token standards'
being lost when are
main challenge is that
Challenges being transferred to
transferring numerous
faced other wallets or smart
assets can become very
contracts that don’t
expensive.
support ERC20
tokens.
20

What are the essential tools and frameworks for


setting up a development environment for Solidity
programming? Discuss the role of tools like
Remix and Truffle.

3.4 Key Tools Explained

🌐 What is IPFS in Ethereum?

IPFS stands for InterPlanetary File System. It is a peer-to-peer distributed file storage
system that allows files to be stored and shared across a decentralized network. In the context
of Ethereum, IPFS is used to store large files off-chain, while only the file’s hash (or link)
is stored on-chain.

Why Use IPFS with Ethereum?


Storing large files directly on the Ethereum blockchain is expensive and inefficient,
because:

● Ethereum has limited storage per block.

● Storing data on-chain costs gas, which scales with file size.

So instead of storing files like images, documents, or metadata on Ethereum, developers use
IPFS to store the file off-chain and store a reference (hash) to the file on Ethereum.
21

How IPFS Works with Ethereum (Step-by-Step)


1. File Upload

● You upload a file (e.g., an image, JSON metadata) to IPFS.

● IPFS generates a unique hash (CID) for the file based on its content.

2. Store the Hash on Ethereum

● This hash (a content identifier) is stored in a smart contract on Ethereum.

● Smart contracts or dApps can use this hash to fetch the file from IPFS later.

3. File Retrieval

● Anyone can access the file using the IPFS hash via an IPFS gateway (e.g.,
https://ipfs.io/ipfs/<CID>).

Example Use Case: NFTs

What is Swarm in Ethereum?


Swarm is a distributed storage platform built specifically for Ethereum. It’s similar in purpose
to IPFS but is more tightly integrated with the Ethereum ecosystem.

🎯 Purpose:

To store and distribute data and dApp code in a decentralized way, eliminating reliance on
centralized servers.

🧱 How Swarm Works

1. Upload: A file is split into smaller chunks.


22

2. Distribution: These chunks are distributed across the network.

3. Content Addressing: Each chunk is given a unique hash, just like in IPFS.

4. Retrieval: The user can retrieve the file by its hash; Swarm finds and reassembles all
the pieces.

5. Incentives: Nodes are rewarded for storing and serving data using the BZZ token
(Swarm's native token).

1. Remix IDE

● Type: Web-based IDE

● Best For: Beginners and quick testing

● Features:

○ No setup needed (runs in browser)

○ Built-in compiler, deployer, debugger

○ Integrates with MetaMask

○ Plugin ecosystem (Solidity static analysis, unit testing)

Use Case: Try out contracts quickly, learn Solidity, debug small scripts.

2. Truffle Framework

● Type: Full-featured development framework

● Language: JavaScript/TypeScript

● Features:

○ Project scaffolding and structure


23

○ Contract compilation, migration (deployment), and testing

○ Built-in integration with Ganache for local blockchain

○ Network configuration for deploying to testnets/mainnet

○ Supports automated testing using Mocha/Chai

Use Case: Building production-level dApps; testing and deploying in controlled environments.

3. Hardhat

● Alternative to Truffle, more developer-focused

● Features include:

○ Script-based deployment (using Ethers.js)

○ Built-in local network (Hardhat Network)

○ Stack traces for Solidity errors

○ Supports plugins for gas reporting, contract sizing, Etherscan verification

Use Case: Preferred by modern dApp developers for flexibility and plugin ecosystem.

4. Ganache

● A personal Ethereum blockchain for development (used with Truffle or standalone)

● Provides:

○ Fake accounts with ETH

○ Easy debugging

○ Transaction history and logs


24

● Comes as both a GUI and CLI tool

5. MetaMask

● Browser extension wallet to:

○ Interact with dApps

○ Sign transactions

○ Switch between networks (mainnet, testnet, localnet)

● Connects directly with Remix, Truffle dApps, or frontend interfaces.

🛠 Sample Workflow Using Tools


1. Write smart contracts in VS Code or Remix.

2. Compile using solc or built-in compilers (Truffle/Remix).

3. Test using Mocha/Chai or Truffle test.

4. Deploy to local network using Ganache or Hardhat Network.

5. Deploy to testnet using Infura and MetaMask for wallet signing.

6. Debug using Hardhat traces, Remix, or Truffle console.

Summary Table
Tool Purpose Best For

Remix Online IDE for Solidity Beginners, quick prototyping


25

Truffle Full-stack dev environment Large-scale dApp projects

Hardhat Advanced dev with plugin ecosystem Pro developers, modern


stacks
Ganache Local blockchain simulation Safe testing of contracts

MetaMask Wallet for sending and signing txs Connecting to dApps/testnets

Infura Node provider for Ethereum access Remote deployment

Let me know if you want help setting up a real Solidity project with any of these tools!

How ERC20 Tokens Help in Blockchain


Applications
1. Standardization and Interoperability

● ERC20 is a widely adopted token standard.

● Wallets, exchanges, and dApps automatically support any ERC20 token.

● Developers don’t need to write custom code to handle each new token.

Example: MetaMask and Uniswap support thousands of ERC20 tokens out of the box.

2. Tokenization of Real-World and Digital Assets

● ERC20 tokens allow you to represent anything of value, such as:

○ Fiat currencies (e.g., USDT, USDC)

○ In-game currency
26

○ Loyalty points

○ Stocks and commodities (synthetics)

Benefit: Makes assets programmable, divisible, and transferable on-chain.

3. Facilitates DeFi (Decentralized Finance)

● Most DeFi protocols (like Uniswap, Aave, Compound) rely on ERC20 tokens for:

○ Lending/borrowing

○ Trading/swapping

○ Yield farming

○ Staking

Benefit: Provides liquidity and composability across the Ethereum ecosystem.

4. Enables ICOs and Fundraising

● ERC20 tokens are widely used for Initial Coin Offerings (ICOs) and Token Generation
Events (TGEs).

● Startups can raise funds easily by distributing ERC20 tokens to investors.

Benefit: Simplifies fundraising, lowers barriers to entry.

5. Programmability and Smart Contract Integration

● You can write smart contracts that interact with ERC20 tokens to:

○ Trigger rewards
27

○ Automate payments

○ Create escrow systems

○ Build voting mechanisms

Benefit: Highly customizable logic based on token transfers and balances.

6. Cross-Platform Utility

● ERC20 tokens can be bridged to other blockchains, increasing their utility beyond
Ethereum.

● Common in multichain apps and Layer 2 solutions.

Summary Table
Use Case How ERC20 Helps

Interoperability Works seamlessly across wallets, exchanges, dApps

Asset Tokenization Converts real-world value into blockchain-based tokens

DeFi Core element for lending, trading, yield farming

Fundraising (ICOs) Enables easy and transparent token distribution to


investors
Programmability Easily integrated into smart contract logic

Cross-chain Compatibility Supports bridges and Layer 2 scaling

Syllabus
28

The concept of a permissionless blockchain is central to how public blockchain networks like
Bitcoin and Ethereum operate. Let’s break it down clearly:

What is a Permissionless Blockchain?


A permissionless blockchain (also called a public blockchain) is a decentralized network
where anyone can join, read, write, or participate in the consensus process without needing
approval from any central authority.

✅ Key Characteristics of Permissionless Blockchains


Feature Description

Open Participation Anyone can join the network as a user, miner, validator, or developer.

Decentralized No single entity controls the network.

Transparent All transactions are visible to everyone on the network (public ledger).

Immutable Once recorded, data cannot be easily changed or deleted.

Trustless Operates without needing to trust a central authority—relies on code


and consensus mechanisms.

Censorship- No one can prevent or block valid transactions from being processed.
Resistant

🧠 Examples of Permissionless Blockchains

● Bitcoin: Anyone can run a node, mine BTC, or send/receive bitcoin.

● Ethereum: Anyone can deploy smart contracts, create tokens, or validate blocks (on
Proof of Stake).

● Solana, Avalanche, Polkadot: Other popular permissionless chains.


29

How It Works
1. Consensus Mechanisms

● Nodes in the network reach agreement (consensus) without central coordination using
algorithms like:

○ Proof of Work (PoW) – Bitcoin

○ Proof of Stake (PoS) – Ethereum 2.0

2. Incentives

● Participants are rewarded (e.g., in ETH or BTC) for validating transactions or


contributing resources, ensuring security and participation.

Permissionless vs Permissioned Blockchain


Feature Permissionless Blockchain Permissioned Blockchain

Access Open to everyone Restricted to approved participants

Transparenc Fully transparent May have restricted visibility


y
Consensus Decentralized (PoW, PoS) Often centralized or semi-centralized

Examples Bitcoin, Ethereum Hyperledger Fabric, Quorum

Use Case Cryptocurrencies, public Enterprise systems, supply chain, private


dApps records

Why Permissionless Blockchains Matter


● Empower users globally to access finance, data, and digital tools without relying on
banks or governments.

● Enable open innovation—anyone can build apps or tokens without permission.


30

● Promote transparency and accountability through a public, verifiable ledger.

Let me know if you’d like to see real-world applications that rely on permissionless blockchain
networks!

Digital Signature with ECC


https://youtu.be/0NGPhAPKYv4?si=twjpZdSKxYy84z6O

Mining in Ehtereum

⛏️ How Mining Worked in Ethereum (Before the Merge)

Before Ethereum transitioned to Proof of Stake (PoS) in September 2022 through "The
Merge", Ethereum used a Proof of Work (PoW) consensus mechanism, similar to Bitcoin.
Here's a detailed explanation of how mining worked on Ethereum when PoW was in use:

1. What is Ethereum Mining?


Mining in Ethereum (under PoW) was the process of:

● Validating transactions

● Packaging them into blocks

● Solving complex cryptographic puzzles to add blocks to the Ethereum blockchain

Miners competed to solve a computational problem. The first one to solve it would:

● Add the next block to the blockchain

● Receive a block reward in ETH plus transaction fees


31

2. Key Components of Ethereum Mining


Component Description

Algorithm Ethereum used Ethash, a memory-hard PoW algorithm designed to be


ASIC-resistant (favoring GPU mining).

Mining Mostly GPUs (Graphics Processing Units).


Hardware

Block Time Around 13–15 seconds per block.

Block Reward Miners earned 2 ETH per block (as of before The Merge), plus
transaction fees.

Difficulty Adjusted dynamically to ensure steady block times.

3. Mining Process Step-by-Step


1. Transaction Pool (Mempool)

Miners picked pending transactions from the network and organized them into a potential block.

2. Hash Puzzle

● The miner tried to find a nonce that, when combined with block data and hashed
through Ethash, produced a hash below a target difficulty value.

● This required trial and error, consuming GPU power.

3. Block Submission

● Once a valid nonce was found, the miner broadcasted the block to the network.

● Other nodes verified the block’s correctness and added it to their chain.

4. Reward

● The successful miner received:


32

○ 2 ETH (block reward)

○ All transaction fees (gas fees) from the included transactions

○ Uncle rewards (partial rewards for stale blocks)

End of Ethereum Mining: The Merge


As of September 15, 2022, Ethereum switched to Proof of Stake (PoS), eliminating mining
altogether.

Why?

● Energy efficiency: PoS uses ~99.95% less energy.

● Scalability: Prepares Ethereum for sharding and future upgrades.

● Security and decentralization: Encourages broader participation without specialized


hardware.

You might also like