SlideShare a Scribd company logo
1 of 47
Download to read offline
INTRODUCTION TO
ETHEREUM ECOSYSTEM
&
SMART CONTRACTS
NPD Meet @ Divum Corporate Services Pvt Ltd.
Jitendra Kumar.Balla & Vaideeswaran sethuraman
AGENDA
1. What is a
Blockchain?
2. Ethereum 3. Ethereum SMART
Contracts
CENTRALIZED
Issues:
Single point failure
Scaling
Inefficiency
All activities are managed by one
person/Organization
DECENTRALIZED
Solves:
Single point failure
Scaling
Inefficiency
Security and Transparency
Transaction time
INTRODUCTION TO
BLOCKCHAIN
BLOCKCHAIN
A blockchain allows for trustless transactions between
multiple parties. Or, more importantly, it allows transactions
without trust of a third party intermediary!
Decentralized system for an exchange a value/asserts
○ Distributed ledger
○ Immutability
○ Consensus
○ Security
LET’S START WITH A TRANSACTION
THAT OCCURS BETWEEN ACCOUNTS
Transaction #200
Account A Account B
E.g. Send 2 tokens
An example transaction could be:
Account A will send 1 tokens to Account B
A LEDGER IS A LIST OF TRANSACTIONS
(GROUPED INTO BLOCKS)
LEDGER
Block #100
Last Block: #99 (H)
Timestamp: TM,
Transaction #399
Transaction #400
Transaction #401
Block #97
Block #98
Block #99
Blocks
contain an
indeterminate
number of
transactions
BLOCKS ARE CHAINED TOGETHER
LEDGER
Block #100
Last Block: #99
Transaction #399
Transaction #400
Block #97 Block #98 Block #99
Blocks are
generated on a
time interval
(e.g. every 5
minutes)
The ledger is a chain of blocks! Each block is created
with a pointer to the previous block creating a
blockchain!
LEDGER
Distributed ledger = Distributed database
BLOCKCHAIN
Decentralized system for an exchange a value/asserts
○ Distributed ledger
○ Immutability
○ Consensus
○ Security
BLOCKCHAIN
Decentralized system for an exchange a value/asserts
○ Distributed ledger
○ Immutability
○ Consensus
○ Security
CONSENSUS
Consensus = Protocol by which peers agree on state of ledger
○ Ensure all peers in the network has exactly the same copy of
ledger
○ Fraudulent transactions kept out of the ledger
○ Guarantees to record transactions in chronological order
BLOCKCHAIN
Decentralized system for an exchange a value/asserts
○ Distributed ledger
○ Immutability
○ Consensus
○ Security
SECURITY
Wow!!, thats cool stuff
Bitcoin:
- Transfer money
- Fast transactions
- Less fee
- Transparent
Wow!!, thats cool stuff
Bitcoin:
- Transfer money
- Fast transactions
- Less fee
- Transparent
Great Technology:
- Launch my sub currency
- ICO (Crowdfunding)
- Managing digital assets
- Local laws
INTRODUCTION TO
ETHEREUM
ETHEREUM
Ethereum is an open blockchain platform that lets anyone
build and use decentralized applications that run on
blockchain technology.
Ethereum is world of computers
HOW DOES ETHEREUM WORK?
○ Ethereum’s basic unit is the account
○ State of every account
○ The Ethereum blockchain tracks the state of every account,
and all state transitions on the Ethereum blockchain are
transfers of value and information between accounts.
ETHEREUM ACCOUNTS:
There are two types of accounts:
○ Externally Owned Accounts (EOAs)
○ Contract Accounts, which are controlled by their
contract code and can only be “activated” by an EOA
ETHEREUM ACCOUNTS: Elliptic Curve
Digital Signature
Algorithm (ECDSA)
ETHEREUM ACCOUNTS:
○ Has an ether balance
○ Can send transactions (ether transfer or trigger
contract code), EOA
○ Bytecode
○ Nonce
SMART CONTRACTS
ETHER, EVM, GAS
ETHER
Ethereum value token is called Ether
Denominations:
Unit Wei Value Wei
wei 1 wei 1
Kwei (babbage) 1e3 wei 1,000
Mwei (lovelace) 1e6 wei 1,000,000
Gwei (shannon) 1e9 wei 1,000,000,000
microether (szabo) 1e12 wei 1,000,000,000,000
milliether (finney) 1e15 wei 1,000,000,000,000,000
ether 1e18 wei 1,000,000,000,000,000,000
ETHER SUPPLY
○ 48 days presale (July 2014): $ 60 M
○ 12M created to fund development
○ 5 Eth will created as rewarded for every block
○ 2-3 eths for non winning miners
○ Contract execution user pays Ether’s
ETHEREUM VIRTUAL MACHINE
○ Ethereum is “Turing complete”.
○ EVM will load bytecode and execute instructions
○ Every node will run eth client
GAS
○ Gas is the metering unit for use of the World Computer
○ Each operation in the EVM consumes gas
○ totalEstGas = startgas * gasprice
Transactions
0x60 0x01 0x60
0x02 0x01
Operation Name Gas Cost Remark
step 1 default amount per execution cycle
stop 0 free
suicide 0 free
sha3 20
sload 20 get from permanent storage
sstore 100 put into permanent storage
balance 20
create 100 contract creation
call 20 initiating a read-only call
memory 1 every additional word when expanding memory
txdata 5 every byte of data or code for a transaction
transaction 500 base fee transaction
contract creation 53000 changed in homestead from 21000
ETHEREUM TRANSACTIONS:
BITCOIN
● Transactions based
● Block creation ~10mins
● Less number of transactions
● Require high computation power
● Not stopping big miners
● Limited transaction based bitcoin
signature(128)
● Limited functions
● Peers can block list transaction
● SHA2 not so secure
● SHA256 is not ASIC resistance
● Account based
● Block creation ~12sec
● Mining algorithm based on
memory usage (Gas)
● Can decouple components
● Rich programing language for
contracts (Solidity)
● Uses SHA3
● Customize protocol based on local
law
● EthHash is ASIC resistance
ETHEREUM
INTRODUCTION TO
ETHEREUM DAPPS
○ Ethereum Client’s
○ Installation of Geth
○ Geth commands
○ Web3JS Apis
○ Solidity
○ Smart contracts
○ Deploying smart contracts
ETHEREUM CLIENTS
eth pyethapp geth ethereumjs-lib
3rd Party Impl
ethereumj ruby-ethereum ethereumjs-lib parity
SOLIDITY
SOLIDITY
Solidity is the most popular programming language
used to write smart contracts to run on the Ethereum
blockchain.
It is a high level language which when compiled gets
converted to EVM bytecode.
This is very similar to the world of Java where there are
JVM languages like Scala, Groovy, Clojure, JRuby etc.
SOLIDITY INTEGRATION TOOLS
IDE’s
- Remix
- IntelliJ IDEA plugin
- Visual Studio Extension
- Etheratom
- Solium
- Emacs Solidity
- Package for SublimeText — Solidity language syntax
SOLIDITY INTEGRATION TOOLS
Solidity Tools
- Dapp
Build tool, package manager, and deployment assistant
for Solidity.
- Solidity REPL
Instant command-line solidity console.
- solgraph
- Doxity
STRUCTURE OF A CONTRACT
- Types
- Operators
- Functions
- Function Modifiers
- Events
- Enum Types
- Types
Booleans
Integers
Address
String
Enums
- Function Types
public, private, internal, external
- Function Modifiers
STRUCTURE OF A CONTRACT
- Types
Booleans
Integers
Address
String
Enums
- Function Types
Public, private, internal
- Function Modifiers
STRUCTURE OF A CONTRACT
TRUFFLE/EMBARK
We have frameworks for web application development
such as Ruby on Rails, Python/Django etc, Truffle and
Embark are the two most popular frameworks used to
develop Dapps.
They abstract away lot of the complexities of compiling
and deploying your contract on the blockchain.
LET’S CODE….
Building Apps with Ethereum Smart Contract

