SlideShare a Scribd company logo
1 of 36
THE ETHEREUM BLOCKCHAIN
INTRODUCTION TO SMART CONTRACTS AND DECENTRALIZED
APPLICATIONS
Alessandro Sanino
University of Turin
Computer Science Departmen
AGENDA
• The Ethereum Blockchain
• Setting up a node
• Introduction to Solidity
• The OpenZeppelin framework
AGENDA
• The Truffle Suite
• Deployment of a Smart Contract on local environment
• Testing Smart Contracts
• From test to mainnet
• DApps development principles
THE ETHEREUM BLOCKCHAIN
THE ETHEREUM BLOCKCHAIN
• Same high level architecture as Bitcoin or other Blockchains
• PoW consensus model
• Miners set up a gas price and gas limit to choose which tx to
mine
THE ETHEREUM BLOCKCHAIN
There is one main difference:
Transactions can also trigger computer code execution, which is
stored to correspond a certain address.
THE ETHEREUM BLOCKCHAIN
Transactions can also trigger computer code execution, which is
stored to correspond a certain address
The so-called SMART CONTRACTS, can be triggered by querying
any node on the network via CALL statements or TRANSACTIONS
SMART CONTRACTS 101
• When validating a state change on the smart contract, every
node in the network computes indipendently the result
• Decentralized computing
• Non Censorable
• 100% uptime
• Tamper-evident, therefore extremely difficult to corrupt
SETTING UP A NODE
HOW TO SET UP AN ETHEREUM BLOCKCHAIN DIFFERENT KINDS OF
NODES
SETTING UP A NODE
• Light node
• Full node
• Archival node
FULL NODE
• Standard node
• Full blockchain sync
• Needs a more than average grade machine to sync properly
LIGHT NODE
• Lightweight version of the full node
• Syncs only block headers, therefore needs a full node to check
and verify txs
• Can run on almost every device, minimal space requirements
ARCHIVAL NODE
• Big Scary Node ~ Vitalik Buterin
• Downloads all the intermediate states of the blockchain
• Huge requirements (2TB+ SSD and high computation power)
SUPER QUICK DEMO
THE SOLIDITY LANGUAGE
INTRODUCTION TO SMART CONTRACTS PROGRAMMING
SOLIDITY
• Language to build smart contracts
• JS-like syntax
• Most popular solution
SOLIDITY
Solidity supports a lot of native types, like addresses, uints,
strings, arrays, structs and fixed-size bytes arrays.
Supports for constructs to gather blockchain data: block, tx, msg
Supports multiple inheritance
BLOCK
Contains useful data like:
• timestamp
• number (or height)
• coinbase
• difficulty
• gas limit
TRANSACTION (TX)
Contains current transaction data, like:
• origin
• gas price
MESSAGE (MSG)
Contains specific data of the transaction or the call:
• sender
• Value in wei
• Additional custom metadata
OTHER SOLIDITY GLOBALS
Time units : (seconds, minutes, hours, days, weeks, now)
Ether units:
• wei = 1
• szabo = 10^12
• finney = 10^15
• ether = 10^18
HANDLING ERRORS
Solidity has specific functions to handle failure cases:
• throw
• assert
• require
ADDITIONAL GOTCHAS
• Memory VS Storage variable location
• Stack is limited !!!
• Every transaction has a cost
• Only tx mutates the contract state (and append to the
blockchain)
• Call operations (read) are free
• Big Contract = Bigger deploy costs
JUST AN EXAMPLE
THE OPENZEPPELIN FRAMEWORK
OPENZEPPELIN
A framework by the zeppelin foundation, it contains smart
contracts which have already been audited by professionals and
implement most used use cases (e.g. Tokens, Crowdsales, etc…)
https://github.com/OpenZeppelin/openzeppelin-solidity
ERC20 TOKEN WITH ZEPPELIN
BREAK TIME
THE TRUFFLE SUITE
THE TRUFFLE SUITE
A complete set of frameworks to develop smart contracts
• Truffle
• Ganache
• Smart Contracts Package Manager (EthPM)
TRUFFLE
It is used to develop smart contracts thanks to an easy to use CLI
interface
You just develop your contracts and use it to compile, migrate
and test.
Based on Web3JS and Javascript ES6
GANACHE
A private Ethereum network deployed on your local machine, it
has all the settings customizable via a beautiful UI
ETHEREUM PACKAGE MANAGER (ETHPM)
• Like npm but on the Ethereum blockchain
• Contains a lot of Solidity prebuilt contract packages
DEMO TIME
CONCLUSIONS
THANK YOU

