SlideShare a Scribd company logo
1 of 44
Download to read offline
O C T O B E R 2 7 , 2 0 1 7
C O N F I D E N T I A L
Node.js and Blockchain
Building the Web 3.0 with Node.js
October 27, 2017
Julián Duque
Developer and Educator / Community Organizer / Engineer
@julian_duque
October 27, 2017
Julián Duque
Not a Crypto Expert / Not here for Crypto Currencies (or ICOs)
@julian_duque
© 2017 NodeSource C O N F I D E N T I A L
What is Blockchain?
📦⛓
4
© 2017 NodeSource C O N F I D E N T I A L5
Hashes
hash(‘😀’) = 2a02ea…7b6
hash(‘😃’) = e36f86…028
hash(‘Hola’) = f688ae…22e
hash(‘Hola!’) = 0676dc…06f
© 2017 NodeSource C O N F I D E N T I A L6
Merkle Trees
binary hash tree
Image credit: Wikipedia
© 2017 NodeSource C O N F I D E N T I A L7
Blockchains
• Continuously growing, append only, list of records
(blocks)
• Distributed Ledger Technology (DLT)
• Linked and secured using cryptography
© 2017 NodeSource C O N F I D E N T I A L8
Blockchains
Image credit: Wikipedia
© 2017 NodeSource C O N F I D E N T I A L9
Blockchain Immutability
Image credit: edX - Hyperledger Course
© 2017 NodeSource C O N F I D E N T I A L10
Reaching Consensus
Proof of Work
• Blocks are added to the ledger gradually
• People (nodes) take turns to add blocks
• Root checksum must start with a number of zeroes (difficulty, conditions)
• Block includes a nonsense (nonce) that can be changed to create new
checksums
• Difficulty is adjusted to target desired time between blocks (control)
© 2017 NodeSource C O N F I D E N T I A L11
Reaching Consensus
Incentives
• Miner (node) who find a new block gets a reward
• Reward is used as currency and to pay transaction fees
• Miners also get transaction fees along with the reward
• Encourage miners to process blocks with transactions (Game theory)
• Encourage users to pay transaction fees depending on urgency
© 2017 NodeSource C O N F I D E N T I A L
Public vs Private
12
C O N F I D E N T I A L© 2017 NodeSource13
© 2017 NodeSource C O N F I D E N T I A L14
Bitcoin
• Crypto Currency (BTC)
• Transfer value from address to address (wallet
to wallet)
• Scripting Language - Turing-Incomplete
• Consensus Algorithm: Proof of Work
C O N F I D E N T I A L© 2017 NodeSource15
© 2017 NodeSource C O N F I D E N T I A L16
Ethereum
• Virtual Machine (EVM)
• Usage is metered by transaction fees (gas)
• Crypto Currency (ether - ETH)
• Transactions manipulate state
• EVM is Turing-Complete
• Consensus Algorithm: Proof of Work, moving to Proof
of Stake
C O N F I D E N T I A L© 2017 NodeSource17
C O N F I D E N T I A L© 2017 NodeSource18
Hyperledger
• Umbrella of Open Source projects
• Focused on Business / Permissioned Blockchains
• No crypto currency
• Consensus algorithms: Depending of Project (PoET,
PFBT)
• Some projects are EVM compatible, others have they
own VM
© 2017 NodeSource C O N F I D E N T I A L
Why Node.js?
19
© 2017 NodeSource C O N F I D E N T I A L20
Why Node.js?
• JavaScript: Language of the web
• Great for building tools
• Great as API / Frontend layer
© 2017 NodeSource C O N F I D E N T I A L
Develop Blockchain Applications
21
© 2017 NodeSource C O N F I D E N T I A L
BitcoinJS
22
© 2017 NodeSource C O N F I D E N T I A L23
BitcoinJS
https://bitcoinjs.org
• Create / Interact with Bitcoin wallets
• Transactions
• Crypto operations
© 2017 NodeSource C O N F I D E N T I A L
EthereumJS
24
© 2017 NodeSource C O N F I D E N T I A L25
EthereumJS
https://ethereumjs.github.io
• Collection of libraries and utilities for
Ethereum
• Always looking for contributors
© 2017 NodeSource C O N F I D E N T I A L
Smart Contracts
26
© 2017 NodeSource C O N F I D E N T I A L27
Smart Contracts
• Applications that can be deployed to the
Blockchain (Ethereum / Hyperledger)
• Takes care of State in Blockchain
• Defines and enforces the rules and
penalties around an agreement
© 2017 NodeSource C O N F I D E N T I A L
Solidity
28
© 2017 NodeSource C O N F I D E N T I A L29
Solidity
• High level language to build Smart
Contracts for Ethereum
• Typed Language
• Based on JavaScript
• Compiled to EVM
© 2017 NodeSource C O N F I D E N T I A L30
Solidity
pragma solidity ^0.4.11;
contract HelloWorld {
uint public balance;
address public owner;
function HelloWorld() public {
owner = msg.sender;
balance = 0;
}
function update() public payable isOwner() {
balance = msg.value;
}
modifier isOwner() {
require(msg.sender == owner);
_;
}
}
© 2017 NodeSource C O N F I D E N T I A L31
Solidity
$ npm install -g solc
© 2017 NodeSource C O N F I D E N T I A L32
© 2017 NodeSource C O N F I D E N T I A L33
Truffle
• Framework to build, test and deploy
Smart Contracts
• Test Smart Contracts with JavaScript
• Project generators for ĐApps
© 2017 NodeSource C O N F I D E N T I A L34
Truffle
$ npm install -g truffle
© 2017 NodeSource C O N F I D E N T I A L
ĐApps
35
© 2017 NodeSource C O N F I D E N T I A L36
ĐApps
https://www.stateofthedapps.com
• Web 3.0 - Decentralized Applications
• Interact with Smart Contracts using backend-
less JavaScript Applications
• Bitcoin: The first ĐApp
© 2017 NodeSource C O N F I D E N T I A L
MetaMask
37
© 2017 NodeSource C O N F I D E N T I A L38
MetaMask
https://www.metamask.io
• Brings Ethereum to your Browser
• Perfect for running ĐApps
• No need to have a full node running
© 2017 NodeSource C O N F I D E N T I A L
Hyperledger Composer
39
© 2017 NodeSource C O N F I D E N T I A L40
Hyperledger Composer
https://hyperledger.github.io/composer/
• Build private Blockchain Applications and Business Networks
• Build Smart Contracts with a model language
• Generate REST APIs
• Node.js modules (composer-client) to interact with your network
© 2017 NodeSource C O N F I D E N T I A L41
© 2017 NodeSource C O N F I D E N T I A L42
Blockstack
https://blockstack.org
• Build decentralized applications with JavaScript (BlockstackJS)
• Virtualchain: An existing Blockchain extension
© 2017 NodeSource C O N F I D E N T I A L
Demo
https://julianduque.github.io/simple-vote/
43
C O N F I D E N T I A L
Thank you!
Julián Duque
julian@nodesource.com
@julian_duque

