SlideShare a Scribd company logo
1 of 22
BLOCKCHAIN AND SMART
CONTRACTS
Introduction for Software
Developers and Architects
WHY BLOCKCHAIN IS A BIG DEAL
“Bitcoin is a technological tour de force.” – Bill Gates
”I think the fact that within the bitcoin universe an algorithm replaces
the function of the government …[that] is actually pretty cool.” - Al
Gore
“[Bitcoin] is a remarkable cryptographic achievement… The ability to
create something which is not duplicable in the digital world has
enormous value…Lot’s of people will build businesses on top of that.”
- Eric Schmidt
BLOCKCHAIN IS
Ledger of facts
Ledger of facts replicated across large number of
computers
Ledger of facts replicated across large number of
computers connected as peer-to-peer network
Ledger of facts replicated across large number of
computers connected as peer-to-peer network that
implements consensus algorithm that can securely
identify sender and receiver of facts
FACTS
Monetary
transaction
Content
hash
Signature
Asset
information
Ownership
Agreement
Contract
IS IT JUST ANOTHER SHARED
DATABASE?
NOT JUST ANOTHER DATABASE
Multiple Writers
Non-trusting
writers
Disintermediation
Interaction
between
transactions
Conflict
resolution
HOW?
Blocks
Decentralized consensus
Byzantine fault tolerance.
CHAIN OF TRANSACTIONS
TIMESTAMPS
RECORDING TRANSACTION
SMART
CONTRACTS
Introduction to Smart Contracts
EXAMPLE OF A CONTRACT
EXAMPLE OF SMART CONTRACT
SMART CONTRACT USE CASES
ICO
Digital
Identity
Public
records
Securities
International
trade
Derivatives
Mortgages Land title Supply chain
HANDS-ON
INTRODUCTION
TO SMART
CONTRACTS
With Etherium and Solidity
DEVELOPING SMART CONTRACT
WITH TRUFFLE
Write Code
Create
deployment
script
Migrate/Deploy
PREREQUISITES
•$ sudo npm install -g truffle
•$ mkdir solidity-experiments
•$ cd solidity-experiments/
•$ truffle init
Truffle
Framework
•$ sudo npm install -g ethereumjs-testrpc
•$ testrpc &
Etherium
test network
•module.exports = {
• networks: {
• development: {
• host: "localhost",
• port: 8545,
• network_id: "*" // Match any network id
• }
• }
•}
Configure
truffle.js
HELLO WORLD CONTRACT
(SOLIDITY CODE)
pragma solidity ^0.4.4;
contract Hello {
function Hello() public {
// constructor
}
function sayHello() public pure returns
(string) {
//console.log("sayHello() function
called...");
return 'Hello World!';
}
}
DEPLOYMENT SCRIPT
var Hello1 =
artifacts.require("./Hello.sol");
module.exports =
function(deployer) {
deployer.deploy(Hello1);
};
CONTRACT DEPLOYMENT
$ truffle console
truffle(development)> truffle migrate --reset
Using network 'development'.
Running migration: 1_initial_migration.js
Deploying Migrations...
...
0xb6bbeaaf3649ecb38d548cba96f681682dad9e0225726924fbee3ce3
6eff94e3
Migrations: 0xc08c46796ba0edc0bebbbd0d90868c010055cb0e
Saving successful migration to network...
...
0x16fe364b9f2c3e8f07fa1ebd6b84b8ad9b4e750d8698a7e920d824eb
d019dd80
Saving artifacts...
Running migration: 2_deploy_contracts.js
Deploying Hello...
...
0xfe120836b2d7395bd988104feff018fe352f93555f71003bbf1a6467
1cca9ba1
Hello: 0x2b649a87d20ce1ac3b6a0218e911165fa0f095f0
Saving successful migration to network...
...
0x1a09073a3b3f7996f3d63a81a99d8cd09198ad7b467f35f7ddc500a
4291332b9
Saving artifacts...
truffle(development)>
CONTRACT TEST
truffle(development)> var he =
Hello.at(Hello.address)
Undefined
truffle(development)> he.sayHello()
'Hello World!'
STAY IN TOUCH
Gene Leybzon https://www.linkedin.com/in/leybzon/
https://www.meetup.com/members/90744
20/
https://www.Leybzon.com
ANNOUNCEM
ENTS
Blockchain and Crypto
"Unconference" this Sunday 1/28
from 3-5PM in room Z301 at the
GSB Stanford