More Related Content

What's hot

ERC20 Step-by-Step - Creating Your First Ethereum Token
ERC20 Step-by-Step - Creating Your First Ethereum TokenERC20 Step-by-Step - Creating Your First Ethereum Token
ERC20 Step-by-Step - Creating Your First Ethereum TokenCodeOps Technologies LLP
 
OpenZeppelin + Remix + BNB smart chain
OpenZeppelin + Remix + BNB smart chainOpenZeppelin + Remix + BNB smart chain
OpenZeppelin + Remix + BNB smart chainGene Leybzon
 
Decentralized Autonomous Organizations: Concept & Practical Examples
Decentralized Autonomous Organizations: Concept & Practical ExamplesDecentralized Autonomous Organizations: Concept & Practical Examples
Decentralized Autonomous Organizations: Concept & Practical ExamplesJan Brejcha
 
Overview of Blockchain Consensus Mechanisms
Overview of Blockchain Consensus MechanismsOverview of Blockchain Consensus Mechanisms
Overview of Blockchain Consensus MechanismsJohannes Ahlmann
 
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018Svetlin Nakov
 
Blockchain Security and Privacy
Blockchain Security and PrivacyBlockchain Security and Privacy
Blockchain Security and PrivacyAnil John
 
Write smart contract with solidity on Ethereum
Write smart contract with solidity on EthereumWrite smart contract with solidity on Ethereum
Write smart contract with solidity on EthereumMurughan Palaniachari
 
Introduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractIntroduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractThanh Nguyen
 
Consensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisConsensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisZak Cole
 
Paxos and Raft Distributed Consensus Algorithm
Paxos and Raft Distributed Consensus AlgorithmPaxos and Raft Distributed Consensus Algorithm
Paxos and Raft Distributed Consensus Algorithm宇 傅
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to EthereumTerek Judi
 
Blockchain consensus algorithms
Blockchain consensus algorithmsBlockchain consensus algorithms
Blockchain consensus algorithmsAnurag Dashputre
 
PoW vs. PoS - Key Differences
PoW vs. PoS - Key DifferencesPoW vs. PoS - Key Differences
PoW vs. PoS - Key Differences101 Blockchains
 
Blockchain 101 by imran bashir
Blockchain 101  by imran bashirBlockchain 101  by imran bashir
Blockchain 101 by imran bashirImran Bashir
 
Consensus Algorithms.pptx
Consensus Algorithms.pptxConsensus Algorithms.pptx
Consensus Algorithms.pptxRajapriya82
 
Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20Truong Nguyen
 

What's hot (20)

ERC20 Step-by-Step - Creating Your First Ethereum Token
ERC20 Step-by-Step - Creating Your First Ethereum TokenERC20 Step-by-Step - Creating Your First Ethereum Token
ERC20 Step-by-Step - Creating Your First Ethereum Token
 
OpenZeppelin + Remix + BNB smart chain
OpenZeppelin + Remix + BNB smart chainOpenZeppelin + Remix + BNB smart chain
OpenZeppelin + Remix + BNB smart chain
 
Blockchain concepts
Blockchain conceptsBlockchain concepts
Blockchain concepts
 