More Related Content

Similar to Node.js and Blockchain

Get Ready for Coinbase Node
Get Ready for Coinbase NodeGet Ready for Coinbase Node
Get Ready for Coinbase NodeTinaBregovi
 
LNUG: Having Your Node.js Cake and Eating It Too
LNUG: Having Your Node.js Cake and Eating It TooLNUG: Having Your Node.js Cake and Eating It Too
LNUG: Having Your Node.js Cake and Eating It TooRob Tweed
 
Neo - Smart Economy
Neo - Smart EconomyNeo - Smart Economy
Neo - Smart EconomyAnurag Kumar
 
Executive summary guild42 elca_blockchain.pptx_v1.0
Executive summary guild42 elca_blockchain.pptx_v1.0Executive summary guild42 elca_blockchain.pptx_v1.0
Executive summary guild42 elca_blockchain.pptx_v1.0Nagib Aouini
 
Mesos swam-kubernetes-vds-02062017
Mesos swam-kubernetes-vds-02062017Mesos swam-kubernetes-vds-02062017
Mesos swam-kubernetes-vds-02062017Christophe Furmaniak
 
001 What is Blockchain.pdf
001 What is Blockchain.pdf001 What is Blockchain.pdf
001 What is Blockchain.pdfMarvelMovies4
 