More Related Content

Similar to Blockchain and Smart Contracts

Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Tomoaki Sato
 
Blockchain Essentials for Enterprise Architects
Blockchain Essentials for Enterprise ArchitectsBlockchain Essentials for Enterprise Architects
Blockchain Essentials for Enterprise ArchitectsGokul Alex
 
Silicon Valley Code Camp Blockchain Oct 2017
Silicon Valley Code Camp Blockchain Oct 2017Silicon Valley Code Camp Blockchain Oct 2017
Silicon Valley Code Camp Blockchain Oct 2017Nelson Petracek
 
Blockchain airports aviation
Blockchain airports aviationBlockchain airports aviation
Blockchain airports aviationSusan Dart
 
Introduction to Ethereum Smart Contracts
Introduction to Ethereum Smart Contracts Introduction to Ethereum Smart Contracts
Introduction to Ethereum Smart Contracts ArcBlock
 
Ethereum Blockchain and DApps - Workshop at Software University
Ethereum Blockchain and DApps  - Workshop at Software UniversityEthereum Blockchain and DApps  - Workshop at Software University
Ethereum Blockchain and DApps - Workshop at Software UniversityOpen Source University
 
A living programming environment for blockchain
A living programming environment for blockchainA living programming environment for blockchain
A living programming environment for blockchainPharo
 
A living programming environment for a living blockchain
A living programming environment for a living blockchainA living programming environment for a living blockchain
A living programming environment for a living blockchainSantiago Bragagnolo
 
Hyperledger Fabric & Composer
Hyperledger Fabric & Composer Hyperledger Fabric & Composer
Hyperledger Fabric & Composer Dr. Ketan Parmar
 
Ethereum in Enterprise.pptx
Ethereum in Enterprise.pptxEthereum in Enterprise.pptx
Ethereum in Enterprise.pptxGene Leybzon
 
Build Blockchain dApps using JavaScript, Python and C - ATO.pdf
Build Blockchain dApps using JavaScript, Python and C - ATO.pdfBuild Blockchain dApps using JavaScript, Python and C - ATO.pdf
Build Blockchain dApps using JavaScript, Python and C - ATO.pdfRussFustino
 
Introduction of Hyperledger Fabric & Composer
Introduction of Hyperledger Fabric & Composer Introduction of Hyperledger Fabric & Composer
Introduction of Hyperledger Fabric & Composer Dr. Ketan Parmar
 
Webinar - Loyalty Reward Points Using Blockchain
Webinar - Loyalty Reward Points Using BlockchainWebinar - Loyalty Reward Points Using Blockchain
Webinar - Loyalty Reward Points Using BlockchainJK Tech
 
FOSSCOM - Synaphea presentations
FOSSCOM - Synaphea presentationsFOSSCOM - Synaphea presentations
FOSSCOM - Synaphea presentationsGeorge Theofilis
 
Wwc developing hyperledger applications v4
Wwc  developing hyperledger applications v4Wwc  developing hyperledger applications v4
Wwc developing hyperledger applications v4LennartF
 
Introduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractIntroduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractThanh Nguyen
 
Algorand Technical Workshop 2021
Algorand Technical Workshop 2021Algorand Technical Workshop 2021
Algorand Technical Workshop 2021DanielBohnemann
 
Hyperledger & blockchain meetup - Milano 23.10.2019
Hyperledger & blockchain meetup - Milano 23.10.2019Hyperledger & blockchain meetup - Milano 23.10.2019
Hyperledger & blockchain meetup - Milano 23.10.2019Carlo Ferrarini
 

Similar to Blockchain and Smart Contracts (20)

Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)
 
