SlideShare a Scribd company logo
1 of 20
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
 
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
 
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
 
Esn whitepaper
Esn whitepaperEsn whitepaper
Esn whitepaper
Aditi Bhattacharya
 
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

Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Lisi Hocke
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
drm1699
 

Recently uploaded (20)

Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
 
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
Rapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and InsightsRapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and Insights
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdf
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
 

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