SlideShare a Scribd company logo
1 of 27
Download to read offline
Ingredients for
creating Dapps
by stefaan ponnet
API Craftsmanship Meetup aug 11 2016
The basics: Ethereum as a smart
contract platform
Blockchain
Nodes and mining
Transactions
EVM
Smart Contracts
Ethereum accounts : EOA and
Contract accounts
Regular Accounts : ( EOA : Externally Owned Accounts )
- consist of a public / private keypair
- controlled by a human - or whoever holds the private key
Contract account:
- contains the EVM code + the storage ( = smart contract )
- smart contracts are executed by an EOA ( an EOA starts a transaction )
The Ethereum Virtual Machine ( EVM )
- Place where Smart Contracts run on the Ethereum blockchain
- Ethereum is “Turing complete”. -> You can run any sort of application on
Ethereum
- the “distributed world computer”
- Dapp: Decentralized Application
EVM and the Ethereum nodes
- every Ethereum node runs instances of the EVM
- maintain state and transaction consensus across the blockchain
- contract code gets executed on every node
It is not efficient in terms of computing power , but gives:
- extreme levels of fault tolerance
- ensures zero downtime
- makes data stored on the blockchain forever unchangeable and
censorship-resistant.
3 types of instructions in the EVM
1. Create new Smart Contracts ( programs on the blockchain )
2. Execute functions of a specific smart contract
3. Transfer Ether
EVM opcodes are specific for Ethereum
etc...
Preventing spam
Problem
Public blockchain : if anyone can deploy and run contracts - it gets
overloaded
Solution
Use a anti-spam payment token : Gas
Gas
Every instruction in the EVM uses up gas
- Gas is bought using Ether by the caller to fuel the EVM.
- There is a (dynamic) gasprice ( ETH / gas )
- You set a gas limit per transaction to avoid draining the caller’s account
- When the execution of the contract ends within the gas limit , the new
state is saved on the blockchain and the leftover gas is refunded.
Gas
Gas
When the EVM instance runs out of gas , the execution stops and no state changes
are saved on the blockchain.
What do we need ?
- A running Ethereum node to connect to the blockchain ( JSON/RPC interface)
- A client library (Web3) for talking to the JSON/RPC interface
- A wallet (lightwallet) to sign transactions
- A smart contract ( logic + storage )
- A frontend ( Dapp ) for interacting with the smart contract.
Ethereum node
There are several options :
Test on a real blockchain
- Ethereum has a public testnet to test your Dapp (‘morden’)
- run a local testnet node on your development machine ( geth ) or in the cloud
Simulating
- Use a transaction+API simulator e.g.
ethereumjs-testrpc
https://github.com/ethereumjs/testrpc
Web3 client library
https://github.com/ethereum/web3.js/
Lightwallet
https://github.com/ConsenSys/eth-lightwallet
Allows signing of transactions on the client / in the browser
A Smart contract
To create the EVM bytecode - we use a special programming language called
Solidity
and we need a compiler that converts out solidity files into EVM bytecode for us.
Compile solidity files in an online editor
https://ethereum.github.io/browser-solidity
Compile solidity files using Truffle
https://truffle.readthedocs.io/en/latest/
Compile your files using a Gulp-task
var solc = require('solc');
Example : Macaulay’s allowance
As a parent you want to give a weekly allowance to your kid - which your kid can
claim once every week.
We will create a contract that :
- Holds the allowance funds
- Allows the parent to define the kid’s wallet account (recepient of the funds)
- Allows the kid to periodically claim funds out of the allowance contract.
Create the contract
→ See example...
Creating the Dapp
We will use Polymer to create a quick app
we want to be able to
- As a parent : deploy a new contract and set the rules for our kid’s allowance
- As a kid : be able to get the allowance
Create a few Polymer components
- yo polymer → Scaffold out the base app
- bower install web3-wallet → add web3-wallet component
- yo polymer:el allowance-wallet → visualize your wallet & show balance
- yo polymer:el allowance-create → create a new allowance contract
- yo polymer:el allowance-claim → extract funds from the contract
Deploy and test the app
Only deploy the HTML/js files
There is no central backend server
Hosting can also be decentral ( IPFS : Interplanetary File System )
→ Demo time !
Thats it!
Get the code here : https://github.com/sponnet/allowance
DAO initiatives
If you like this & want to learn more and put it into practice :
We are rolling out several DAO’s ( https://www.ethereum.org/dao ) in which you can
participate immediately as
- developer
- curator
- investor
- marketing ...
e.g. decentralized video platform ( blocktu.be ) / a product DAO ( KimRadio ) / and a
blockchain expert group DAO
Next meetups
Starting in september we will host 1 meetup per month like this one
And every week we’ll be organizing free open-table discussions here at BIA.
Join our group to recieve updates: http://www.meetup.com/API-Craftsmanship/
Hope to see you soon !
@sponnet - stefaan@ponnet.com - https://www.linkedin.com/in/sponnet

More Related Content

What's hot

Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3Gene Leybzon
 
OpenZeppelin + Remix + BNB smart chain
OpenZeppelin + Remix + BNB smart chainOpenZeppelin + Remix + BNB smart chain
OpenZeppelin + Remix + BNB smart chainGene Leybzon
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Zvi Avraham
 
Blockchain for Developers
Blockchain for DevelopersBlockchain for Developers
Blockchain for DevelopersShimi Bandiel
 
Java and the blockchain - introducing web3j
Java and the blockchain - introducing web3jJava and the blockchain - introducing web3j
Java and the blockchain - introducing web3jConor Svensson
 
Technical Overview of Tezos
Technical Overview of TezosTechnical Overview of Tezos
Technical Overview of TezosTinaBregovi
 
Intro to smart contract on blockchain en
Intro to smart contract on blockchain enIntro to smart contract on blockchain en
Intro to smart contract on blockchain enNicholas Lin
 
Front-End Development for dApps on Tezos
Front-End Development for dApps on TezosFront-End Development for dApps on Tezos
Front-End Development for dApps on TezosNeven6
 
Academic Ethereum
Academic EthereumAcademic Ethereum
Academic Ethereumgavofyork
 
gething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientgething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientSathish VJ
 
Ethereum under the Hood, intro for developers as preparation for Blockchain H...
Ethereum under the Hood, intro for developers as preparation for Blockchain H...Ethereum under the Hood, intro for developers as preparation for Blockchain H...
Ethereum under the Hood, intro for developers as preparation for Blockchain H...Pascal Van Hecke
 
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsEclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsMatthias Zimmermann
 
Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain Conor Svensson
 
Ethereum Web3.js - Some tips for the developer
Ethereum Web3.js - Some  tips  for  the developer Ethereum Web3.js - Some  tips  for  the developer
Ethereum Web3.js - Some tips for the developer 炫成 林
 

What's hot (20)

Mist and parity
Mist and parityMist and parity
Mist and parity
 
Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3
 
OpenZeppelin + Remix + BNB smart chain
OpenZeppelin + Remix + BNB smart chainOpenZeppelin + Remix + BNB smart chain
OpenZeppelin + Remix + BNB smart chain
 
Ethereum bxl
Ethereum bxlEthereum bxl
Ethereum bxl
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
 
Blockchain for Developers
Blockchain for DevelopersBlockchain for Developers
Blockchain for Developers
 
Java and the blockchain - introducing web3j
Java and the blockchain - introducing web3jJava and the blockchain - introducing web3j
Java and the blockchain - introducing web3j
 
Technical Overview of Tezos
Technical Overview of TezosTechnical Overview of Tezos
Technical Overview of Tezos
 
Introduction solidity
Introduction solidityIntroduction solidity
Introduction solidity
 
Intro to smart contract on blockchain en
Intro to smart contract on blockchain enIntro to smart contract on blockchain en
Intro to smart contract on blockchain en
 
Front-End Development for dApps on Tezos
Front-End Development for dApps on TezosFront-End Development for dApps on Tezos
Front-End Development for dApps on Tezos
 
Academic Ethereum
Academic EthereumAcademic Ethereum
Academic Ethereum
 
gething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientgething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang client
 
Ethereum under the Hood, intro for developers as preparation for Blockchain H...
Ethereum under the Hood, intro for developers as preparation for Blockchain H...Ethereum under the Hood, intro for developers as preparation for Blockchain H...
Ethereum under the Hood, intro for developers as preparation for Blockchain H...
 
web3j Overview
web3j Overviewweb3j Overview
web3j Overview
 
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsEclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
 
Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain
 
Ethereum Web3.js - Some tips for the developer
Ethereum Web3.js - Some  tips  for  the developer Ethereum Web3.js - Some  tips  for  the developer
Ethereum Web3.js - Some tips for the developer
 
Writing smart contracts
Writing smart contractsWriting smart contracts
Writing smart contracts
 
Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum) Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum)
 