Blockchain Essentials for Enterprise Architects
Blockchain Essentials for Enterprise ArchitectsBlockchain Essentials for Enterprise Architects
Blockchain Essentials for Enterprise Architects
 
Silicon Valley Code Camp Blockchain Oct 2017
Silicon Valley Code Camp Blockchain Oct 2017Silicon Valley Code Camp Blockchain Oct 2017
Silicon Valley Code Camp Blockchain Oct 2017
 
Blockchain airports aviation
Blockchain airports aviationBlockchain airports aviation
Blockchain airports aviation
 
Introduction to Ethereum Smart Contracts
Introduction to Ethereum Smart Contracts Introduction to Ethereum Smart Contracts
Introduction to Ethereum Smart Contracts
 
How to design, code, deploy and execute a smart contract
How to design, code, deploy and execute a smart contractHow to design, code, deploy and execute a smart contract
How to design, code, deploy and execute a smart contract
 
Ethereum Blockchain and DApps - Workshop at Software University
Ethereum Blockchain and DApps  - Workshop at Software UniversityEthereum Blockchain and DApps  - Workshop at Software University
Ethereum Blockchain and DApps - Workshop at Software University
 
A living programming environment for blockchain
A living programming environment for blockchainA living programming environment for blockchain
A living programming environment for blockchain
 
A living programming environment for a living blockchain
A living programming environment for a living blockchainA living programming environment for a living blockchain
A living programming environment for a living blockchain
 
Hyperledger Fabric & Composer
Hyperledger Fabric & Composer Hyperledger Fabric & Composer
Hyperledger Fabric & Composer
 
Ethereum in Enterprise.pptx
Ethereum in Enterprise.pptxEthereum in Enterprise.pptx
Ethereum in Enterprise.pptx
 
Build Blockchain dApps using JavaScript, Python and C - ATO.pdf
Build Blockchain dApps using JavaScript, Python and C - ATO.pdfBuild Blockchain dApps using JavaScript, Python and C - ATO.pdf
Build Blockchain dApps using JavaScript, Python and C - ATO.pdf
 
Introduction of Hyperledger Fabric & Composer
Introduction of Hyperledger Fabric & Composer Introduction of Hyperledger Fabric & Composer
Introduction of Hyperledger Fabric & Composer
 
Webinar - Loyalty Reward Points Using Blockchain
Webinar - Loyalty Reward Points Using BlockchainWebinar - Loyalty Reward Points Using Blockchain
Webinar - Loyalty Reward Points Using Blockchain
 
FOSSCOM - Synaphea presentations
FOSSCOM - Synaphea presentationsFOSSCOM - Synaphea presentations
FOSSCOM - Synaphea presentations
 
Wwc developing hyperledger applications v4
Wwc  developing hyperledger applications v4Wwc  developing hyperledger applications v4
Wwc developing hyperledger applications v4
 
Introduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractIntroduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart Contract
 
Algorand Technical Workshop 2021
Algorand Technical Workshop 2021Algorand Technical Workshop 2021
Algorand Technical Workshop 2021
 
Hyperledger & blockchain meetup - Milano 23.10.2019
Hyperledger & blockchain meetup - Milano 23.10.2019Hyperledger & blockchain meetup - Milano 23.10.2019
Hyperledger & blockchain meetup - Milano 23.10.2019
 
Blockchain on AWS
Blockchain on AWSBlockchain on AWS
Blockchain on AWS
 

Recently uploaded

247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 

Recently uploaded (20)

247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 

