SlideShare a Scribd company logo
Dapps 101
Katarzyna Jagieła & Maciej Bembenista
Agenda
— Ethereum, Solidity
— Introduction to Ethereum
— What are smart contracts?
— Example contract
— Web3
— Transactions in ETH
— Using Metamask
— Interacting with smart contract
What’s Ethereum all about?
- distributed public blockchain network
- different in purpose and capability from Bitcoin, but based on similar principles
- focuses on running decentralized applications
- runs smart contract code in a built-in EVM (Ethereum Virtual Machine)
- it uses Ether - native currency of the Ethereum blockchain
- gas - a special unit on Ethereum, used to calculate the amount of fees that we pay the miners for including our
transactions in their blocks
Smart Contracts
- they allow you to exchange money (Ether) or content such as tokens in a trustless way
- each contract has its own address on the blockchain
- are deployed to the blockchain and all code execution happens on the EVM during mining
- are not editable - you can change properties of the contract through its code, but you can’t upload code changes
or fixes - you need to get it right the first time or deploy a new contract
Contract example
What’s the cost of a transaction?
- Ethereum uses a unit called gas to determine the fee for the miner that will mine your
transaction
- Each operation in Ethereum has a set gas amount that it costs - for example, assembler
instruction that’s used to create a contract costs 32000 gas to run.
- You can set how much you’d like to pay per single gas unit used up to mine your transaction
- You can also set a gas limit in order to avoid paying for a transaction if it could use too much
gas.
How to communicate with Ethereum?
Web3 - a nice abstraction for JSON RPC
communication with Ethereum
- It’s available for JavaScript and Python - more languages are coming
- Provides a set of useful helpers for dealing with Ether units (wei, gwei etc.)
- Allows us to deploy contracts, interact with them, check their state
- Allows us to send Ether transactions
- Of course, anything that’s accomplished by Web3 can be done without it - it’ll just be harder to
implement
Web3.js - fetching an account’s balance
Web3py - fetching an account’s balance
How to create a Web Dapp
- Problem: Ethereum is based on public / private keys - we don’t want users to provide their
private keys to the application
- Problem: Users can sign their transactions offline, but that requires them to use a wallet
separate from our web Dapp - UX would suffer
- Solution: Use a browser-based wallet that allows us to interact with user’s private key if he
allows us to, without accessing them directly
Metamask - Ethereum wallet for the browser
Web3.js - sending a transaction through Metamask
Web3py - sending a transaction
Interacting with smart contracts
- ABI - methods and variables available on the contract
- Address - address of the deployed contract
Web3py / Web3.js - calling contract methods
Web3py - sending contract transactions
Web3.js - sending contract transactions
Questions?
Thanks!

More Related Content

Similar to Dapps 101

DevEx in Ethereum - a look at the developer stack
DevEx in Ethereum - a look at the developer stackDevEx in Ethereum - a look at the developer stack
DevEx in Ethereum - a look at the developer stack
All Things Open
 
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
 
Blockchain Development
Blockchain DevelopmentBlockchain Development
Blockchain Development
preetikumara
 
Ethereum Solidity Fundamentals
Ethereum Solidity FundamentalsEthereum Solidity Fundamentals
Ethereum Solidity Fundamentals
Eno Bassey
 
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
 
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...
Edureka!
 
Introduction_to_Blockchain_&_Ethereum.pptx
Introduction_to_Blockchain_&_Ethereum.pptxIntroduction_to_Blockchain_&_Ethereum.pptx
Introduction_to_Blockchain_&_Ethereum.pptx
WijdenBenothmen1
 
BlockChain Public
BlockChain PublicBlockChain Public
BlockChain Public
Marie-Paule Odini
 
Ethereum (Blockchain Network)
Ethereum (Blockchain Network)Ethereum (Blockchain Network)
Ethereum (Blockchain Network)
Qais Ammari
 
Ethereum
EthereumEthereum
Ethereum
Brian Yap
 
blockchain technology note-unit-5-notes.pdf for sppu engineering students
blockchain technology note-unit-5-notes.pdf for sppu engineering studentsblockchain technology note-unit-5-notes.pdf for sppu engineering students
blockchain technology note-unit-5-notes.pdf for sppu engineering students
imranakhtar83
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart Contract
All Things Open
 
Eraswap Network Whitepaper
Eraswap  Network WhitepaperEraswap  Network Whitepaper
Eraswap Network Whitepaper
supriyasen123
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
SanatPandoh
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshell
Daniel Chan
 
What is ethereum
What is ethereumWhat is ethereum
What is ethereum
Celine George
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to Ethereum
Terek Judi
 
Esn whitepaper
Esn whitepaperEsn whitepaper
Esn whitepaper
Aditi Bhattacharya
 
Esn whitepaper
Esn whitepaperEsn whitepaper
Esn whitepaper
sankalpshinde8
 
