0% found this document useful (0 votes)
30 views10 pages

Bitcoin vs Ethereum: Mining & Architecture Comparison

ewfqewf
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)
30 views10 pages

Bitcoin vs Ethereum: Mining & Architecture Comparison

ewfqewf
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

Blockchain

Chapter 4. Public Blockchain


Q1) Compare Bitcoin and Ethereum how to calculate mining difficulty in bitcoin

Feature Bitcoin (BTC) Ethereum (ETH)

Digital currency, store of Smart contracts, decentralized apps


Purpose
value (dApps)

Founder Satoshi Nakamoto Vitalik Buterin & team

Launch Year 2009 2015

Consensus Proof of Work (PoW) Transitioned from PoW to Proof of Stake


Mechanism (currently) (PoS) in 2022 (Ethereum 2.0)

Block Time ~10 minutes ~12–14 seconds

No fixed cap (but new ETH issuance has


Supply Limit 21 million BTC
decreased post-merge)

Programming
C++, Python Solidity (for smart contracts), Go, Rust, etc.
Language

Smart Contract
Limited/None Yes, core feature
Support

Store of value, peer-to-


Main Use Case Smart contracts, DeFi, NFTs
peer payments

Hashing Algorithm SHA-256 Keccak-256 (Ethash before PoS)

Energy Usage High (PoW mining) Lower (after PoS transition)

Transaction Speed Slower Faster

Can be high; based on Gas-based fees; can spike based on


Transaction Fees
block space demand

how to calculate mining difficulty in bitcoin => Chapter 2


Q2) Describe the architecture of Ethereum and workflow in detailed

1. Decentralized Application (dApp):


o It is the topmost layer of Ethereum
o It is front-end applications built using HTML, CSS, JS, etc. and It interact with
Ethereum smart contracts.
2. [Link] Interface:
o It Acts as a bridge between the dApp and the Ethereum blockchain.
o It allows dApps to communicate with smart contracts deployed on the blockchain
using JavaScript.
3. Smart Contract Layer:
o This layer hosts smart contracts written mostly in Solidity.
o The Smart contracts contain the business logic of decentralized applications.
4. EVM (Ethereum Virtual Machine):
o EVM stands for Ethereum Virtual Machine
o It Executes smart contracts securely and deterministically.
o It Ensures all nodes produce the same result for a given input.
5. RPC (Remote Procedure Call):
o RPC stands for Remote Procedure Call
o It Provides an interface to interact with Ethereum nodes.
o It Enables dApps to perform actions like sending transactions or querying
blockchain data.
6. Blockchain Management:
o It Handles storage and maintenance of the blockchain data, including block
creation, validation, and syncing.
7. Consensus Algorithm (PoW):
o The Ethereum originally used Proof of Work (PoW) to achieve consensus and
validate transactions (before transitioning to PoS in Ethereum 2.0).
o The Miners solve cryptographic puzzles to add blocks.
8. Miner:
o This Component responsible for performing mining by executing PoW and adding
new blocks to the chain.
9. Network:
o It Responsible for peer-to-peer communication across nodes.
o It Manages the broadcast of blocks and transactions.
10. P2P (Peer-to-Peer):
o It Allows nodes to discover and connect with each other.
o It Ensures decentralization and redundancy.
11. Crypto (Cryptographic Functions):
o It Provides encryption, digital signatures, and hashing needed for secure
blockchain operations.
12. HttpClient:
o It Supports external HTTP communication and interactions via APIs.
13. LevelDB:
o It is a fast key-value store used for persistent data storage in Ethereum clients like
Geth.
14. Math & Number Library:
o It Handles complex mathematical operations needed during contract execution.
Workflow Of Ethereum
o A user interacts with a decentralized application (dApp) through a web interface.
o The dApp uses [Link] or [Link] to send a transaction request to the Ethereum
network.
o The transaction is sent to a smart contract, which is executed by the Ethereum Virtual
Machine (EVM).
o Validator nodes verify the transaction and add it to a new block using the Proof of Stake
consensus mechanism.
o Once the block is added, the blockchain state is updated, and the result is returned to
the user through the dApp.

Q3) With the suitable diagram, explain the structure of block header with a list of
transactions. (PIC)

Q4) Difference between private blockchain and public blockchain

Feature Public Blockchain Private Blockchain

Restricted to authorized
Access Open to anyone
participants

Permission Permissionless Permissioned

Consensus Anyone can participate in


Only selected nodes participate
Participation consensus