Decentralized Autonomous Organizations: Concept & Practical Examples
Decentralized Autonomous Organizations: Concept & Practical ExamplesDecentralized Autonomous Organizations: Concept & Practical Examples
Decentralized Autonomous Organizations: Concept & Practical Examples
 
Overview of Blockchain Consensus Mechanisms
Overview of Blockchain Consensus MechanismsOverview of Blockchain Consensus Mechanisms
Overview of Blockchain Consensus Mechanisms
 
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
 
Blockchain Security and Privacy
Blockchain Security and PrivacyBlockchain Security and Privacy
Blockchain Security and Privacy
 
Write smart contract with solidity on Ethereum
Write smart contract with solidity on EthereumWrite smart contract with solidity on Ethereum
Write smart contract with solidity on Ethereum
 
Introduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractIntroduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart Contract
 
Consensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisConsensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & Analysis
 
Ethereum
EthereumEthereum
Ethereum
 
Paxos and Raft Distributed Consensus Algorithm
Paxos and Raft Distributed Consensus AlgorithmPaxos and Raft Distributed Consensus Algorithm
Paxos and Raft Distributed Consensus Algorithm
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to Ethereum
 
Blockchain consensus algorithms
Blockchain consensus algorithmsBlockchain consensus algorithms
Blockchain consensus algorithms
 
PoW vs. PoS - Key Differences
PoW vs. PoS - Key DifferencesPoW vs. PoS - Key Differences
PoW vs. PoS - Key Differences
 
What the Duck is DeFi
What the Duck is DeFiWhat the Duck is DeFi
What the Duck is DeFi
 
Blockchain 101 by imran bashir
Blockchain 101  by imran bashirBlockchain 101  by imran bashir
Blockchain 101 by imran bashir
 
Consensus Algorithms.pptx
Consensus Algorithms.pptxConsensus Algorithms.pptx
Consensus Algorithms.pptx
 
Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20
 
Ethereum 2.0
Ethereum 2.0Ethereum 2.0
Ethereum 2.0
 

Similar to The Ethereum Blockchain - Introduction to Smart Contracts and Decentralized Applications

Advanced Blockchain Technologies on Privacy & Scalability (All Things Open)
Advanced Blockchain Technologies on Privacy & Scalability (All Things Open) Advanced Blockchain Technologies on Privacy & Scalability (All Things Open)
Advanced Blockchain Technologies on Privacy & Scalability (All Things Open) Kaleido
 
Building Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractBuilding Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractVaideeswaran Sethuraman
 
Advanced Blockchain Technologies on Privacy and Scalability
Advanced Blockchain Technologies on Privacy and ScalabilityAdvanced Blockchain Technologies on Privacy and Scalability
Advanced Blockchain Technologies on Privacy and ScalabilityAll Things Open
 
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
 
Ethereum for developer 16th Nov 2018
Ethereum for developer 16th Nov 2018Ethereum for developer 16th Nov 2018
Ethereum for developer 16th Nov 2018Hu Kenneth
 
Blockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdfBlockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdfadinugroho751867
 
Blockchain workshop 101
Blockchain workshop 101Blockchain workshop 101
Blockchain workshop 101Karthikeyan VK
 
Resource slides for blockchain related question
Resource slides for blockchain related questionResource slides for blockchain related question
Resource slides for blockchain related questionLin Lin (Wendy)
 
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
 
Analysing Data from Blockchains - Keynote @ SOCCA 2020
Analysing Data from Blockchains - Keynote @ SOCCA 2020Analysing Data from Blockchains - Keynote @ SOCCA 2020
Analysing Data from Blockchains - Keynote @ SOCCA 2020Ingo Weber
 
Introducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
Introducing Moonbeam: A Smart Contract Parachain with Ethereum CompatibilityIntroducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
Introducing Moonbeam: A Smart Contract Parachain with Ethereum CompatibilityPureStake
 
Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Tomoaki Sato
 