V SYSTEMS - Tech Evolution_EN
V SYSTEMS - Tech Evolution_ENV SYSTEMS - Tech Evolution_EN
V SYSTEMS - Tech Evolution_ENV SYSTEMS
 
What is dotnet (.NET) ?
What is dotnet (.NET) ?What is dotnet (.NET) ?
What is dotnet (.NET) ?Talha Shahzad
 
EOSIO Distributed Application Use Cases
EOSIO Distributed Application Use CasesEOSIO Distributed Application Use Cases
EOSIO Distributed Application Use CasesRobert Konsdorf
 
V SYSTEMS - Tech Evolution_CN
V SYSTEMS - Tech Evolution_CNV SYSTEMS - Tech Evolution_CN
V SYSTEMS - Tech Evolution_CNV SYSTEMS
 
Blockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptxBlockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptxsaiproject
 
From Microservices to Service Mesh - devcafe event - July 2018
From Microservices to Service Mesh - devcafe event - July 2018From Microservices to Service Mesh - devcafe event - July 2018
From Microservices to Service Mesh - devcafe event - July 2018Thang Chung
 
Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014Mirantis
 
V SYSTEMS - Full Intro_EN
V SYSTEMS - Full Intro_ENV SYSTEMS - Full Intro_EN
V SYSTEMS - Full Intro_ENV SYSTEMS
 
Keynote - Open Source 101 - How JavaScript Became a Legitimate Open Source En...
Keynote - Open Source 101 - How JavaScript Became a Legitimate Open Source En...Keynote - Open Source 101 - How JavaScript Became a Legitimate Open Source En...
Keynote - Open Source 101 - How JavaScript Became a Legitimate Open Source En...Mark Hinkle
 
Blockchain EXE #12:海外遠征を含む最新事情共有(Jim Maricondo | ConsenSys)
Blockchain EXE #12:海外遠征を含む最新事情共有(Jim Maricondo | ConsenSys)Blockchain EXE #12:海外遠征を含む最新事情共有(Jim Maricondo | ConsenSys)
Blockchain EXE #12:海外遠征を含む最新事情共有(Jim Maricondo | ConsenSys)blockchainexe
 
ExaNoDe: European Exascale Processor & Memory Node Design
ExaNoDe: European Exascale Processor & Memory Node DesignExaNoDe: European Exascale Processor & Memory Node Design
ExaNoDe: European Exascale Processor & Memory Node Designinside-BigData.com
 
Encode x ETH Safari: Building with and Integrating Coinbase Wallet
Encode x ETH Safari: Building with and Integrating Coinbase WalletEncode x ETH Safari: Building with and Integrating Coinbase Wallet
Encode x ETH Safari: Building with and Integrating Coinbase Walletssusercc3bf81
 
