SlideShare a Scribd company logo
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 Node
TinaBregovi
 
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
Rob Tweed
 
Neo - Smart Economy
Neo - Smart EconomyNeo - Smart Economy
Neo - Smart Economy
Anurag 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.0
Nagib Aouini
 
Mesos swam-kubernetes-vds-02062017
Mesos swam-kubernetes-vds-02062017Mesos swam-kubernetes-vds-02062017
Mesos swam-kubernetes-vds-02062017
Christophe Furmaniak
 
001 What is Blockchain.pdf
001 What is Blockchain.pdf001 What is Blockchain.pdf
001 What is Blockchain.pdf
MarvelMovies4
 
V SYSTEMS - Tech Evolution_EN
V SYSTEMS - Tech Evolution_ENV SYSTEMS - Tech Evolution_EN
V SYSTEMS - Tech Evolution_EN
V 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 Cases
Robert Konsdorf
 
V SYSTEMS - Tech Evolution_CN
V SYSTEMS - Tech Evolution_CNV SYSTEMS - Tech Evolution_CN
V SYSTEMS - Tech Evolution_CN
V SYSTEMS
 
Blockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptxBlockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptx
saiproject
 
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
Thang 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 2014
Mirantis
 
V SYSTEMS - Full Intro_EN
V SYSTEMS - Full Intro_ENV SYSTEMS - Full Intro_EN
V SYSTEMS - Full Intro_EN
V 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 Design
inside-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 Wallet
ssusercc3bf81
 
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.pdf
WDP 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

Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 

Recently uploaded (20)

Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 

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