Blockchain Technology: Adoption Challenges, Platform and Applications
Blockchain Technology: Adoption Challenges, Platform and ApplicationsBlockchain Technology: Adoption Challenges, Platform and Applications
Blockchain Technology: Adoption Challenges, Platform and ApplicationsSanjeev Verma, PhD
 
Blockchain Technology: Adoption Challenges, Platform and Applications
Blockchain Technology: Adoption Challenges, Platform and ApplicationsBlockchain Technology: Adoption Challenges, Platform and Applications
Blockchain Technology: Adoption Challenges, Platform and ApplicationsSanjeev Verma, PhD
 

Similar to The Ethereum Blockchain - Introduction to Smart Contracts and Decentralized Applications (20)

Block chain
Block chainBlock chain
Block chain
 
Advanced Blockchain Technologies on Privacy & Scalability (All Things Open)
Advanced Blockchain Technologies on Privacy & Scalability (All Things Open) Advanced Blockchain Technologies on Privacy & Scalability (All Things Open)
Advanced Blockchain Technologies on Privacy & Scalability (All Things Open)
 
Building Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractBuilding Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart Contract
 
Ethereum
EthereumEthereum
Ethereum
 
Advanced Blockchain Technologies on Privacy and Scalability
Advanced Blockchain Technologies on Privacy and ScalabilityAdvanced Blockchain Technologies on Privacy and Scalability
Advanced Blockchain Technologies on Privacy and Scalability
 
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
 
Ethereum Development Tools
Ethereum Development ToolsEthereum Development Tools
Ethereum Development Tools
 
Ethereum for developer 16th Nov 2018
Ethereum for developer 16th Nov 2018Ethereum for developer 16th Nov 2018
Ethereum for developer 16th Nov 2018
 
Ethereum bxl
Ethereum bxlEthereum bxl
Ethereum bxl
 
Blockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdfBlockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdf
 
Blockchain workshop 101
Blockchain workshop 101Blockchain workshop 101
Blockchain workshop 101
 
Resource slides for blockchain related question
Resource slides for blockchain related questionResource slides for blockchain related question
Resource slides for blockchain related question
 
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
 
Analysing Data from Blockchains - Keynote @ SOCCA 2020
Analysing Data from Blockchains - Keynote @ SOCCA 2020Analysing Data from Blockchains - Keynote @ SOCCA 2020
Analysing Data from Blockchains - Keynote @ SOCCA 2020
 
Introducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
Introducing Moonbeam: A Smart Contract Parachain with Ethereum CompatibilityIntroducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
Introducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
 
Etherium Intro for techies
Etherium Intro for techiesEtherium Intro for techies
Etherium Intro for techies
 
Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)
 
Blockchain Technology: Adoption Challenges, Platform and Applications
Blockchain Technology: Adoption Challenges, Platform and ApplicationsBlockchain Technology: Adoption Challenges, Platform and Applications
Blockchain Technology: Adoption Challenges, Platform and Applications
 
Blockchain Technology: Adoption Challenges, Platform and Applications
Blockchain Technology: Adoption Challenges, Platform and ApplicationsBlockchain Technology: Adoption Challenges, Platform and Applications
Blockchain Technology: Adoption Challenges, Platform and Applications
 
IM 02.pptx
IM 02.pptxIM 02.pptx
IM 02.pptx
 

Recently uploaded

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 

