SlideShare a Scribd company logo
1 of 24
Download to read offline
Module 4:
public blockchain
Prepared By: Prof. Swapnil S. Sonawane
Ethereum components
Miner and Mining node:
A miner is responsible for writing a transaction to the Ethereum series.
Miners get two kinds of rewards: benefit for writing a block into the series and
accumulative gas prices
There are two types of nodes (computers) in the Ethereum network: Mining nodes and
Ethereum virtual machines.
Mining nodes refer to the nodes that belong to miners and EVM has a unique code attached
to it, which is called as smart contract. Mining nodes are part of the same network where
EVM is hosted.
Each mining node maintains its version of Ethereum ledger, and the ledgers could be
identical. It is the job of the miners to ensure that their ledger is always upgraded with the
latest blocks.
Ethereum Virtual Machine (EVM):
A blockchain system is made of numerous nodes belonging to both miners and also a
few who do not want to mine but function as aids for the implementation of smart
contracts. These nodes are called Ethereum Virtual Machines (EVM).
EVMs are mostly in charge of supplying a run time that could perform code compiled
from smart contracts.
It does not need access to the ledger; however, it contains only limited information
regarding the current transaction.
Ether:
Ether is a type of cryptocurrency used in Ethereum. To set up a smart contract using the
Ethereum platform, the contract author needs to pay in the form of ether. That is done so
people might write optimized codes that do not waste the Ethereum network's
computing ability on unnecessary tasks.
Gas:
Gas is the internal currency of Ethereum. The execution and resource utilization costs
are predetermined in Ethereum in terms of Gas units. This is also known as Gas Cost.
Transactions in Ethereum:
Ethereum stores transactions within Blocks. A transaction (Contract) is simply a set of
agreements between parties; there would be an exchange of assets, products, or services
in place of currency, cryptocurrency, or some other asset either in the present or in the
future.
Ethereum Accounts:
Ethereum supports two kinds of accounts. Every account comes with a balance that
yields the present value saved in it. Once somebody creates an externally owned account
on Ethereum, a public-private key is produced.
An externally owned account may keep Ether in its balance and not have any code
related to it.
Normal contract accounts are similar to externally owned accounts. They are identified
by the public address and do not hold any private keys. They can carry ether very similar
to externally owned accounts. However, they have a programming code for smart
contracts comprising of state variables and functions.
Swarm and Whisper:
Swarm is a peer to-peer document sharing platform, similar to Bit Torrent, incentivized
with micro payments of ETH File records are divided into small chunks, dispersed, and
stored with volunteers. The nodes which save and also function (calculate, store, and
communicate) on those pieces are all paid with ETH from people using the information.
Whisper is an encrypted messaging protocol that enables nodes to send out messages
directly to each other, in a secure way that additionally hides the sender and recipient
identity from third-party snoopers.
Ethash
Ethereum mining used an algorithm known as Ethash. The fundamental idea of the
algorithm is that a miner tries to find a nonce input using brute force computation so that
the resulting hash is smaller than a threshold determined by the calculated difficulty. A
miner who discovers a block that can be inserted to the blockchain receives a block
reward comprising of three ethers. This gas price is credited to the miner's accounts
included as proof-of-work mining procedure an additional reward for adding
transactions as a portion of this block.
Mining In Ethereum
The mining principle of Ethereum is different from that of bitcoin. Ethereum miners
always look forward to mine new blocks and listen actively to receive new blocks
from other miners. The endeavor of miners will always be to build on the block
header and perform the subsequent task.
Parent Hash:
The miner need to identify hash of previous block. The hash of previous block or parent
block will be added to current block header
LogsBloom:
It is the data structure that consist of log information
Ethereum Accounts:
Ethereum supports two kinds of accounts. Every account comes with a balance that
yields the present value saved in it. Once somebody creates an externally owned account
on Ethereum, a public-private key is produced.
Transaction, state, and receipt hash:
The miner hashes all transactions that are inside the block; the hashes are further
combined in pairs to create a brand new hash.
The hash is also known as Root transaction hash or Merkle Root transaction hash. The
miner, in the same manner, computes the State transaction hashes and Receipt
transaction hashes and adds to the block header.
Nonce:
A nonce is a random number that can be used just once in the cryptographic
communication.
Timestamp (Current UNIX time):
The timestamp is another field, which indicates the UNIX time. It is the seconds passed
after the first of January 1970 and is a 10-digit number.
Ommer block:
Ommer blocks are created in the Ethereum blockchain when two blocks are created and
submitted to the ledger at roughly the same time. Only one can enter the ledger.
MixHash:
MixHash can be a hash which, when together with all nonce, demonstrates that a block
has enough computation. Miners generate a mixhash until the outcome is the desired
target hash.
Difficulty:
It decides the complexity of the puzzle/challenge awarded to miners of a particular
block. The gas limit of the block decides the most gas allowed for the block.
Number:
The number is the sequential number of a block on the chain.
Architecture of Ethereum
In a decentralized application, we need consensus and the blockchain was that
missing ingredient to reach consensus in a decentralized way. So, for consensus
(Layer 0) , we need some way to agree upon all of these application level constructs
Layer 5: Dapps
Layer 4: Browsers
Layer 3: Inter operability
Layer 2: Blockchain services
Layer 1: Economic layer
Layer 0: Consensus layer
We want an economic token (Layer 1) to incentivize each one of the nodes, either to do the
computation, or perform the storage operation .This is where the tokens get involved.
Layer 2, we desire a brand-new form of decentralized storage, which is peer-to-peer reviewed,
along with IPFs (interplanetary file system). In addition, we also have smart contracts.
On top of that, we have interoperability (Layer 3). In this decentralized world, where we have all
of these different apps, each with their tokens, how is one supposed to exchange value between
these tokens?
The answer is to write a universal wrapper around all cryptocurrencies. This exchange protocol
(of Layer 3) would transfer the amount or transmit value between all of these different tokens as
one uses the various services.
Next, we have the browser (Layer 4) to access the decentralized applications. Some browsers are
made for decentralized applications, like Mist, Omni wallet, and Maelstrom. After this layer, we
build DApps (Layer 5), where we start adding application-level constructs.
Workflow of Ethereum
Solidity is the native coding language of Ethereum. It creates a .sol file as an
outcome. Solidity Compiler (SOLC) is used to compile the solidity file (sol).
Bytecode invokes Web3js for deployment. Once it is deployed, it returns the
Contract and the Application Binary Interface (ABI).
When this contract is initiated, it can invoke contract methods and signs, and pass
them to Ether to perform the Operation.
Workflow for Deploying Smart Contracts:
• The first step is to download the Ethereum node.
• Then, write the solidity code. Compile it using a framework like a truffle.
• Deploy the smart contract code to the network.
• Call the deployed contract using Web3js, which is the front-end client that speaks to
the Ethereum blockchain.
Comparison between
bitcoin and Ethereum
Bitcoin Ethereum
Founder Satoshi Nakamoto Vitalik Buterin and Team
Purpose Cryptocurrency Network Software
Release Date January 2009 July 2015
Scripting language Turing Incomplete Turing Complete
Coin release method Early mining Through ICO
Average block time Approx. 10 mins Approx. 15 seconds
Transaction Model UTXO Account
Bitcoin Ethereum
Coin symbol BTC ETH
Tokens Not available Available
Monetary policy Hardcoded Not hardcoded
Emission rate Halving policy followed Occasional
Backward compatibility Available Not available
Block limitation 1 MB per block NO limit
Types of test networks
There are three test nets currently in use, and each behaves similarly to the
production blockchain (where your real Ether and tokens reside).
1. Ropsten: A proof-of-work blockchain that most closely resembles Ethereum;
you can easily mine faux-Ether.
2. Kovan: A proof-of-authority blockchain, started by the Parity team. Ether can’t
be mined; it has to be requested.
3. Rinkeby: A proof-of-authority blockchain, started by the Geth team. Ether can’t
be mined; it has to be requested.
Transferring ethers using
metamask
Step 1: Sign Into Your Coinbase Account
To initiate the transfer of ETH, you will need to start by signing into your Coinbase
account to access or buy some ETH.
Step 2: Buy Ethereum (ETH)
Select buy, enter the amount of money you want to convert to ETH, double-check
that you are buying Ethereum, then choose your payment method and finally click
on “Buy Now”
Step 3: Click Send
Once you have some ETH in your Coinbase account, navigate to the top of your
account and click the Send/Receive button. Then, choose the amount of ETH you
want to send to your MetaMask wallet,
Step 4: Copy/Paste Your MetaMask Address to Coinbase
Before sending your ETH, you need to sign into your MetaMask wallet to copy your
wallet address. Next, paste your Metamask wallet address into the “To” section in
your Coinbase account.
Step 5: Click Continue/Send Now
After pasting your MetaMask wallet into Coinbase, click Continue to review your
transfer. Once you have confirmed the transfer looks good, tap “Send Now”
Step 6: Check Your MetaMask Wallet
To confirm that you have received your ETH, log into your MetaMask wallet where
you should see a front preview of your new balance.
Ethereum Frameworks
1. Truffle
Truffle is another framework for building decentralized applications on the
Ethereum blockchain. It is the most popular and one of the pioneer frameworks. It
offers the aid of compilation, deployment, and testing.
Truffle offers a development network to run and test DApps without needing to
deploy to the mainnet and serves as a local development blockchain for testing.
2. Embark
Embark is another framework for the EVM blockchain that is regarded as a full-
stack framework. This means the framework offers the solution of building an entire
decentralized application’s frontend and backend simultaneously.
Embark watches for changes in your Solidity smart contracts and frontend (HTML and
JavaScript) code, and redeploys them to the blockchain network.
3. Hardhat
Hardhat is a framework for building smart contracts that offers a development
environment for professionals. This development environment lets users compile, run
tests, check smart contracts for mistakes or debugging, and deploy decentralized
applications.
4. OpenZeppelin
OpenZepplin is a toolkit with plugins that help build smart contracts faster. To use any
of the smart contracts in OpenZeppelin, you must import them into your own smart
contract. OpenZeppelin is actually distributed as an npm package, meaning you must
install Node.js first.
Etherscan.io
Etherscan permits an individual to view the assets held on any public Ethereum
wallet address. On Etherscan by entering any Ethereum address into the search box,
one can see the current balance and transaction history of the wallet under
consideration.
Etherscan displays any gas fees and smart contracts involving that address.
Etherscan can be used to:
1. Calculate Ethereum gas fees with the Etherscan gas tracker.
2. Lookup and verify smart contracts.
3. View crypto assets held in or associated with a public wallet address.
4. Observe live transactions taking place on the Ethereum blockchain.
5. Lookup a single transaction made from any Ethereum wallet.
6. Discover which smart contracts have a verified source code and security audit.
7. Keep track of how many smart contracts a user has authorized with their wallet. 8.
Review and revoke access to a wallet for any decentralized applications (DApps).

