unit-5_blockchain-ethereum-platform-using-solidity-
unit-5_blockchain-ethereum-platform-using-solidity-
College of Engineering
Subject :- Blockchain Technology
Unit 5
Blockchain Ethereum
Platform using Solidity
SNJB’s KBJ CoE | Civil | Computer | E&TC | Mechanical | AIDS | MBA | Visit Us @: www.snjb.org
SNJB’s Late Sau. K. B. J. College of Engineering
Outcome
SNJB’s KBJ CoE | Civil | Computer | E&TC | Mechanical | AIDS | MBA | Visit Us @: www.snjb.org
SNJB’s Late Sau. K. B. J. College of Engineering
PO Mapping
SNJB’s KBJ CoE | Civil | Computer | E&TC | Mechanical | AIDS | MBA | Visit Us @: www.snjb.org
SNJB’s Late Sau. K. B. J. College of Engineering
Syllabus
1. What is Ethereum 9.Swarm (Decentralized Storage
2. Types of Ethereum Networks Platform)
3. EVM (Ethereum Virtual 10. Whisper (Decentralized
Machine) Messaging Platform)
4. Introduction to smart contracts
5. Purpose and types of Smart Case Study:
Contracts Study Truffle Development
6. Implementing and deploying Environment
smart contracts using Solidity
SNJB’s Late Sau. K. B. J. College of Engineering
Ethereum
Ethereum is the second major innovation in
Blockchain since the invention of Bitcoin.
While Bitcoin can be described as a digital money.
Ethereum is a decentralized platform for
programming a digital money.
SNJB’s Late Sau. K. B. J. College of Engineering
What is Ethereum ??
● Ethereum is an open-source distributed computing platform for building
decentralized applications.
● Vitalik Buterin envisioned Ethereum as a platform for developers to write
programs on the blockchain.
● he used similar Blockchain designs & protocols as that of Bitcoin’s and improvised
it to support applications beyond currency issuance.
● Anyone across the globe can connect with Ethereum blockchain to develop a
program and can maintain the current state of the network, hence the term “World
Computer”.[1]
Ethereum
Founder
SNJB’s Late Sau. K. B. J. College of Engineering
SNJB’s Late Sau. K. B. J. College of Engineering
Ethereum
● Ethereum blockchain is an open-source global platform that supports
decentralized applications.
● It offers a programmability feature, coding is done in smart contracts.
● It runs its own currency named Ether and is abbreviated as ETH.
● It is a general-purpose blockchain capable of Executing code.[1]
● Ethereum split into two different blockchains in 2016 namely Ethereum(ETH),
and Ethereum Classic(ETC).
2) Nodes:
3) Transactions:
The set of rules that is followed for considering the validity of a transaction and a
block in Ethereum called consensus rules.
5) Consensus Algorithm:
The consensus algorithm is the procedure to obtain agreement on the longest chain
in the distributed Ethereum network.
6) State Machine:
Ethereum transactions and state changes are processed by the state machine called
Ethereum Virtual Machine abbreviated as EVM.[1]
SNJB’s Late Sau. K. B. J. College of Engineering
Features of Ethereum
DAO DApp
SNJB’s Late Sau. K. B. J. College of Engineering
1. Ether
● Ether (ETH) is Ethereum cryptocurrency.
● It is used to pay for the computational resources and the transaction fees for any
transaction executed on the Ethereum network.
● Ether is also used to buy gas, which is used to pay for the computation of any
transaction made on the Ethereum network.
● if you want to deploy a contract on Ethereum, Gas is the execution fee paid
● Ether can be utilized for building decentralized applications, building smart
contracts, and making regular peer-to-peer payments.[3]
SNJB’s Late Sau. K. B. J. College of Engineering
GAS Ethereum
● Just like we need fuel to run a car, we need gas to run applications on the
Ethereum network.
● Paying out ethers, to get a transaction done, value given is called gas.
● Gas is a unit that measures the computational power required to run a smart contract
or a transaction.
SNJB’s Late Sau. K. B. J. College of Engineering
2. Smart Contract
● A smart contract is a simple computer program that facilitates the exchange of
any asset between two parties. Concept invent by Nick Szabo
● It could be money, shares, property, or any other digital asset that you want to
exchange.
● The contract consists primarily of the terms and conditions mutually agreed on
between the parties (peers).
● Smart contracts are written in programming languages such as Solidity and Vyper
● Compiled by the Ethereum Virtual Machine into bytecode and executed on the
blockchain.
SNJB’s Late Sau. K. B. J. College of Engineering
2. Smart Contract
● primary feature is that once it is executed, it cannot be altered(Immutable)
● The verification process for the smart contracts is carried out by anonymous parties
without the need for a centralized authority(decentralized)
● The transfer of any asset or currency is done in a transparent and trustworthy
manner,
● Once the transaction is successfully done, the accounts of the sender and receiver
are updated accordingly
SNJB’s Late Sau. K. B. J. College of Engineering
2. Smart Contract
SNJB’s Late Sau. K. B. J. College of Engineering
2. Smart Contract : Example
SNJB’s Late Sau. K. B. J. College of Engineering
Smart Contract:
Advantage
View View
● Solidity :
● An object-oriented programming language
● It is used to design and implement smart contracts within the Ethereum Virtual
Platform and several other Blockchain platforms.
● Solidity is a statically-typed programming language
● Ethereum Solidity is a contract-oriented, high-level language with syntax like that of
JavaScript.
SNJB’s Late Sau. K. B. J. College of Engineering
Basics of Solidity
SNJB’s Late Sau. K. B. J. College of Engineering
// SPDX-License-Identifier: MIT
// compiler version must be greater than or equal to 0.8.13
and less than 0.9.0
pragma solidity ^0.8.13;
contract HelloWorld {
string public greet = "Hello World!";
}
SNJB’s Late Sau. K. B. J. College of Engineering
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
Book of Swarm - “If the Ethereum blockchain is the CPU of the world computer then
Swarm is the hard disk.”
SNJB’s Late Sau. K. B. J. College of Engineering
Whisper( Decentralized Messaging Platform )
● Whisper provides decentralized peer-to-peer messaging capabilities to the Ethereum
network.
● Whisper is a communication protocol that DApps use to communicate with each
other.
● The data and routing of messages are encrypted within Whisper communications.
● Whisper is also designed to provide a communication layer that cannot be traced and
provides dark communication between parties.
● Blockchain can be used for communication, but that is expensive, and a consensus is
not really required for messages exchanged
SNJB’s Late Sau. K. B. J. College of Engineering
Whisper( Decentralized Messaging Platform )
SNJB’s Late Sau. K. B. J. College of Engineering
Case Study : Study Truffle Development Environment
● Truffle is a one-stop solution for building DApps: Compiling Contracts, Deploying
Contracts, Injecting it into a web app, Creating front-end for DApps and Testing.
Truffle Suite has three components:
1. https://www.theengineeringprojects.com/2021/06/ethereum-blockchain.html
2. https://www.edureka.co/blog/what-is-ethereum/
3. https://www.simplilearn.com/tutorials/blockchain-tutorial/what-is-ethereum
4. https://originstamp.com/blog/what-is-ethereum-and-what-are-its-use-cases/
5. https://www.bitpanda.com/academy/en/lessons/how-do-hard-and-soft-forks-work/
6. Book : “Introducing Ethereum and Solidity” by Chris Dannen [ Apress ]
7. https://intellipaat.com/blog/tutorial/blockchain-tutorial/what-is-solidity/
8. https://www.bitcoinsuisse.com/news/what-is-swarm
9. https://hackernoon.com/a-brief-introduction-to-ethereum-swarm
10. https://www.oreilly.com/library/view/mastering-blockchain/9781788839044/179582cb-9b26-4f60-
b176-7e577ed9a325.xhtml
11. https://www.edureka.co/blog/developing-ethereum-dapps-with-truffle
12. https://moralis.io/truffle-explained-what-is-the-truffle-suite/
13. https://distinguished.io/blog/what-is-truffle-blockchain