More Related Content

What's hot

Smart contractjp smartcontract_about
Smart contractjp smartcontract_aboutSmart contractjp smartcontract_about
Smart contractjp smartcontract_aboutTomoaki Sato
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain PresentationZied GUESMI
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshellDaniel Chan
 
The Bitcoin Lightning Network
The Bitcoin Lightning NetworkThe Bitcoin Lightning Network
The Bitcoin Lightning NetworkShun Shiku
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to BlockchainJordan Harris
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to BlockchainMalak Abu Hammad
 
Blockchain and Bitcoin
Blockchain and BitcoinBlockchain and Bitcoin
Blockchain and BitcoinHugo Rodrigues
 
Introduction to Cryptocurrency trading
Introduction to Cryptocurrency tradingIntroduction to Cryptocurrency trading
Introduction to Cryptocurrency tradingAmir Rafati
 
Blockchain
BlockchainBlockchain
BlockchainSai Nath
 
Blockchain Digital Transformation Presentation
Blockchain Digital Transformation PresentationBlockchain Digital Transformation Presentation
Blockchain Digital Transformation Presentation101 Blockchains
 
What is tokenization in blockchain?
What is tokenization in blockchain?What is tokenization in blockchain?
What is tokenization in blockchain?Ulf Mattsson
 