Viewers also liked

Blockchain: The Information Technology of the Future
Blockchain: The Information Technology of the FutureBlockchain: The Information Technology of the Future
Blockchain: The Information Technology of the FutureMelanie Swan
 
Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial ENNicholas Lin
 
September Ethereum Berlin Workshop
September Ethereum Berlin WorkshopSeptember Ethereum Berlin Workshop
September Ethereum Berlin Workshopaeronbuchanan
 
The Distributed Ledger Landscape
The Distributed Ledger LandscapeThe Distributed Ledger Landscape
The Distributed Ledger LandscapeTim Swanson
 
Etherem ~ agvm
Etherem ~ agvmEtherem ~ agvm
Etherem ~ agvmgha sshee
 
Dapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen TechmeetupDapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen TechmeetupJames Littlejohn
 
日本のIT市場のトピックス
日本のIT市場のトピックス日本のIT市場のトピックス
日本のIT市場のトピックスHiroyasu NOHATA
 
Vision for a health blockchain
Vision for a health blockchainVision for a health blockchain
Vision for a health blockchainJames Littlejohn
 
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter..."Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...Khaled Ben Driss
 
Etherisc Versicherung neu erfinden
Etherisc Versicherung neu erfindenEtherisc Versicherung neu erfinden
Etherisc Versicherung neu erfindenStephan Karpischek
 
The Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: MixThe Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: Mixgavofyork
 
NodeJS Blockchain.info Wallet
NodeJS Blockchain.info WalletNodeJS Blockchain.info Wallet
NodeJS Blockchain.info WalletSjors Provoost
 
State of wifi_2016
State of wifi_2016State of wifi_2016
State of wifi_2016antitree
 

Viewers also liked (18)

Blockchain: The Information Technology of the Future
Blockchain: The Information Technology of the FutureBlockchain: The Information Technology of the Future
Blockchain: The Information Technology of the Future
 
Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial EN
 
September Ethereum Berlin Workshop
September Ethereum Berlin WorkshopSeptember Ethereum Berlin Workshop
September Ethereum Berlin Workshop
 
The Distributed Ledger Landscape
The Distributed Ledger LandscapeThe Distributed Ledger Landscape
The Distributed Ledger Landscape
 
Presentation des contrats
Presentation des contratsPresentation des contrats
Presentation des contrats
 
Etherem ~ agvm
Etherem ~ agvmEtherem ~ agvm
Etherem ~ agvm
 
Dapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen TechmeetupDapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen Techmeetup
 
Ethereum @ descon 2016
Ethereum @ descon 2016Ethereum @ descon 2016
Ethereum @ descon 2016
 
日本のIT市場のトピックス
日本のIT市場のトピックス日本のIT市場のトピックス
日本のIT市場のトピックス
 
Vision for a health blockchain
Vision for a health blockchainVision for a health blockchain
Vision for a health blockchain
 
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter..."Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
 
Introduction to Idea
Introduction to IdeaIntroduction to Idea
Introduction to Idea
 
Solidity intro
Solidity introSolidity intro
Solidity intro
 
Etherisc Versicherung neu erfinden
Etherisc Versicherung neu erfindenEtherisc Versicherung neu erfinden
Etherisc Versicherung neu erfinden
 
The Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: MixThe Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: Mix
 
NodeJS Blockchain.info Wallet
NodeJS Blockchain.info WalletNodeJS Blockchain.info Wallet
NodeJS Blockchain.info Wallet
 
The future of Blockchain
The future of BlockchainThe future of Blockchain
The future of Blockchain
 
State of wifi_2016
State of wifi_2016State of wifi_2016
State of wifi_2016
 

Similar to Ingredients for creating dapps

Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1KlaraOrban
 
leewayhertz.com-How to build a dApp on Avalanche blockchain
leewayhertz.com-How to build a dApp on Avalanche blockchainleewayhertz.com-How to build a dApp on Avalanche blockchain
leewayhertz.com-How to build a dApp on Avalanche blockchainMdSaifulIslam289
 