More Related Content

Similar to Blockchain Chapter #4.pdf

Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block ChainSanatPandoh
 
Difference between Ethereum and Bitcoin.pdf
Difference between Ethereum and Bitcoin.pdfDifference between Ethereum and Bitcoin.pdf
Difference between Ethereum and Bitcoin.pdfGrace Baker
 
Ethereum: Native Currency and Token
Ethereum: Native Currency and TokenEthereum: Native Currency and Token
Ethereum: Native Currency and TokenKC Tam
 
Ethereum Roadmap Explained In Laymans Terms
Ethereum Roadmap Explained In Laymans TermsEthereum Roadmap Explained In Laymans Terms
Ethereum Roadmap Explained In Laymans TermsEsha Gungadin
 
What is ethereum? which is the best place to buy ethereum Canada?
What is ethereum? which is the best place to buy ethereum Canada?What is ethereum? which is the best place to buy ethereum Canada?
What is ethereum? which is the best place to buy ethereum Canada?Bitcoin Wallet Canada
 
How Does Ethereum Work? How to Buy Ethereum In Canada?
How Does Ethereum Work? How to Buy Ethereum In Canada?How Does Ethereum Work? How to Buy Ethereum In Canada?
How Does Ethereum Work? How to Buy Ethereum In Canada?Bitcoin Wallet Canada
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshellDaniel Chan
 