Blockchain, DLT, Tokens and ICO Introduction Course
Blockchain, DLT, Tokens and ICO Introduction CourseBlockchain, DLT, Tokens and ICO Introduction Course
Blockchain, DLT, Tokens and ICO Introduction CourseJean-Marc Seigneur
 
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...Simplilearn
 
The Future of Money: Decentralized Finance
The Future of Money: Decentralized FinanceThe Future of Money: Decentralized Finance
The Future of Money: Decentralized FinanceJ. Scott Christianson
 
Creating Smart Contract
Creating Smart ContractCreating Smart Contract
Creating Smart ContractDeepak Aryal
 

What's hot (20)

Smart contractjp smartcontract_about
Smart contractjp smartcontract_aboutSmart contractjp smartcontract_about
Smart contractjp smartcontract_about
 
Smart contract
Smart contractSmart contract
Smart contract
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain Presentation
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshell
 
Ethereum 2.0
Ethereum 2.0Ethereum 2.0
Ethereum 2.0
 
The Bitcoin Lightning Network
The Bitcoin Lightning NetworkThe Bitcoin Lightning Network
The Bitcoin Lightning Network
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to Blockchain
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to Blockchain
 
Blockchain and Bitcoin
Blockchain and BitcoinBlockchain and Bitcoin
Blockchain and Bitcoin
 
Introduction to Cryptocurrency trading
Introduction to Cryptocurrency tradingIntroduction to Cryptocurrency trading
Introduction to Cryptocurrency trading
 
Blockchain
BlockchainBlockchain
Blockchain
 
Blockchain Digital Transformation Presentation
Blockchain Digital Transformation PresentationBlockchain Digital Transformation Presentation
Blockchain Digital Transformation Presentation
 
Block chain
Block chainBlock chain
Block chain
 
What is tokenization in blockchain?
What is tokenization in blockchain?What is tokenization in blockchain?
What is tokenization in blockchain?
 
Blockchain, DLT, Tokens and ICO Introduction Course
Blockchain, DLT, Tokens and ICO Introduction CourseBlockchain, DLT, Tokens and ICO Introduction Course
Blockchain, DLT, Tokens and ICO Introduction Course
 
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
 
Blockchain
BlockchainBlockchain
Blockchain
 