Transparency Fully transparent to the public Visible only to selected participants

Slower, due to more nodes and Faster, fewer nodes and controlled
Speed & Scalability
open access environment

Highly secure due to More vulnerable if central authority


Security
decentralization is compromised

Examples Bitcoin, Ethereum Hyperledger Fabric, R3 Corda

Energy High (especially in PoW-based Lower, due to limited nodes and


Consumption systems) simpler consensus

Transaction Cost Often higher Lower or negligible

Decentralized finance, public Enterprise solutions, internal


Use Case
cryptocurrencies business processes

Governance Community-driven Organization-controlled

Can be modified or deleted by


Immutability Fully immutable
authority

Anonymous or pseudonymous
Identity Known identities of participants
users
Q5) List and explain various types of nodes used in Ethereum
1. Main Point: Full Node
o A full node stores the entire Ethereum blockchain, from the genesis block to the
most recent block.
o It verifies all transactions and blocks independently using consensus rules.
2. Main Point: Light Node (Light Client)
o A light node stores only block headers instead of full blocks or the entire state.
o It verifies transactions using Merkle proofs provided by full nodes.
3. Main Point: Archive Node
o An archive node stores everything that a full node does plus historical state data at
every block.
o It is useful for developers, data analysts, and blockchain explorers who need access
to past states.
4. Main Point: Validator Node (Ethereum 2.0)
o A validator node participates in the Proof of Stake (PoS) consensus mechanism post-
Ethereum Merge.
o It proposes new blocks and attests to blocks created by other validators.
5. Main Point: Bootnode
o A bootnode is a special type of node that helps new nodes discover peers in the
Ethereum network.
o It acts as a discovery server and shares known peers with new nodes.
6. Main Point: Miner Node (Pre-Ethereum 2.0)
o A miner node performed mining tasks under the Proof of Work (PoW) consensus
mechanism before the Ethereum Merge.
o It solved complex cryptographic puzzles to create and add new blocks to the
blockchain.
Q6) List and explain the types of test networks used in Ethereum
1. Sepolia
o Sepolia is the current main Ethereum testnet actively used after 2022.
o It uses Proof of Stake (PoS) as its consensus mechanism, just like the Ethereum
mainnet.
o It is used for testing smart contracts and decentralized applications on a fast and
reliable network.
o It provides fast finality, low network traffic, and supports the latest protocol
upgrades.
2. Goerli (Deprecated/Legacy)
o Goerli was previously used for testing Proof of Stake mechanisms and Ethereum
smart contracts.
o It initially used the Clique Proof of Authority (PoA) consensus and later transitioned
to Proof of Stake.
o It supported multi-client testing including Geth, Prysm, Lighthouse, and others.
3. Rinkeby (Deprecated)
o Rinkeby was used to test Ethereum applications in a stable Proof of Authority (PoA)
environment.
o It operated using the Clique PoA consensus algorithm.
o After Ethereum transitioned to Proof of Stake (The Merge), Rinkeby was deprecated
and is no longer maintained.
4. Ropsten (Deprecated)
o Ropsten was considered the closest testnet to the Ethereum mainnet in terms of
behavior and environment.
o It originally operated on Proof of Work (PoW) and was later updated to Proof of
Stake (PoS) before deprecation.
5. Kovan (Deprecated)
o Kovan was a popular testnet built on the Proof of Authority (PoA) consensus model.
o It was primarily maintained by Parity Technologies for the Parity Ethereum client.
o Kovan is no longer actively maintained and has been deprecated.

Q7) What is transaction structure? Explain transaction life cycle in details.