Ryan Stortz & Sophia D'Antoine - “EVM2VEC: Bug Discovery in Smart Contracts”
Ryan Stortz & Sophia D'Antoine - “EVM2VEC: Bug Discovery in Smart Contracts”Ryan Stortz & Sophia D'Antoine - “EVM2VEC: Bug Discovery in Smart Contracts”
Ryan Stortz & Sophia D'Antoine - “EVM2VEC: Bug Discovery in Smart Contracts”Hacken_Ecosystem
 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumTomoaki Sato
 
Block chain - Smart contacts.pptx
Block chain - Smart contacts.pptxBlock chain - Smart contacts.pptx
Block chain - Smart contacts.pptxshraddhaphirke1
 
Building Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractBuilding Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractVaideeswaran Sethuraman
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block ChainSanatPandoh
 
Ethereum Mining How To
Ethereum Mining How ToEthereum Mining How To
Ethereum Mining How ToNugroho Gito
 
What is Ethereum? – A Complete Guide to Ethereum for Beginners
What is Ethereum? – A Complete Guide to Ethereum for BeginnersWhat is Ethereum? – A Complete Guide to Ethereum for Beginners
What is Ethereum? – A Complete Guide to Ethereum for BeginnersCoinGape
 
Distributed exchanges
Distributed exchangesDistributed exchanges
Distributed exchangesDidier Martin
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to EthereumTerek Judi
 