Era Swap Network
Era Swap NetworkEra Swap Network
Era Swap Network
shantanubhattacharya14
 

Similar to Dapps 101 (20)

DevEx in Ethereum - a look at the developer stack
DevEx in Ethereum - a look at the developer stackDevEx in Ethereum - a look at the developer stack
DevEx in Ethereum - a look at the developer stack
 
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...
 
Blockchain Development
Blockchain DevelopmentBlockchain Development
Blockchain Development
 
Ethereum Solidity Fundamentals
Ethereum Solidity FundamentalsEthereum Solidity Fundamentals
Ethereum Solidity Fundamentals
 
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...
 
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...
 
Introduction_to_Blockchain_&_Ethereum.pptx
Introduction_to_Blockchain_&_Ethereum.pptxIntroduction_to_Blockchain_&_Ethereum.pptx
Introduction_to_Blockchain_&_Ethereum.pptx
 
BlockChain Public
BlockChain PublicBlockChain Public
BlockChain Public
 
Ethereum (Blockchain Network)
Ethereum (Blockchain Network)Ethereum (Blockchain Network)
Ethereum (Blockchain Network)
 
Ethereum
EthereumEthereum
Ethereum
 
blockchain technology note-unit-5-notes.pdf for sppu engineering students
blockchain technology note-unit-5-notes.pdf for sppu engineering studentsblockchain technology note-unit-5-notes.pdf for sppu engineering students
blockchain technology note-unit-5-notes.pdf for sppu engineering students
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart Contract
 
Eraswap Network Whitepaper
Eraswap  Network WhitepaperEraswap  Network Whitepaper
Eraswap Network Whitepaper
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshell
 
What is ethereum
What is ethereumWhat is ethereum
What is ethereum
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to Ethereum
 
Esn whitepaper
Esn whitepaperEsn whitepaper
Esn whitepaper
 
Esn whitepaper
Esn whitepaperEsn whitepaper
Esn whitepaper
 
Era Swap Network
Era Swap NetworkEra Swap Network
Era Swap Network
 

Recently uploaded

Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
Ayan Halder
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 

Recently uploaded (20)

Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 

Dapps 101

  • 1. Dapps 101 Katarzyna Jagieła & Maciej Bembenista
  • 2. Agenda — Ethereum, Solidity — Introduction to Ethereum — What are smart contracts? — Example contract — Web3 — Transactions in ETH — Using Metamask — Interacting with smart contract
  • 3. What’s Ethereum all about? - distributed public blockchain network - different in purpose and capability from Bitcoin, but based on similar principles - focuses on running decentralized applications - runs smart contract code in a built-in EVM (Ethereum Virtual Machine) - it uses Ether - native currency of the Ethereum blockchain - gas - a special unit on Ethereum, used to calculate the amount of fees that we pay the miners for including our transactions in their blocks
  • 4. Smart Contracts - they allow you to exchange money (Ether) or content such as tokens in a trustless way - each contract has its own address on the blockchain - are deployed to the blockchain and all code execution happens on the EVM during mining - are not editable - you can change properties of the contract through its code, but you can’t upload code changes or fixes - you need to get it right the first time or deploy a new contract
  • 6. What’s the cost of a transaction? - Ethereum uses a unit called gas to determine the fee for the miner that will mine your transaction - Each operation in Ethereum has a set gas amount that it costs - for example, assembler instruction that’s used to create a contract costs 32000 gas to run. - You can set how much you’d like to pay per single gas unit used up to mine your transaction - You can also set a gas limit in order to avoid paying for a transaction if it could use too much gas.
  • 7. How to communicate with Ethereum?
  • 8. Web3 - a nice abstraction for JSON RPC communication with Ethereum - It’s available for JavaScript and Python - more languages are coming - Provides a set of useful helpers for dealing with Ether units (wei, gwei etc.) - Allows us to deploy contracts, interact with them, check their state - Allows us to send Ether transactions - Of course, anything that’s accomplished by Web3 can be done without it - it’ll just be harder to implement
  • 9. Web3.js - fetching an account’s balance
  • 10. Web3py - fetching an account’s balance
  • 11. How to create a Web Dapp - Problem: Ethereum is based on public / private keys - we don’t want users to provide their private keys to the application - Problem: Users can sign their transactions offline, but that requires them to use a wallet separate from our web Dapp - UX would suffer - Solution: Use a browser-based wallet that allows us to interact with user’s private key if he allows us to, without accessing them directly
  • 12. Metamask - Ethereum wallet for the browser
  • 13. Web3.js - sending a transaction through Metamask
  • 14. Web3py - sending a transaction
  • 15. Interacting with smart contracts - ABI - methods and variables available on the contract - Address - address of the deployed contract
  • 16. Web3py / Web3.js - calling contract methods
  • 17. Web3py - sending contract transactions
  • 18. Web3.js - sending contract transactions