Blockchain and Cryptocurrency for Dummies
Blockchain and Cryptocurrency for DummiesBlockchain and Cryptocurrency for Dummies
Blockchain and Cryptocurrency for Dummies
 
The Future of Money: Decentralized Finance
The Future of Money: Decentralized FinanceThe Future of Money: Decentralized Finance
The Future of Money: Decentralized Finance
 
Creating Smart Contract
Creating Smart ContractCreating Smart Contract
Creating Smart Contract
 

Similar to Building Apps with Ethereum Smart Contract

Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Codemotion
 
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Codemotion
 
Blockchain, smart contracts - introduction
Blockchain, smart contracts - introductionBlockchain, smart contracts - introduction
Blockchain, smart contracts - introductionLukasz Jarmulowicz
 
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...Codemotion
 
Smart contracts in Solidity
Smart contracts in SoliditySmart contracts in Solidity
Smart contracts in SolidityFelix Crisan
 
Blockchain & decentralized finance (defi) | How blockchain technology is coup...
Blockchain & decentralized finance (defi) | How blockchain technology is coup...Blockchain & decentralized finance (defi) | How blockchain technology is coup...
Blockchain & decentralized finance (defi) | How blockchain technology is coup...Nidhi choraria
 
Introduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxIntroduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxGene Leybzon
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block ChainSanatPandoh
 
Block chain - Smart contacts.pptx
Block chain - Smart contacts.pptxBlock chain - Smart contacts.pptx
Block chain - Smart contacts.pptxshraddhaphirke1
 
Blockchain Basics
Blockchain BasicsBlockchain Basics
Blockchain BasicsAli Ayyash
 
Fluent destry saul
Fluent destry saulFluent destry saul
Fluent destry saulDestry Saul
 
Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Tomoaki Sato
 
Distributed Ledgers, Blockchains, and Smart Contracts
Distributed Ledgers, Blockchains, and Smart ContractsDistributed Ledgers, Blockchains, and Smart Contracts
Distributed Ledgers, Blockchains, and Smart ContractsDusan Andric
 
Introduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractIntroduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractThanh Nguyen
 

Similar to Building Apps with Ethereum Smart Contract (20)

Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
 
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
Jerome de Tychey - Building Web3.0 with Ethereum - Codemotion Berlin 2018
 
Blockchain for Notaries
Blockchain for NotariesBlockchain for Notaries
Blockchain for Notaries
 
Blockchain, smart contracts - introduction
Blockchain, smart contracts - introductionBlockchain, smart contracts - introduction
Blockchain, smart contracts - introduction
 
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
 
Smart contracts in Solidity
Smart contracts in SoliditySmart contracts in Solidity
Smart contracts in Solidity
 
Blockchain & decentralized finance (defi) | How blockchain technology is coup...
Blockchain & decentralized finance (defi) | How blockchain technology is coup...Blockchain & decentralized finance (defi) | How blockchain technology is coup...
Blockchain & decentralized finance (defi) | How blockchain technology is coup...
 
Introduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxIntroduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptx
 
Ethereum bxl
Ethereum bxlEthereum bxl
Ethereum bxl
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
 
Block chain - Smart contacts.pptx
Block chain - Smart contacts.pptxBlock chain - Smart contacts.pptx
Block chain - Smart contacts.pptx
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
 
What is ethereum
What is ethereumWhat is ethereum
What is ethereum
 
Blockchain Basics
Blockchain BasicsBlockchain Basics
Blockchain Basics
 
Fluent destry saul
Fluent destry saulFluent destry saul
Fluent destry saul
 
Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)
 
Distributed Ledgers, Blockchains, and Smart Contracts
Distributed Ledgers, Blockchains, and Smart ContractsDistributed Ledgers, Blockchains, and Smart Contracts
Distributed Ledgers, Blockchains, and Smart Contracts
 
Introduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractIntroduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart Contract
 
How to design, code, deploy and execute a smart contract
How to design, code, deploy and execute a smart contractHow to design, code, deploy and execute a smart contract
How to design, code, deploy and execute a smart contract
 