BCHGraz - Meetup #8 - Intro & Ethereum
 BCHGraz - Meetup #8 - Intro & Ethereum BCHGraz - Meetup #8 - Intro & Ethereum
BCHGraz - Meetup #8 - Intro & EthereumBlockchainHub Graz
 

Similar to Blockchain Chapter #4.pdf (20)

Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
 
Ethereum
EthereumEthereum
Ethereum
 
Difference between Ethereum and Bitcoin.pdf
Difference between Ethereum and Bitcoin.pdfDifference between Ethereum and Bitcoin.pdf
Difference between Ethereum and Bitcoin.pdf
 
Ethereum: Native Currency and Token
Ethereum: Native Currency and TokenEthereum: Native Currency and Token
Ethereum: Native Currency and Token
 
Ethereum Roadmap Explained In Laymans Terms
Ethereum Roadmap Explained In Laymans TermsEthereum Roadmap Explained In Laymans Terms
Ethereum Roadmap Explained In Laymans Terms
 
What is ethereum? which is the best place to buy ethereum Canada?
What is ethereum? which is the best place to buy ethereum Canada?What is ethereum? which is the best place to buy ethereum Canada?
What is ethereum? which is the best place to buy ethereum Canada?
 
All About Ethereum
All About EthereumAll About Ethereum
All About Ethereum
 
How Does Ethereum Work? How to Buy Ethereum In Canada?
How Does Ethereum Work? How to Buy Ethereum In Canada?How Does Ethereum Work? How to Buy Ethereum In Canada?
How Does Ethereum Work? How to Buy Ethereum In Canada?
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshell
 
Ryan Stortz & Sophia D'Antoine - “EVM2VEC: Bug Discovery in Smart Contracts”
Ryan Stortz & Sophia D'Antoine - “EVM2VEC: Bug Discovery in Smart Contracts”Ryan Stortz & Sophia D'Antoine - “EVM2VEC: Bug Discovery in Smart Contracts”
Ryan Stortz & Sophia D'Antoine - “EVM2VEC: Bug Discovery in Smart Contracts”
 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
 
Block chain - Smart contacts.pptx
Block chain - Smart contacts.pptxBlock chain - Smart contacts.pptx
Block chain - Smart contacts.pptx
 