The JavaScript toolset for development on Ethereum
The JavaScript toolset for development on EthereumThe JavaScript toolset for development on Ethereum
The JavaScript toolset for development on EthereumGreeceJS
 
Blockchain Development
Blockchain DevelopmentBlockchain Development
Blockchain Developmentpreetikumara
 
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!
 
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
 
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 stackAll Things Open
 
Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Tomoaki Sato
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshellDaniel Chan
 
Build your own Blockchain with the right tool for your application
Build your own Blockchain with the right tool for your applicationBuild your own Blockchain with the right tool for your application
Build your own Blockchain with the right tool for your applicationAnthony Chow
 
The Decentralized Developer Toolbox by Petros Ring
The Decentralized Developer Toolbox by Petros RingThe Decentralized Developer Toolbox by Petros Ring
The Decentralized Developer Toolbox by Petros RingBlock 16
 
Ethereummeetuppresentation01 170105172132
Ethereummeetuppresentation01 170105172132Ethereummeetuppresentation01 170105172132
Ethereummeetuppresentation01 170105172132Rihazudin Razik MBCS
 
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 ContractAll Things Open
 
Developing Blockchain Applications
Developing Blockchain Applications Developing Blockchain Applications
Developing Blockchain Applications malikmayank
 
Write Smart Contracts with Truffle Framework
Write Smart Contracts with Truffle FrameworkWrite Smart Contracts with Truffle Framework
Write Smart Contracts with Truffle FrameworkShun Shiku
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxWijdenBenothmen1
 
Understanding blockchain
Understanding blockchainUnderstanding blockchain
Understanding blockchainPriyab Satoshi
 

Similar to Ingredients for creating dapps (20)

Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1
 
leewayhertz.com-How to build a dApp on Avalanche blockchain
leewayhertz.com-How to build a dApp on Avalanche blockchainleewayhertz.com-How to build a dApp on Avalanche blockchain
leewayhertz.com-How to build a dApp on Avalanche blockchain
 
The JavaScript toolset for development on Ethereum
The JavaScript toolset for development on EthereumThe JavaScript toolset for development on Ethereum
The JavaScript toolset for development on Ethereum
 
Dapps 101
Dapps 101Dapps 101
Dapps 101
 
Blockchain Development
Blockchain DevelopmentBlockchain Development
Blockchain Development
 
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...
 
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
 
Ethereum
EthereumEthereum
Ethereum
 
BlockChain Public
BlockChain PublicBlockChain Public
BlockChain Public
 
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
 
Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshell
 
Build your own Blockchain with the right tool for your application
Build your own Blockchain with the right tool for your applicationBuild your own Blockchain with the right tool for your application
Build your own Blockchain with the right tool for your application
 
The Decentralized Developer Toolbox by Petros Ring
The Decentralized Developer Toolbox by Petros RingThe Decentralized Developer Toolbox by Petros Ring
The Decentralized Developer Toolbox by Petros Ring
 
Ethereummeetuppresentation01 170105172132
Ethereummeetuppresentation01 170105172132Ethereummeetuppresentation01 170105172132
Ethereummeetuppresentation01 170105172132
 
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
 
Developing Blockchain Applications
Developing Blockchain Applications Developing Blockchain Applications
Developing Blockchain Applications
 
Write Smart Contracts with Truffle Framework
Write Smart Contracts with Truffle FrameworkWrite Smart Contracts with Truffle Framework
Write Smart Contracts with Truffle Framework
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptx
 
Understanding blockchain
Understanding blockchainUnderstanding blockchain
Understanding blockchain
 

Recently uploaded

FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607dollysharma2066
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts servicesonalikaur4
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 

Recently uploaded (20)

FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
 
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Porur Phone 🍆 8250192130 👅 celebrity escorts service
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 