A) Transaction Structure in Ethereum
1. Nonce
o The nonce is a counter that represents the number of
transactions sent from a specific address.
o It ensures the correct ordering of transactions and
protects against replay attacks.
2. Gas Price
o Gas price is the amount of Ether (in wei) a sender is
willing to pay for each unit of gas.
o Miners prefer transactions with higher gas prices as they yield greater rewards.
3. Gas Limit
o The gas limit is the maximum amount of gas the sender is willing to use for the
transaction.
o It protects the network from infinite loops or heavy computation from faulty
contracts.
4. Recipient
o This field contains the recipient's Ethereum address.
o If the transaction is for deploying a contract, the 'to' field is left empty.
5. Value
o The value represents the amount of Ether (in wei) being sent to the recipient.
o It can be zero for transactions involving only contract interaction.
6. Data
o The data field holds the input data for a function call or the contract bytecode for
deployment.
o It enables smart contract interactions and deployments.
B) Transaction Lifecycle in Ethereum
1. Creation
o A user initiates the transaction by specifying fields like recipient, value, gas, and
data.
o The wallet then digitally signs the transaction using the user's private key.
2. Broadcasting
o The signed transaction is sent out to the Ethereum peer-to-peer (P2P) network.
o All nearby Ethereum nodes receive and store it temporarily.
3. Propagation
o The transaction is spread across the network and enters the mempool of each node.
o The mempool holds all unconfirmed and pending transactions.
4. Validation by Miners (Pre-Execution Check)
o Miners verify if the transaction is valid, correctly signed, and has a correct nonce.
o They also check if the sender has enough Ether to cover the gas and value.
5. Inclusion in Block
o Miners select valid and high-fee transactions from the mempool and pack them into
a new block.
o This process is competitive, with higher gas price transactions getting preference.
6. Execution by EVM
o The EVM executes the transaction by updating account balances or smart contract
state.
o If the transaction fails or runs out of gas, changes are reverted but the gas fee is still
charged.
7. Block Finalization
o Once the block is mined, the transaction is included and considered part of the
blockchain.
o More blocks built on top increase the number of confirmations and security.
8. State Update
o Ethereum’s global state updates with all the changes caused by the transaction.
o This includes balance transfers, storage updates, or smart contract modifications.
9. Receipt Generation
o A receipt is generated that contains details like transaction status, gas used, and
event logs.
o Applications use the receipt to verify execution outcomes.
10. Confirmation
o Users or applications typically wait for 12 or more confirmations to ensure the
transaction is irreversible.
o Each confirmation increases confidence that the transaction won’t be orphaned or
reverted.

Q8) Explain Gas and Ethers in details


OR
Q8) Explain following term wrt Ethereum Miner and mining node, gas account , ether,
transactions.
1. Miner and Mining Node
o A miner (in pre-Ethereum 2.0) was responsible for solving cryptographic puzzles to
add new blocks to the blockchain.
o A mining node was a full node that also performed mining tasks and broadcasted
newly mined blocks to the network.
2. Gas
o Gas is a unit that measures the amount of computational effort required to execute
operations, like smart contracts or transactions.
o Users pay gas fees in Ether to incentivize validators or miners for processing their
transactions.
3. Account
o An account in Ethereum represents either a user (Externally Owned Account) or a
smart contract (Contract Account).
o Each account has an address, balance (in ETH), nonce, and may contain code or
storage (for smart contracts).
4. Ether (ETH)
o Ether is the native cryptocurrency of the Ethereum network, used to pay for gas and
transaction fees.
o It can be sent between accounts and is required to deploy and interact with smart
contracts.
5. Transactions
o A transaction in Ethereum is a signed data message sent from one account to
another, which may include data or Ether.
o Transactions can invoke smart contracts, transfer ETH, or change the state of the
blockchain.
Q9) Explain the concept of an orphaned block
o An orphaned block is also called a stale block
o It is a valid block that was mined but not included in the main blockchain because
another block was added to the chain first.
o This typically happens when two miners solve a block at nearly the same time, but
only one becomes part of the longest (canonical) chain.
o The network selects the block that is part of the longest or heaviest chain, and the
other is discarded.
o The orphaned blocks are valid, they do not contribute to the official blockchain
history.
o The Miners of orphaned blocks generally do not receive the full block reward, though
they may receive some compensation under certain consensus protocols like
Ethereum’s uncle block system.
Q10) EVM short note
o EVM stands for Ethereum Virtual Machine

o The process of EVM starting with Solidity code, which is the programming language used to
write Ethereum smart contracts.
o This code is compiled using the Ethereum compiler (like solc) into low-level EVM bytecode.

o The EVM bytecode is what the Ethereum Virtual Machine can interpret and execute.

o The Ethereum Virtual Machine (EVM) is the core component that runs this bytecode across
all Ethereum nodes.

o Within the EVM, the compiled smart contract is included in blocks, which are then added to
the blockchain.

o The Blocks being used to store and deploy the contract, indicating where the logic is
permanently saved on-chain.

o Each transaction or smart contract execution inside the EVM consumes gas, which must be
paid in Ether.

o The EVM ensures that all nodes execute the same contract code and arrive at the same
result, achieving consensus.

o It provides a sandboxed environment, meaning it isolates contract code from affecting the
external system.

o Finally, the deployed contract is the result of this entire pipeline, now residing on the
Ethereum blockchain and ready to be interacted with.

You might also like