Building Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractBuilding Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart Contract
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
 
Ethereum Mining How To
Ethereum Mining How ToEthereum Mining How To
Ethereum Mining How To
 
What is Ethereum? – A Complete Guide to Ethereum for Beginners
What is Ethereum? – A Complete Guide to Ethereum for BeginnersWhat is Ethereum? – A Complete Guide to Ethereum for Beginners
What is Ethereum? – A Complete Guide to Ethereum for Beginners
 
Distributed exchanges
Distributed exchangesDistributed exchanges
Distributed exchanges
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to Ethereum
 
BCHGraz - Meetup #8 - Intro & Ethereum
 BCHGraz - Meetup #8 - Intro & Ethereum BCHGraz - Meetup #8 - Intro & Ethereum
BCHGraz - Meetup #8 - Intro & Ethereum
 
Ethereum vs fabric vs corda
Ethereum vs fabric vs cordaEthereum vs fabric vs corda
Ethereum vs fabric vs corda
 

Recently uploaded

chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf203318pmpc
 

Recently uploaded (20)

chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 

Blockchain Chapter #4.pdf

  • 1. Module 4: public blockchain Prepared By: Prof. Swapnil S. Sonawane
  • 2. Ethereum components Miner and Mining node: A miner is responsible for writing a transaction to the Ethereum series. Miners get two kinds of rewards: benefit for writing a block into the series and accumulative gas prices There are two types of nodes (computers) in the Ethereum network: Mining nodes and Ethereum virtual machines. Mining nodes refer to the nodes that belong to miners and EVM has a unique code attached to it, which is called as smart contract. Mining nodes are part of the same network where EVM is hosted. Each mining node maintains its version of Ethereum ledger, and the ledgers could be identical. It is the job of the miners to ensure that their ledger is always upgraded with the latest blocks.
  • 3. Ethereum Virtual Machine (EVM): A blockchain system is made of numerous nodes belonging to both miners and also a few who do not want to mine but function as aids for the implementation of smart contracts. These nodes are called Ethereum Virtual Machines (EVM). EVMs are mostly in charge of supplying a run time that could perform code compiled from smart contracts. It does not need access to the ledger; however, it contains only limited information regarding the current transaction. Ether: Ether is a type of cryptocurrency used in Ethereum. To set up a smart contract using the Ethereum platform, the contract author needs to pay in the form of ether. That is done so people might write optimized codes that do not waste the Ethereum network's computing ability on unnecessary tasks.
  • 4. Gas: Gas is the internal currency of Ethereum. The execution and resource utilization costs are predetermined in Ethereum in terms of Gas units. This is also known as Gas Cost. Transactions in Ethereum: Ethereum stores transactions within Blocks. A transaction (Contract) is simply a set of agreements between parties; there would be an exchange of assets, products, or services in place of currency, cryptocurrency, or some other asset either in the present or in the future. Ethereum Accounts: Ethereum supports two kinds of accounts. Every account comes with a balance that yields the present value saved in it. Once somebody creates an externally owned account on Ethereum, a public-private key is produced.
  • 5. An externally owned account may keep Ether in its balance and not have any code related to it. Normal contract accounts are similar to externally owned accounts. They are identified by the public address and do not hold any private keys. They can carry ether very similar to externally owned accounts. However, they have a programming code for smart contracts comprising of state variables and functions. Swarm and Whisper: Swarm is a peer to-peer document sharing platform, similar to Bit Torrent, incentivized with micro payments of ETH File records are divided into small chunks, dispersed, and stored with volunteers. The nodes which save and also function (calculate, store, and communicate) on those pieces are all paid with ETH from people using the information. Whisper is an encrypted messaging protocol that enables nodes to send out messages directly to each other, in a secure way that additionally hides the sender and recipient identity from third-party snoopers.
  • 6. Ethash Ethereum mining used an algorithm known as Ethash. The fundamental idea of the algorithm is that a miner tries to find a nonce input using brute force computation so that the resulting hash is smaller than a threshold determined by the calculated difficulty. A miner who discovers a block that can be inserted to the blockchain receives a block reward comprising of three ethers. This gas price is credited to the miner's accounts included as proof-of-work mining procedure an additional reward for adding transactions as a portion of this block.
  • 7. Mining In Ethereum The mining principle of Ethereum is different from that of bitcoin. Ethereum miners always look forward to mine new blocks and listen actively to receive new blocks from other miners. The endeavor of miners will always be to build on the block header and perform the subsequent task.
  • 8. Parent Hash: The miner need to identify hash of previous block. The hash of previous block or parent block will be added to current block header LogsBloom: It is the data structure that consist of log information Ethereum Accounts: Ethereum supports two kinds of accounts. Every account comes with a balance that yields the present value saved in it. Once somebody creates an externally owned account on Ethereum, a public-private key is produced. Transaction, state, and receipt hash: The miner hashes all transactions that are inside the block; the hashes are further combined in pairs to create a brand new hash.
  • 9. The hash is also known as Root transaction hash or Merkle Root transaction hash. The miner, in the same manner, computes the State transaction hashes and Receipt transaction hashes and adds to the block header. Nonce: A nonce is a random number that can be used just once in the cryptographic communication. Timestamp (Current UNIX time): The timestamp is another field, which indicates the UNIX time. It is the seconds passed after the first of January 1970 and is a 10-digit number. Ommer block: Ommer blocks are created in the Ethereum blockchain when two blocks are created and submitted to the ledger at roughly the same time. Only one can enter the ledger.
  • 10.
  • 11. MixHash: MixHash can be a hash which, when together with all nonce, demonstrates that a block has enough computation. Miners generate a mixhash until the outcome is the desired target hash. Difficulty: It decides the complexity of the puzzle/challenge awarded to miners of a particular block. The gas limit of the block decides the most gas allowed for the block. Number: The number is the sequential number of a block on the chain.
  • 12. Architecture of Ethereum In a decentralized application, we need consensus and the blockchain was that missing ingredient to reach consensus in a decentralized way. So, for consensus (Layer 0) , we need some way to agree upon all of these application level constructs Layer 5: Dapps Layer 4: Browsers Layer 3: Inter operability Layer 2: Blockchain services Layer 1: Economic layer Layer 0: Consensus layer
  • 13. We want an economic token (Layer 1) to incentivize each one of the nodes, either to do the computation, or perform the storage operation .This is where the tokens get involved. Layer 2, we desire a brand-new form of decentralized storage, which is peer-to-peer reviewed, along with IPFs (interplanetary file system). In addition, we also have smart contracts. On top of that, we have interoperability (Layer 3). In this decentralized world, where we have all of these different apps, each with their tokens, how is one supposed to exchange value between these tokens? The answer is to write a universal wrapper around all cryptocurrencies. This exchange protocol (of Layer 3) would transfer the amount or transmit value between all of these different tokens as one uses the various services. Next, we have the browser (Layer 4) to access the decentralized applications. Some browsers are made for decentralized applications, like Mist, Omni wallet, and Maelstrom. After this layer, we build DApps (Layer 5), where we start adding application-level constructs.
  • 14. Workflow of Ethereum Solidity is the native coding language of Ethereum. It creates a .sol file as an outcome. Solidity Compiler (SOLC) is used to compile the solidity file (sol). Bytecode invokes Web3js for deployment. Once it is deployed, it returns the Contract and the Application Binary Interface (ABI). When this contract is initiated, it can invoke contract methods and signs, and pass them to Ether to perform the Operation.
  • 15. Workflow for Deploying Smart Contracts: • The first step is to download the Ethereum node. • Then, write the solidity code. Compile it using a framework like a truffle. • Deploy the smart contract code to the network. • Call the deployed contract using Web3js, which is the front-end client that speaks to the Ethereum blockchain.
  • 16. Comparison between bitcoin and Ethereum Bitcoin Ethereum Founder Satoshi Nakamoto Vitalik Buterin and Team Purpose Cryptocurrency Network Software Release Date January 2009 July 2015 Scripting language Turing Incomplete Turing Complete Coin release method Early mining Through ICO Average block time Approx. 10 mins Approx. 15 seconds Transaction Model UTXO Account
  • 17. Bitcoin Ethereum Coin symbol BTC ETH Tokens Not available Available Monetary policy Hardcoded Not hardcoded Emission rate Halving policy followed Occasional Backward compatibility Available Not available Block limitation 1 MB per block NO limit
  • 18. Types of test networks There are three test nets currently in use, and each behaves similarly to the production blockchain (where your real Ether and tokens reside). 1. Ropsten: A proof-of-work blockchain that most closely resembles Ethereum; you can easily mine faux-Ether. 2. Kovan: A proof-of-authority blockchain, started by the Parity team. Ether can’t be mined; it has to be requested. 3. Rinkeby: A proof-of-authority blockchain, started by the Geth team. Ether can’t be mined; it has to be requested.
  • 19. Transferring ethers using metamask Step 1: Sign Into Your Coinbase Account To initiate the transfer of ETH, you will need to start by signing into your Coinbase account to access or buy some ETH. Step 2: Buy Ethereum (ETH) Select buy, enter the amount of money you want to convert to ETH, double-check that you are buying Ethereum, then choose your payment method and finally click on “Buy Now” Step 3: Click Send Once you have some ETH in your Coinbase account, navigate to the top of your account and click the Send/Receive button. Then, choose the amount of ETH you want to send to your MetaMask wallet,
  • 20. Step 4: Copy/Paste Your MetaMask Address to Coinbase Before sending your ETH, you need to sign into your MetaMask wallet to copy your wallet address. Next, paste your Metamask wallet address into the “To” section in your Coinbase account. Step 5: Click Continue/Send Now After pasting your MetaMask wallet into Coinbase, click Continue to review your transfer. Once you have confirmed the transfer looks good, tap “Send Now” Step 6: Check Your MetaMask Wallet To confirm that you have received your ETH, log into your MetaMask wallet where you should see a front preview of your new balance.
  • 21. Ethereum Frameworks 1. Truffle Truffle is another framework for building decentralized applications on the Ethereum blockchain. It is the most popular and one of the pioneer frameworks. It offers the aid of compilation, deployment, and testing. Truffle offers a development network to run and test DApps without needing to deploy to the mainnet and serves as a local development blockchain for testing. 2. Embark Embark is another framework for the EVM blockchain that is regarded as a full- stack framework. This means the framework offers the solution of building an entire decentralized application’s frontend and backend simultaneously.
  • 22. Embark watches for changes in your Solidity smart contracts and frontend (HTML and JavaScript) code, and redeploys them to the blockchain network. 3. Hardhat Hardhat is a framework for building smart contracts that offers a development environment for professionals. This development environment lets users compile, run tests, check smart contracts for mistakes or debugging, and deploy decentralized applications. 4. OpenZeppelin OpenZepplin is a toolkit with plugins that help build smart contracts faster. To use any of the smart contracts in OpenZeppelin, you must import them into your own smart contract. OpenZeppelin is actually distributed as an npm package, meaning you must install Node.js first.
  • 23. Etherscan.io Etherscan permits an individual to view the assets held on any public Ethereum wallet address. On Etherscan by entering any Ethereum address into the search box, one can see the current balance and transaction history of the wallet under consideration. Etherscan displays any gas fees and smart contracts involving that address. Etherscan can be used to: 1. Calculate Ethereum gas fees with the Etherscan gas tracker. 2. Lookup and verify smart contracts. 3. View crypto assets held in or associated with a public wallet address.
  • 24. 4. Observe live transactions taking place on the Ethereum blockchain. 5. Lookup a single transaction made from any Ethereum wallet. 6. Discover which smart contracts have a verified source code and security audit. 7. Keep track of how many smart contracts a user has authorized with their wallet. 8. Review and revoke access to a wallet for any decentralized applications (DApps).