Blockchain and Smart Contracts

  • 1. BLOCKCHAIN AND SMART CONTRACTS Introduction for Software Developers and Architects
  • 2. WHY BLOCKCHAIN IS A BIG DEAL “Bitcoin is a technological tour de force.” – Bill Gates ”I think the fact that within the bitcoin universe an algorithm replaces the function of the government …[that] is actually pretty cool.” - Al Gore “[Bitcoin] is a remarkable cryptographic achievement… The ability to create something which is not duplicable in the digital world has enormous value…Lot’s of people will build businesses on top of that.” - Eric Schmidt
  • 3. BLOCKCHAIN IS Ledger of facts Ledger of facts replicated across large number of computers Ledger of facts replicated across large number of computers connected as peer-to-peer network Ledger of facts replicated across large number of computers connected as peer-to-peer network that implements consensus algorithm that can securely identify sender and receiver of facts FACTS Monetary transaction Content hash Signature Asset information Ownership Agreement Contract
  • 4. IS IT JUST ANOTHER SHARED DATABASE?
  • 5. NOT JUST ANOTHER DATABASE Multiple Writers Non-trusting writers Disintermediation Interaction between transactions Conflict resolution
  • 11. EXAMPLE OF A CONTRACT
  • 12. EXAMPLE OF SMART CONTRACT
  • 13. SMART CONTRACT USE CASES ICO Digital Identity Public records Securities International trade Derivatives Mortgages Land title Supply chain
  • 15. DEVELOPING SMART CONTRACT WITH TRUFFLE Write Code Create deployment script Migrate/Deploy
  • 16. PREREQUISITES •$ sudo npm install -g truffle •$ mkdir solidity-experiments •$ cd solidity-experiments/ •$ truffle init Truffle Framework •$ sudo npm install -g ethereumjs-testrpc •$ testrpc & Etherium test network •module.exports = { • networks: { • development: { • host: "localhost", • port: 8545, • network_id: "*" // Match any network id • } • } •} Configure truffle.js
  • 17. HELLO WORLD CONTRACT (SOLIDITY CODE) pragma solidity ^0.4.4; contract Hello { function Hello() public { // constructor } function sayHello() public pure returns (string) { //console.log("sayHello() function called..."); return 'Hello World!'; } }
  • 18. DEPLOYMENT SCRIPT var Hello1 = artifacts.require("./Hello.sol"); module.exports = function(deployer) { deployer.deploy(Hello1); };
  • 19. CONTRACT DEPLOYMENT $ truffle console truffle(development)> truffle migrate --reset Using network 'development'. Running migration: 1_initial_migration.js Deploying Migrations... ... 0xb6bbeaaf3649ecb38d548cba96f681682dad9e0225726924fbee3ce3 6eff94e3 Migrations: 0xc08c46796ba0edc0bebbbd0d90868c010055cb0e Saving successful migration to network... ... 0x16fe364b9f2c3e8f07fa1ebd6b84b8ad9b4e750d8698a7e920d824eb d019dd80 Saving artifacts... Running migration: 2_deploy_contracts.js Deploying Hello... ... 0xfe120836b2d7395bd988104feff018fe352f93555f71003bbf1a6467 1cca9ba1 Hello: 0x2b649a87d20ce1ac3b6a0218e911165fa0f095f0 Saving successful migration to network... ... 0x1a09073a3b3f7996f3d63a81a99d8cd09198ad7b467f35f7ddc500a 4291332b9 Saving artifacts... truffle(development)>
  • 20. CONTRACT TEST truffle(development)> var he = Hello.at(Hello.address) Undefined truffle(development)> he.sayHello() 'Hello World!'
  • 21. STAY IN TOUCH Gene Leybzon https://www.linkedin.com/in/leybzon/ https://www.meetup.com/members/90744 20/ https://www.Leybzon.com
  • 22. ANNOUNCEM ENTS Blockchain and Crypto "Unconference" this Sunday 1/28 from 3-5PM in room Z301 at the GSB Stanford

Editor's Notes

  1. Image from http://techatlast.com/wp-content/uploads/2017/08/How-blockchain-technology-works.png
  2. Image from https://commons.wikimedia.org/wiki/File:Smart_contracts_in_insurance_policies.png
  3. http://leybzon.blogspot.com/2018/01/hello-world-from-solidity.html
  4. http://leybzon.blogspot.com/2018/01/hello-world-from-solidity.html
  5. http://leybzon.blogspot.com/2018/01/hello-world-from-solidity.html
  6. http://leybzon.blogspot.com/2018/01/hello-world-from-solidity.html