Ingredients for creating dapps

  • 1. Ingredients for creating Dapps by stefaan ponnet API Craftsmanship Meetup aug 11 2016
  • 2. The basics: Ethereum as a smart contract platform Blockchain Nodes and mining Transactions EVM Smart Contracts
  • 3. Ethereum accounts : EOA and Contract accounts Regular Accounts : ( EOA : Externally Owned Accounts ) - consist of a public / private keypair - controlled by a human - or whoever holds the private key Contract account: - contains the EVM code + the storage ( = smart contract ) - smart contracts are executed by an EOA ( an EOA starts a transaction )
  • 4. The Ethereum Virtual Machine ( EVM ) - Place where Smart Contracts run on the Ethereum blockchain - Ethereum is “Turing complete”. -> You can run any sort of application on Ethereum - the “distributed world computer” - Dapp: Decentralized Application
  • 5. EVM and the Ethereum nodes - every Ethereum node runs instances of the EVM - maintain state and transaction consensus across the blockchain - contract code gets executed on every node It is not efficient in terms of computing power , but gives: - extreme levels of fault tolerance - ensures zero downtime - makes data stored on the blockchain forever unchangeable and censorship-resistant.
  • 6. 3 types of instructions in the EVM 1. Create new Smart Contracts ( programs on the blockchain ) 2. Execute functions of a specific smart contract 3. Transfer Ether
  • 7. EVM opcodes are specific for Ethereum etc...
  • 8. Preventing spam Problem Public blockchain : if anyone can deploy and run contracts - it gets overloaded Solution Use a anti-spam payment token : Gas
  • 9. Gas Every instruction in the EVM uses up gas
  • 10. - Gas is bought using Ether by the caller to fuel the EVM. - There is a (dynamic) gasprice ( ETH / gas ) - You set a gas limit per transaction to avoid draining the caller’s account - When the execution of the contract ends within the gas limit , the new state is saved on the blockchain and the leftover gas is refunded. Gas
  • 11. Gas When the EVM instance runs out of gas , the execution stops and no state changes are saved on the blockchain.
  • 12. What do we need ? - A running Ethereum node to connect to the blockchain ( JSON/RPC interface) - A client library (Web3) for talking to the JSON/RPC interface - A wallet (lightwallet) to sign transactions - A smart contract ( logic + storage ) - A frontend ( Dapp ) for interacting with the smart contract.
  • 13. Ethereum node There are several options : Test on a real blockchain - Ethereum has a public testnet to test your Dapp (‘morden’) - run a local testnet node on your development machine ( geth ) or in the cloud Simulating - Use a transaction+API simulator e.g. ethereumjs-testrpc https://github.com/ethereumjs/testrpc
  • 16. A Smart contract To create the EVM bytecode - we use a special programming language called Solidity and we need a compiler that converts out solidity files into EVM bytecode for us.
  • 17. Compile solidity files in an online editor https://ethereum.github.io/browser-solidity
  • 18. Compile solidity files using Truffle https://truffle.readthedocs.io/en/latest/
  • 19. Compile your files using a Gulp-task var solc = require('solc');
  • 20. Example : Macaulay’s allowance As a parent you want to give a weekly allowance to your kid - which your kid can claim once every week. We will create a contract that : - Holds the allowance funds - Allows the parent to define the kid’s wallet account (recepient of the funds) - Allows the kid to periodically claim funds out of the allowance contract.
  • 21. Create the contract → See example...
  • 22. Creating the Dapp We will use Polymer to create a quick app we want to be able to - As a parent : deploy a new contract and set the rules for our kid’s allowance - As a kid : be able to get the allowance
  • 23. Create a few Polymer components - yo polymer → Scaffold out the base app - bower install web3-wallet → add web3-wallet component - yo polymer:el allowance-wallet → visualize your wallet & show balance - yo polymer:el allowance-create → create a new allowance contract - yo polymer:el allowance-claim → extract funds from the contract
  • 24. Deploy and test the app Only deploy the HTML/js files There is no central backend server Hosting can also be decentral ( IPFS : Interplanetary File System ) → Demo time !
  • 25. Thats it! Get the code here : https://github.com/sponnet/allowance
  • 26. DAO initiatives If you like this & want to learn more and put it into practice : We are rolling out several DAO’s ( https://www.ethereum.org/dao ) in which you can participate immediately as - developer - curator - investor - marketing ... e.g. decentralized video platform ( blocktu.be ) / a product DAO ( KimRadio ) / and a blockchain expert group DAO
  • 27. Next meetups Starting in september we will host 1 meetup per month like this one And every week we’ll be organizing free open-table discussions here at BIA. Join our group to recieve updates: http://www.meetup.com/API-Craftsmanship/ Hope to see you soon ! @sponnet - stefaan@ponnet.com - https://www.linkedin.com/in/sponnet