HBaseCon2017 Splice Machine as a Service: Multi-tenant HBase using DCOS (Meso...
HBaseCon2017 Splice Machine as a Service: Multi-tenant HBase using DCOS (Meso...HBaseCon2017 Splice Machine as a Service: Multi-tenant HBase using DCOS (Meso...
HBaseCon2017 Splice Machine as a Service: Multi-tenant HBase using DCOS (Meso...HBaseCon
 
10 Best Programming Languages for Blockchain in 2023.pdf
10 Best Programming Languages for Blockchain in 2023.pdf10 Best Programming Languages for Blockchain in 2023.pdf
10 Best Programming Languages for Blockchain in 2023.pdfWDP Technologies
 

Similar to Node.js and Blockchain (20)

Get Ready for Coinbase Node
Get Ready for Coinbase NodeGet Ready for Coinbase Node
Get Ready for Coinbase Node
 
LNUG: Having Your Node.js Cake and Eating It Too
LNUG: Having Your Node.js Cake and Eating It TooLNUG: Having Your Node.js Cake and Eating It Too
LNUG: Having Your Node.js Cake and Eating It Too
 
Neo - Smart Economy
Neo - Smart EconomyNeo - Smart Economy
Neo - Smart Economy
 
Executive summary guild42 elca_blockchain.pptx_v1.0
Executive summary guild42 elca_blockchain.pptx_v1.0Executive summary guild42 elca_blockchain.pptx_v1.0
Executive summary guild42 elca_blockchain.pptx_v1.0
 
Mesos swam-kubernetes-vds-02062017
Mesos swam-kubernetes-vds-02062017Mesos swam-kubernetes-vds-02062017
Mesos swam-kubernetes-vds-02062017
 
001 What is Blockchain.pdf
001 What is Blockchain.pdf001 What is Blockchain.pdf
001 What is Blockchain.pdf
 
V SYSTEMS - Tech Evolution_EN
V SYSTEMS - Tech Evolution_ENV SYSTEMS - Tech Evolution_EN
V SYSTEMS - Tech Evolution_EN
 
What is dotnet (.NET) ?
What is dotnet (.NET) ?What is dotnet (.NET) ?
What is dotnet (.NET) ?
 
EOSIO Distributed Application Use Cases
EOSIO Distributed Application Use CasesEOSIO Distributed Application Use Cases
EOSIO Distributed Application Use Cases
 
V SYSTEMS - Tech Evolution_CN
V SYSTEMS - Tech Evolution_CNV SYSTEMS - Tech Evolution_CN
V SYSTEMS - Tech Evolution_CN
 
Blockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptxBlockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptx
 
From Microservices to Service Mesh - devcafe event - July 2018
From Microservices to Service Mesh - devcafe event - July 2018From Microservices to Service Mesh - devcafe event - July 2018
From Microservices to Service Mesh - devcafe event - July 2018
 
Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014Mirantis OpenStack-DC-Meetup 17 Sept 2014
Mirantis OpenStack-DC-Meetup 17 Sept 2014
 
V SYSTEMS - Full Intro_EN
V SYSTEMS - Full Intro_ENV SYSTEMS - Full Intro_EN
V SYSTEMS - Full Intro_EN
 
Keynote - Open Source 101 - How JavaScript Became a Legitimate Open Source En...
Keynote - Open Source 101 - How JavaScript Became a Legitimate Open Source En...Keynote - Open Source 101 - How JavaScript Became a Legitimate Open Source En...
Keynote - Open Source 101 - How JavaScript Became a Legitimate Open Source En...
 
Blockchain EXE #12:海外遠征を含む最新事情共有(Jim Maricondo | ConsenSys)
Blockchain EXE #12:海外遠征を含む最新事情共有(Jim Maricondo | ConsenSys)Blockchain EXE #12:海外遠征を含む最新事情共有(Jim Maricondo | ConsenSys)
Blockchain EXE #12:海外遠征を含む最新事情共有(Jim Maricondo | ConsenSys)
 
ExaNoDe: European Exascale Processor & Memory Node Design
ExaNoDe: European Exascale Processor & Memory Node DesignExaNoDe: European Exascale Processor & Memory Node Design
ExaNoDe: European Exascale Processor & Memory Node Design
 
Encode x ETH Safari: Building with and Integrating Coinbase Wallet
Encode x ETH Safari: Building with and Integrating Coinbase WalletEncode x ETH Safari: Building with and Integrating Coinbase Wallet
Encode x ETH Safari: Building with and Integrating Coinbase Wallet
 
HBaseCon2017 Splice Machine as a Service: Multi-tenant HBase using DCOS (Meso...
HBaseCon2017 Splice Machine as a Service: Multi-tenant HBase using DCOS (Meso...HBaseCon2017 Splice Machine as a Service: Multi-tenant HBase using DCOS (Meso...
HBaseCon2017 Splice Machine as a Service: Multi-tenant HBase using DCOS (Meso...
 
10 Best Programming Languages for Blockchain in 2023.pdf
10 Best Programming Languages for Blockchain in 2023.pdf10 Best Programming Languages for Blockchain in 2023.pdf
10 Best Programming Languages for Blockchain in 2023.pdf
 

Recently uploaded

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
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 Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
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
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
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
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
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
 

Recently uploaded (20)

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
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 Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
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)
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
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
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
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
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
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
 

Node.js and Blockchain

  • 1. O C T O B E R 2 7 , 2 0 1 7 C O N F I D E N T I A L Node.js and Blockchain Building the Web 3.0 with Node.js
  • 2. October 27, 2017 Julián Duque Developer and Educator / Community Organizer / Engineer @julian_duque
  • 3. October 27, 2017 Julián Duque Not a Crypto Expert / Not here for Crypto Currencies (or ICOs) @julian_duque
  • 4. © 2017 NodeSource C O N F I D E N T I A L What is Blockchain? 📦⛓ 4
  • 5. © 2017 NodeSource C O N F I D E N T I A L5 Hashes hash(‘😀’) = 2a02ea…7b6 hash(‘😃’) = e36f86…028 hash(‘Hola’) = f688ae…22e hash(‘Hola!’) = 0676dc…06f
  • 6. © 2017 NodeSource C O N F I D E N T I A L6 Merkle Trees binary hash tree Image credit: Wikipedia
  • 7. © 2017 NodeSource C O N F I D E N T I A L7 Blockchains • Continuously growing, append only, list of records (blocks) • Distributed Ledger Technology (DLT) • Linked and secured using cryptography
  • 8. © 2017 NodeSource C O N F I D E N T I A L8 Blockchains Image credit: Wikipedia
  • 9. © 2017 NodeSource C O N F I D E N T I A L9 Blockchain Immutability Image credit: edX - Hyperledger Course
  • 10. © 2017 NodeSource C O N F I D E N T I A L10 Reaching Consensus Proof of Work • Blocks are added to the ledger gradually • People (nodes) take turns to add blocks • Root checksum must start with a number of zeroes (difficulty, conditions) • Block includes a nonsense (nonce) that can be changed to create new checksums • Difficulty is adjusted to target desired time between blocks (control)
  • 11. © 2017 NodeSource C O N F I D E N T I A L11 Reaching Consensus Incentives • Miner (node) who find a new block gets a reward • Reward is used as currency and to pay transaction fees • Miners also get transaction fees along with the reward • Encourage miners to process blocks with transactions (Game theory) • Encourage users to pay transaction fees depending on urgency
  • 12. © 2017 NodeSource C O N F I D E N T I A L Public vs Private 12
  • 13. C O N F I D E N T I A L© 2017 NodeSource13
  • 14. © 2017 NodeSource C O N F I D E N T I A L14 Bitcoin • Crypto Currency (BTC) • Transfer value from address to address (wallet to wallet) • Scripting Language - Turing-Incomplete • Consensus Algorithm: Proof of Work
  • 15. C O N F I D E N T I A L© 2017 NodeSource15
  • 16. © 2017 NodeSource C O N F I D E N T I A L16 Ethereum • Virtual Machine (EVM) • Usage is metered by transaction fees (gas) • Crypto Currency (ether - ETH) • Transactions manipulate state • EVM is Turing-Complete • Consensus Algorithm: Proof of Work, moving to Proof of Stake
  • 17. C O N F I D E N T I A L© 2017 NodeSource17
  • 18. C O N F I D E N T I A L© 2017 NodeSource18 Hyperledger • Umbrella of Open Source projects • Focused on Business / Permissioned Blockchains • No crypto currency • Consensus algorithms: Depending of Project (PoET, PFBT) • Some projects are EVM compatible, others have they own VM
  • 19. © 2017 NodeSource C O N F I D E N T I A L Why Node.js? 19
  • 20. © 2017 NodeSource C O N F I D E N T I A L20 Why Node.js? • JavaScript: Language of the web • Great for building tools • Great as API / Frontend layer
  • 21. © 2017 NodeSource C O N F I D E N T I A L Develop Blockchain Applications 21
  • 22. © 2017 NodeSource C O N F I D E N T I A L BitcoinJS 22
  • 23. © 2017 NodeSource C O N F I D E N T I A L23 BitcoinJS https://bitcoinjs.org • Create / Interact with Bitcoin wallets • Transactions • Crypto operations
  • 24. © 2017 NodeSource C O N F I D E N T I A L EthereumJS 24
  • 25. © 2017 NodeSource C O N F I D E N T I A L25 EthereumJS https://ethereumjs.github.io • Collection of libraries and utilities for Ethereum • Always looking for contributors
  • 26. © 2017 NodeSource C O N F I D E N T I A L Smart Contracts 26
  • 27. © 2017 NodeSource C O N F I D E N T I A L27 Smart Contracts • Applications that can be deployed to the Blockchain (Ethereum / Hyperledger) • Takes care of State in Blockchain • Defines and enforces the rules and penalties around an agreement
  • 28. © 2017 NodeSource C O N F I D E N T I A L Solidity 28
  • 29. © 2017 NodeSource C O N F I D E N T I A L29 Solidity • High level language to build Smart Contracts for Ethereum • Typed Language • Based on JavaScript • Compiled to EVM
  • 30. © 2017 NodeSource C O N F I D E N T I A L30 Solidity pragma solidity ^0.4.11; contract HelloWorld { uint public balance; address public owner; function HelloWorld() public { owner = msg.sender; balance = 0; } function update() public payable isOwner() { balance = msg.value; } modifier isOwner() { require(msg.sender == owner); _; } }
  • 31. © 2017 NodeSource C O N F I D E N T I A L31 Solidity $ npm install -g solc
  • 32. © 2017 NodeSource C O N F I D E N T I A L32
  • 33. © 2017 NodeSource C O N F I D E N T I A L33 Truffle • Framework to build, test and deploy Smart Contracts • Test Smart Contracts with JavaScript • Project generators for ĐApps
  • 34. © 2017 NodeSource C O N F I D E N T I A L34 Truffle $ npm install -g truffle
  • 35. © 2017 NodeSource C O N F I D E N T I A L ĐApps 35
  • 36. © 2017 NodeSource C O N F I D E N T I A L36 ĐApps https://www.stateofthedapps.com • Web 3.0 - Decentralized Applications • Interact with Smart Contracts using backend- less JavaScript Applications • Bitcoin: The first ĐApp
  • 37. © 2017 NodeSource C O N F I D E N T I A L MetaMask 37
  • 38. © 2017 NodeSource C O N F I D E N T I A L38 MetaMask https://www.metamask.io • Brings Ethereum to your Browser • Perfect for running ĐApps • No need to have a full node running
  • 39. © 2017 NodeSource C O N F I D E N T I A L Hyperledger Composer 39
  • 40. © 2017 NodeSource C O N F I D E N T I A L40 Hyperledger Composer https://hyperledger.github.io/composer/ • Build private Blockchain Applications and Business Networks • Build Smart Contracts with a model language • Generate REST APIs • Node.js modules (composer-client) to interact with your network
  • 41. © 2017 NodeSource C O N F I D E N T I A L41
  • 42. © 2017 NodeSource C O N F I D E N T I A L42 Blockstack https://blockstack.org • Build decentralized applications with JavaScript (BlockstackJS) • Virtualchain: An existing Blockchain extension
  • 43. © 2017 NodeSource C O N F I D E N T I A L Demo https://julianduque.github.io/simple-vote/ 43
  • 44. C O N F I D E N T I A L Thank you! Julián Duque julian@nodesource.com @julian_duque