Ethereum
EthereumEthereum
Ethereum
 

Recently uploaded

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Building Apps with Ethereum Smart Contract

  • 1.
  • 2. INTRODUCTION TO ETHEREUM ECOSYSTEM & SMART CONTRACTS NPD Meet @ Divum Corporate Services Pvt Ltd. Jitendra Kumar.Balla & Vaideeswaran sethuraman
  • 3. AGENDA 1. What is a Blockchain? 2. Ethereum 3. Ethereum SMART Contracts
  • 4. CENTRALIZED Issues: Single point failure Scaling Inefficiency All activities are managed by one person/Organization
  • 7. BLOCKCHAIN A blockchain allows for trustless transactions between multiple parties. Or, more importantly, it allows transactions without trust of a third party intermediary! Decentralized system for an exchange a value/asserts ○ Distributed ledger ○ Immutability ○ Consensus ○ Security
  • 8. LET’S START WITH A TRANSACTION THAT OCCURS BETWEEN ACCOUNTS Transaction #200 Account A Account B E.g. Send 2 tokens An example transaction could be: Account A will send 1 tokens to Account B
  • 9. A LEDGER IS A LIST OF TRANSACTIONS (GROUPED INTO BLOCKS) LEDGER Block #100 Last Block: #99 (H) Timestamp: TM, Transaction #399 Transaction #400 Transaction #401 Block #97 Block #98 Block #99 Blocks contain an indeterminate number of transactions
  • 10. BLOCKS ARE CHAINED TOGETHER LEDGER Block #100 Last Block: #99 Transaction #399 Transaction #400 Block #97 Block #98 Block #99 Blocks are generated on a time interval (e.g. every 5 minutes) The ledger is a chain of blocks! Each block is created with a pointer to the previous block creating a blockchain!
  • 11. LEDGER Distributed ledger = Distributed database
  • 12. BLOCKCHAIN Decentralized system for an exchange a value/asserts ○ Distributed ledger ○ Immutability ○ Consensus ○ Security
  • 13. BLOCKCHAIN Decentralized system for an exchange a value/asserts ○ Distributed ledger ○ Immutability ○ Consensus ○ Security
  • 14. CONSENSUS Consensus = Protocol by which peers agree on state of ledger ○ Ensure all peers in the network has exactly the same copy of ledger ○ Fraudulent transactions kept out of the ledger ○ Guarantees to record transactions in chronological order
  • 15. BLOCKCHAIN Decentralized system for an exchange a value/asserts ○ Distributed ledger ○ Immutability ○ Consensus ○ Security
  • 17.
  • 18. Wow!!, thats cool stuff Bitcoin: - Transfer money - Fast transactions - Less fee - Transparent
  • 19. Wow!!, thats cool stuff Bitcoin: - Transfer money - Fast transactions - Less fee - Transparent Great Technology: - Launch my sub currency - ICO (Crowdfunding) - Managing digital assets - Local laws
  • 21. ETHEREUM Ethereum is an open blockchain platform that lets anyone build and use decentralized applications that run on blockchain technology. Ethereum is world of computers
  • 22. HOW DOES ETHEREUM WORK? ○ Ethereum’s basic unit is the account ○ State of every account ○ The Ethereum blockchain tracks the state of every account, and all state transitions on the Ethereum blockchain are transfers of value and information between accounts.
  • 23. ETHEREUM ACCOUNTS: There are two types of accounts: ○ Externally Owned Accounts (EOAs) ○ Contract Accounts, which are controlled by their contract code and can only be “activated” by an EOA
  • 24. ETHEREUM ACCOUNTS: Elliptic Curve Digital Signature Algorithm (ECDSA)
  • 25. ETHEREUM ACCOUNTS: ○ Has an ether balance ○ Can send transactions (ether transfer or trigger contract code), EOA ○ Bytecode ○ Nonce
  • 28. ETHER Ethereum value token is called Ether Denominations: Unit Wei Value Wei wei 1 wei 1 Kwei (babbage) 1e3 wei 1,000 Mwei (lovelace) 1e6 wei 1,000,000 Gwei (shannon) 1e9 wei 1,000,000,000 microether (szabo) 1e12 wei 1,000,000,000,000 milliether (finney) 1e15 wei 1,000,000,000,000,000 ether 1e18 wei 1,000,000,000,000,000,000
  • 29. ETHER SUPPLY ○ 48 days presale (July 2014): $ 60 M ○ 12M created to fund development ○ 5 Eth will created as rewarded for every block ○ 2-3 eths for non winning miners ○ Contract execution user pays Ether’s
  • 30. ETHEREUM VIRTUAL MACHINE ○ Ethereum is “Turing complete”. ○ EVM will load bytecode and execute instructions ○ Every node will run eth client
  • 31. GAS ○ Gas is the metering unit for use of the World Computer ○ Each operation in the EVM consumes gas ○ totalEstGas = startgas * gasprice Transactions 0x60 0x01 0x60 0x02 0x01
  • 32. Operation Name Gas Cost Remark step 1 default amount per execution cycle stop 0 free suicide 0 free sha3 20 sload 20 get from permanent storage sstore 100 put into permanent storage balance 20 create 100 contract creation call 20 initiating a read-only call memory 1 every additional word when expanding memory txdata 5 every byte of data or code for a transaction transaction 500 base fee transaction contract creation 53000 changed in homestead from 21000
  • 34. BITCOIN ● Transactions based ● Block creation ~10mins ● Less number of transactions ● Require high computation power ● Not stopping big miners ● Limited transaction based bitcoin signature(128) ● Limited functions ● Peers can block list transaction ● SHA2 not so secure ● SHA256 is not ASIC resistance ● Account based ● Block creation ~12sec ● Mining algorithm based on memory usage (Gas) ● Can decouple components ● Rich programing language for contracts (Solidity) ● Uses SHA3 ● Customize protocol based on local law ● EthHash is ASIC resistance ETHEREUM
  • 36. ○ Ethereum Client’s ○ Installation of Geth ○ Geth commands ○ Web3JS Apis ○ Solidity ○ Smart contracts ○ Deploying smart contracts
  • 37. ETHEREUM CLIENTS eth pyethapp geth ethereumjs-lib 3rd Party Impl ethereumj ruby-ethereum ethereumjs-lib parity
  • 39. SOLIDITY Solidity is the most popular programming language used to write smart contracts to run on the Ethereum blockchain. It is a high level language which when compiled gets converted to EVM bytecode. This is very similar to the world of Java where there are JVM languages like Scala, Groovy, Clojure, JRuby etc.
  • 40. SOLIDITY INTEGRATION TOOLS IDE’s - Remix - IntelliJ IDEA plugin - Visual Studio Extension - Etheratom - Solium - Emacs Solidity - Package for SublimeText — Solidity language syntax
  • 41. SOLIDITY INTEGRATION TOOLS Solidity Tools - Dapp Build tool, package manager, and deployment assistant for Solidity. - Solidity REPL Instant command-line solidity console. - solgraph - Doxity
  • 42. STRUCTURE OF A CONTRACT - Types - Operators - Functions - Function Modifiers - Events - Enum Types
  • 43. - Types Booleans Integers Address String Enums - Function Types public, private, internal, external - Function Modifiers STRUCTURE OF A CONTRACT
  • 44. - Types Booleans Integers Address String Enums - Function Types Public, private, internal - Function Modifiers STRUCTURE OF A CONTRACT
  • 45. TRUFFLE/EMBARK We have frameworks for web application development such as Ruby on Rails, Python/Django etc, Truffle and Embark are the two most popular frameworks used to develop Dapps. They abstract away lot of the complexities of compiling and deploying your contract on the blockchain.