Recently uploaded (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 

The Ethereum Blockchain - Introduction to Smart Contracts and Decentralized Applications

  • 1. THE ETHEREUM BLOCKCHAIN INTRODUCTION TO SMART CONTRACTS AND DECENTRALIZED APPLICATIONS Alessandro Sanino University of Turin Computer Science Departmen
  • 2. AGENDA • The Ethereum Blockchain • Setting up a node • Introduction to Solidity • The OpenZeppelin framework
  • 3. AGENDA • The Truffle Suite • Deployment of a Smart Contract on local environment • Testing Smart Contracts • From test to mainnet • DApps development principles
  • 5. THE ETHEREUM BLOCKCHAIN • Same high level architecture as Bitcoin or other Blockchains • PoW consensus model • Miners set up a gas price and gas limit to choose which tx to mine
  • 6. THE ETHEREUM BLOCKCHAIN There is one main difference: Transactions can also trigger computer code execution, which is stored to correspond a certain address.
  • 7. THE ETHEREUM BLOCKCHAIN Transactions can also trigger computer code execution, which is stored to correspond a certain address The so-called SMART CONTRACTS, can be triggered by querying any node on the network via CALL statements or TRANSACTIONS
  • 8. SMART CONTRACTS 101 • When validating a state change on the smart contract, every node in the network computes indipendently the result • Decentralized computing • Non Censorable • 100% uptime • Tamper-evident, therefore extremely difficult to corrupt
  • 9. SETTING UP A NODE HOW TO SET UP AN ETHEREUM BLOCKCHAIN DIFFERENT KINDS OF NODES
  • 10. SETTING UP A NODE • Light node • Full node • Archival node
  • 11. FULL NODE • Standard node • Full blockchain sync • Needs a more than average grade machine to sync properly
  • 12. LIGHT NODE • Lightweight version of the full node • Syncs only block headers, therefore needs a full node to check and verify txs • Can run on almost every device, minimal space requirements
  • 13. ARCHIVAL NODE • Big Scary Node ~ Vitalik Buterin • Downloads all the intermediate states of the blockchain • Huge requirements (2TB+ SSD and high computation power)
  • 15. THE SOLIDITY LANGUAGE INTRODUCTION TO SMART CONTRACTS PROGRAMMING
  • 16. SOLIDITY • Language to build smart contracts • JS-like syntax • Most popular solution
  • 17. SOLIDITY Solidity supports a lot of native types, like addresses, uints, strings, arrays, structs and fixed-size bytes arrays. Supports for constructs to gather blockchain data: block, tx, msg Supports multiple inheritance
  • 18. BLOCK Contains useful data like: • timestamp • number (or height) • coinbase • difficulty • gas limit
  • 19. TRANSACTION (TX) Contains current transaction data, like: • origin • gas price
  • 20. MESSAGE (MSG) Contains specific data of the transaction or the call: • sender • Value in wei • Additional custom metadata
  • 21. OTHER SOLIDITY GLOBALS Time units : (seconds, minutes, hours, days, weeks, now) Ether units: • wei = 1 • szabo = 10^12 • finney = 10^15 • ether = 10^18
  • 22. HANDLING ERRORS Solidity has specific functions to handle failure cases: • throw • assert • require
  • 23. ADDITIONAL GOTCHAS • Memory VS Storage variable location • Stack is limited !!! • Every transaction has a cost • Only tx mutates the contract state (and append to the blockchain) • Call operations (read) are free • Big Contract = Bigger deploy costs
  • 26. OPENZEPPELIN A framework by the zeppelin foundation, it contains smart contracts which have already been audited by professionals and implement most used use cases (e.g. Tokens, Crowdsales, etc…) https://github.com/OpenZeppelin/openzeppelin-solidity
  • 27. ERC20 TOKEN WITH ZEPPELIN
  • 30. THE TRUFFLE SUITE A complete set of frameworks to develop smart contracts • Truffle • Ganache • Smart Contracts Package Manager (EthPM)
  • 31. TRUFFLE It is used to develop smart contracts thanks to an easy to use CLI interface You just develop your contracts and use it to compile, migrate and test. Based on Web3JS and Javascript ES6
  • 32. GANACHE A private Ethereum network deployed on your local machine, it has all the settings customizable via a beautiful UI
  • 33. ETHEREUM PACKAGE MANAGER (ETHPM) • Like npm but on the Ethereum blockchain • Contains a lot of Solidity prebuilt contract packages