SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
☞ Blockchain.info
☞ Bitcoin blockchain1
info
☞ Popular Bitcoin wallet
☞ Offices in London & NYC
☞ Sjors Provoost
☞ Web Wallet Developer
☞ Commutes between
Utrecht and London
1
The Bitcoin blockchain still has the most hash power behind it.
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 1
Wallet in Browser
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 2
Wallet in NodeJS
Install
npm install blockchain/my-wallet-v3#v3.24.5
Load
Blockchain = require('blockchain-wallet-client')
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 3
Create a wallet
email = 'sjors+delft@blockchain.com'
pwd = 'very_weak'
Blockchain.MyWallet.createNewWallet(
email,
pwd,
'',
'EUR',
'en',
console.log, // Success
console.error // Error
)
// 1822bb00-5c33-46a9-bbcb-b75de17fca66
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 4
Login
user_id = '1822bb00-5c33-46a9-bbcb-b75de17fca66'
pwd = 'very_weak'
Blockchain.MyWallet.login(
user_id,
pwd,
{ twoFactor: null, sessionToken: null }, {}
).then(MyWallet.wallet.fetchAccountInfo)
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 5
Get funding address
account = MyWallet.wallet.hdwallet.accounts[0]
account.receiveAddress
// '1ALfF8Ps8bkZT1qyf2TVa1Lu3P74wUfog2'
Show account balance
// Loads balance and recent transactions
MyWallet.wallet.getHistory()
account.balance
// 113702 (in Satoshi = €0,70)
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 6
About wallets
{
"user_id": "1822bb00-5c33-46a9-bbcb-b75de17fca66",
"options": {
"pbkdf2_iterations": 5000 // Password is hashed using PBKDF2
},
"seed_hex": "65b4cd78ba92d490466532a7939e5405",
// grant please funny inside coil else book play pole ostrich never arctic
"address_labels": [{
"index": 1, "label": "Zakgeld"
}
☞ encrypted in browser, stored on server
☞ we can't access your private keys, nor reset your password
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 7
Spend coins
p = new Blockchain.Payment()
p
.to('1AvPkgjx2RKFW6xeqKVoKjsmJMZWrqs17w')
.from(0)
.amount(50000) // In Satoshi = €0.35
.build()
.sign()
.publish()
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 8
Import private key
wallet = Blockchain.MyWallet.wallet
pk = 'L3qqTb8FD1wWhfZjjyJSiwQZyp3oLbycBNB9So45bj4uAYrP5YmS'
wallet.importLegacyAddress(pk, '')
addr = wallet.keys[0].address;
// 1AvPkgjx2RKFW6xeqKVoKjsmJMZWrqs17w
Show balance:
addr.getBalance()
// 50000 // In Satoshi = €0.35
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 9
Monitor address
op = MyWallet.ws.msgAddrSub(account.receiveAddress)
// '{"op":"addr_sub","addr":"1ALfF8Ps8bkZT1qyf2TVa1Lu3P74wUfog2"}'
MyWallet.ws.send(op)
WebSockets
☞ "a computer communications protocol, providing full-duplex
communication channels over a single TCP connection." -
Wikipedia
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 10
{
"op": "utx",
"x": {
"hash": "f22525fd3fdbac441267b4f68f13fb8f1cabd6d0967a48844647b91e3f9ef8ea",
"inputs": [{
"prev_out": {
"spent": true,
"addr": "1Ea4SXJbd2z7NszrS23i5rAd4v7LjuuJCE", // Sender wallet
"value": 3040127, // 0.003 BTC
},
}],
"out": [{
"spent": false,
"addr": "1ALfF8Ps8bkZT1qyf2TVa1Lu3P74wUfog2", // Our wallet
}, {
... // Change
}]
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 11
Process websocket message
MyWallet.getSocketOnMessage = (msg) => {
obj = JSON.parse(msg)
if (obj.op === 'utx') {
if (obj.x.out.filter(
(output) => output.addr === account.receiveAddress
).length) {
console.log('Coins received!')
}
}
}
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 12
Buy Bitcoin with NodeJS
☞ Partner company handles the purchase
coinify = MyWallet.wallet.external.addCoinify()
coinify.signup('NL','EUR').then(console.log)
// user: ....,
// offlineToken: 'AkwyQ...'
☞ Partner account details stored in wallet
☞ Bitcoin goes straight to your wallet
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 13
☞ Ask quote and buy:
coinify.getBuyQuote(10 * 100, 'EUR', 'BTC').then((quote) => {
console.log(quote.quoteAmount / 100000000, "BTC")
quote.buy('card').then((trade) =>
console.log(trade.address)
// Do some manual stuff with your creditcard
)
})
☞ Monitor purchase address (web socket):
coinify.monitorPayments()
coinify.trades[0].watchAddress().then(() => console.log('Bitcoin Received!'))
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 14
Sign a message
☞ Prove that you have the private key for an address:
addr = MyWallet.wallet.keys[0].address;
// 1AvPkgjx2RKFW6xeqKVoKjsmJMZWrqs17w
msg = 'Hallo Delft'
sig = MyWallet.wallet.keys[0].signMessage(msg)
// 'H2yfcyYDoSj+siL4rvMmnHIvKUDH4GThFHYGlQk28q79AhreibtQvmaH+5W6hRty+S1gQeFXbaKs04xjIsHRCOE='
☞ Verify the proof:
Blockchain.Helpers.verifyMessage('1AvPkgjx2RKFW6xeqKVoKjsmJMZWrqs17w', sig, msg )
// true
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 15
Thank You
Resources
☞ https://github.com/blockchain/my-wallet-v3
☞ https://www.blockchain.com/careers/
2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 16

Contenu connexe

Tendances

CBGTBT - Part 5 - Blockchains 102
CBGTBT - Part 5 - Blockchains 102CBGTBT - Part 5 - Blockchains 102
CBGTBT - Part 5 - Blockchains 102Blockstrap.com
 
Intro to Blockchain - And, by the way, what the heck is proof-of-work?
Intro to Blockchain - And, by the way, what the heck is proof-of-work?Intro to Blockchain - And, by the way, what the heck is proof-of-work?
Intro to Blockchain - And, by the way, what the heck is proof-of-work?Jim Flynn
 
Bitcoin & Ethereum Address
Bitcoin & Ethereum AddressBitcoin & Ethereum Address
Bitcoin & Ethereum AddressPo Wei Chen
 
create your own cryptocurrency
create your own cryptocurrencycreate your own cryptocurrency
create your own cryptocurrencyBellaj Badr
 
Public Blockchain Scalability (April 2018)
Public Blockchain Scalability (April 2018)Public Blockchain Scalability (April 2018)
Public Blockchain Scalability (April 2018)Casey K. Caruso
 
Bitcoin, Banking and the Blockchain
Bitcoin, Banking and the BlockchainBitcoin, Banking and the Blockchain
Bitcoin, Banking and the Blockchainseancarmody
 
Intro to Blockchain Slides
Intro to Blockchain SlidesIntro to Blockchain Slides
Intro to Blockchain SlidesShannon Wells
 
Even the LastPass Will be Stolen Deal with It!
Even the LastPass Will be Stolen Deal with It!Even the LastPass Will be Stolen Deal with It!
Even the LastPass Will be Stolen Deal with It!Martin Vigo
 
Wallets and Transactions #1
Wallets and Transactions #1Wallets and Transactions #1
Wallets and Transactions #1BCWorkspace
 
Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2Wojciech Langiewicz
 
Introduction to Bitcoin for programmers
Introduction to Bitcoin for programmersIntroduction to Bitcoin for programmers
Introduction to Bitcoin for programmersWojciech Langiewicz
 
Blockchain: Developer's Perspective (Java Edition)
Blockchain: Developer's Perspective (Java Edition)Blockchain: Developer's Perspective (Java Edition)
Blockchain: Developer's Perspective (Java Edition)Artur Skowroński
 
Bitcoin: introduction for programmers - Pecha Kucha
Bitcoin:   introduction for programmers - Pecha KuchaBitcoin:   introduction for programmers - Pecha Kucha
Bitcoin: introduction for programmers - Pecha KuchaWojciech Langiewicz
 
Build your own block chain
Build your own block chainBuild your own block chain
Build your own block chainBohdan Szymanik
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Zvi Avraham
 
Start Carrier with blockchain and Ethereum [PW MINI - Fall '17]
Start Carrier with blockchain and Ethereum [PW MINI - Fall '17]Start Carrier with blockchain and Ethereum [PW MINI - Fall '17]
Start Carrier with blockchain and Ethereum [PW MINI - Fall '17]EthWorks
 
Girl Develop It - Intro To Blockchain And Cryptocurrencies
Girl Develop It - Intro To Blockchain And CryptocurrenciesGirl Develop It - Intro To Blockchain And Cryptocurrencies
Girl Develop It - Intro To Blockchain And Cryptocurrenciesmagnachef
 
Windows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows AzureWindows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows AzureVitor Ciaramella
 
gething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientgething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientSathish VJ
 

Tendances (20)

Intro into blockchain
Intro into blockchainIntro into blockchain
Intro into blockchain
 
CBGTBT - Part 5 - Blockchains 102
CBGTBT - Part 5 - Blockchains 102CBGTBT - Part 5 - Blockchains 102
CBGTBT - Part 5 - Blockchains 102
 
Intro to Blockchain - And, by the way, what the heck is proof-of-work?
Intro to Blockchain - And, by the way, what the heck is proof-of-work?Intro to Blockchain - And, by the way, what the heck is proof-of-work?
Intro to Blockchain - And, by the way, what the heck is proof-of-work?
 
Bitcoin & Ethereum Address
Bitcoin & Ethereum AddressBitcoin & Ethereum Address
Bitcoin & Ethereum Address
 
create your own cryptocurrency
create your own cryptocurrencycreate your own cryptocurrency
create your own cryptocurrency
 
Public Blockchain Scalability (April 2018)
Public Blockchain Scalability (April 2018)Public Blockchain Scalability (April 2018)
Public Blockchain Scalability (April 2018)
 
Bitcoin, Banking and the Blockchain
Bitcoin, Banking and the BlockchainBitcoin, Banking and the Blockchain
Bitcoin, Banking and the Blockchain
 
Intro to Blockchain Slides
Intro to Blockchain SlidesIntro to Blockchain Slides
Intro to Blockchain Slides
 
Even the LastPass Will be Stolen Deal with It!
Even the LastPass Will be Stolen Deal with It!Even the LastPass Will be Stolen Deal with It!
Even the LastPass Will be Stolen Deal with It!
 
Wallets and Transactions #1
Wallets and Transactions #1Wallets and Transactions #1
Wallets and Transactions #1
 
Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2Bitcoin for programmers - part 1 version 2
Bitcoin for programmers - part 1 version 2
 
Introduction to Bitcoin for programmers
Introduction to Bitcoin for programmersIntroduction to Bitcoin for programmers
Introduction to Bitcoin for programmers
 
Blockchain: Developer's Perspective (Java Edition)
Blockchain: Developer's Perspective (Java Edition)Blockchain: Developer's Perspective (Java Edition)
Blockchain: Developer's Perspective (Java Edition)
 
Bitcoin: introduction for programmers - Pecha Kucha
Bitcoin:   introduction for programmers - Pecha KuchaBitcoin:   introduction for programmers - Pecha Kucha
Bitcoin: introduction for programmers - Pecha Kucha
 
Build your own block chain
Build your own block chainBuild your own block chain
Build your own block chain
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
 
Start Carrier with blockchain and Ethereum [PW MINI - Fall '17]
Start Carrier with blockchain and Ethereum [PW MINI - Fall '17]Start Carrier with blockchain and Ethereum [PW MINI - Fall '17]
Start Carrier with blockchain and Ethereum [PW MINI - Fall '17]
 
Girl Develop It - Intro To Blockchain And Cryptocurrencies
Girl Develop It - Intro To Blockchain And CryptocurrenciesGirl Develop It - Intro To Blockchain And Cryptocurrencies
Girl Develop It - Intro To Blockchain And Cryptocurrencies
 
Windows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows AzureWindows Azure 2/8 - Recursos básicos do Windows Azure
Windows Azure 2/8 - Recursos básicos do Windows Azure
 
gething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientgething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang client
 

En vedette

SmartOrganization
SmartOrganizationSmartOrganization
SmartOrganizationpgorjup
 
Dapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen TechmeetupDapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen TechmeetupJames Littlejohn
 
Etherem ~ agvm
Etherem ~ agvmEtherem ~ agvm
Etherem ~ agvmgha sshee
 
日本のIT市場のトピックス
日本のIT市場のトピックス日本のIT市場のトピックス
日本のIT市場のトピックスHiroyasu NOHATA
 
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter..."Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...Khaled Ben Driss
 
Vision for a health blockchain
Vision for a health blockchainVision for a health blockchain
Vision for a health blockchainJames Littlejohn
 
Etherisc Versicherung neu erfinden
Etherisc Versicherung neu erfindenEtherisc Versicherung neu erfinden
Etherisc Versicherung neu erfindenStephan Karpischek
 
The Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: MixThe Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: Mixgavofyork
 
Learning Solidity
Learning SolidityLearning Solidity
Learning SolidityArnold Pham
 
Ingredients for creating dapps
Ingredients for creating dappsIngredients for creating dapps
Ingredients for creating dappsStefaan Ponnet
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to EthereumArnold Pham
 
The Ethereum Geth Client
The Ethereum Geth ClientThe Ethereum Geth Client
The Ethereum Geth ClientArnold Pham
 
Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial ENNicholas Lin
 
State of wifi_2016
State of wifi_2016State of wifi_2016
State of wifi_2016antitree
 
How smart are those smart contract
How smart are those smart contractHow smart are those smart contract
How smart are those smart contractRoman Mandeleil
 

En vedette (20)

SmartOrganization
SmartOrganizationSmartOrganization
SmartOrganization
 
Dapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen TechmeetupDapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen Techmeetup
 
Ethereum @ descon 2016
Ethereum @ descon 2016Ethereum @ descon 2016
Ethereum @ descon 2016
 
Etherem ~ agvm
Etherem ~ agvmEtherem ~ agvm
Etherem ~ agvm
 
日本のIT市場のトピックス
日本のIT市場のトピックス日本のIT市場のトピックス
日本のIT市場のトピックス
 
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter..."Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
 
Introduction to Idea
Introduction to IdeaIntroduction to Idea
Introduction to Idea
 
Vision for a health blockchain
Vision for a health blockchainVision for a health blockchain
Vision for a health blockchain
 
Etherisc Versicherung neu erfinden
Etherisc Versicherung neu erfindenEtherisc Versicherung neu erfinden
Etherisc Versicherung neu erfinden
 
Solidity intro
Solidity introSolidity intro
Solidity intro
 
The Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: MixThe Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: Mix
 
Learning Solidity
Learning SolidityLearning Solidity
Learning Solidity
 
Ingredients for creating dapps
Ingredients for creating dappsIngredients for creating dapps
Ingredients for creating dapps
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to Ethereum
 
The Ethereum Geth Client
The Ethereum Geth ClientThe Ethereum Geth Client
The Ethereum Geth Client
 
Build dapps 1:3 dev tools
Build dapps 1:3 dev toolsBuild dapps 1:3 dev tools
Build dapps 1:3 dev tools
 
The future of Blockchain
The future of BlockchainThe future of Blockchain
The future of Blockchain
 
Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial EN
 
State of wifi_2016
State of wifi_2016State of wifi_2016
State of wifi_2016
 
How smart are those smart contract
How smart are those smart contractHow smart are those smart contract
How smart are those smart contract
 

Similaire à NodeJS Blockchain.info Wallet

Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)
Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)
Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)Svetlin Nakov
 
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsEclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsMatthias Zimmermann
 
Cracking JWT tokens: a tale of magic, Node.js and parallel computing - Code E...
Cracking JWT tokens: a tale of magic, Node.js and parallel computing - Code E...Cracking JWT tokens: a tale of magic, Node.js and parallel computing - Code E...
Cracking JWT tokens: a tale of magic, Node.js and parallel computing - Code E...Luciano Mammino
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxWijdenBenothmen1
 
Building decentralised apps with js - Devoxx Morocco 2018
Building decentralised apps with js - Devoxx Morocco 2018Building decentralised apps with js - Devoxx Morocco 2018
Building decentralised apps with js - Devoxx Morocco 2018Mikhail Kuznetcov
 
Blockchain basics
Blockchain basicsBlockchain basics
Blockchain basicsRamesh BN
 
New Business Models enabled by Blockchain
New Business Models enabled by BlockchainNew Business Models enabled by Blockchain
New Business Models enabled by BlockchainSlash
 
Unchain Blockchain by Eva Rez
Unchain Blockchain by Eva RezUnchain Blockchain by Eva Rez
Unchain Blockchain by Eva Rezrezeva
 
Unchain Blockchain by Eva Rez
Unchain Blockchain by Eva RezUnchain Blockchain by Eva Rez
Unchain Blockchain by Eva Rezrezeva
 
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018Svetlin Nakov
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...Luciano Mammino
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationPaperchain
 
Block 16 - Ethereum block transaction info via aggregated views API by Block 16
Block 16 - Ethereum block transaction info via aggregated views API by Block 16Block 16 - Ethereum block transaction info via aggregated views API by Block 16
Block 16 - Ethereum block transaction info via aggregated views API by Block 16Block 16
 
Build on Streakk Chain - Blockchain
Build on Streakk Chain - BlockchainBuild on Streakk Chain - Blockchain
Build on Streakk Chain - BlockchainEarn.World
 
Multi-Signature Crypto-Wallets: Nakov at SoftUnit Conf 2018
Multi-Signature Crypto-Wallets: Nakov at SoftUnit Conf 2018Multi-Signature Crypto-Wallets: Nakov at SoftUnit Conf 2018
Multi-Signature Crypto-Wallets: Nakov at SoftUnit Conf 2018Svetlin Nakov
 
Nachos3 - Theoretical Part
Nachos3 - Theoretical PartNachos3 - Theoretical Part
Nachos3 - Theoretical PartEduardo Triana
 
A research-oriented introduction to the cryptographic currencies (starting wi...
A research-oriented introduction to the cryptographic currencies (starting wi...A research-oriented introduction to the cryptographic currencies (starting wi...
A research-oriented introduction to the cryptographic currencies (starting wi...vpnmentor
 

Similaire à NodeJS Blockchain.info Wallet (20)

Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)
Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)
Crypto Wallets: A Technical Perspective (Nakov at OpenFest 2018)
 
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsEclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
 
Cracking JWT tokens: a tale of magic, Node.js and parallel computing - Code E...
Cracking JWT tokens: a tale of magic, Node.js and parallel computing - Code E...Cracking JWT tokens: a tale of magic, Node.js and parallel computing - Code E...
Cracking JWT tokens: a tale of magic, Node.js and parallel computing - Code E...
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptx
 
Building decentralised apps with js - Devoxx Morocco 2018
Building decentralised apps with js - Devoxx Morocco 2018Building decentralised apps with js - Devoxx Morocco 2018
Building decentralised apps with js - Devoxx Morocco 2018
 
Blockchain basics
Blockchain basicsBlockchain basics
Blockchain basics
 
Geth important commands
Geth important commandsGeth important commands
Geth important commands
 
New Business Models enabled by Blockchain
New Business Models enabled by BlockchainNew Business Models enabled by Blockchain
New Business Models enabled by Blockchain
 
Unchain Blockchain by Eva Rez
Unchain Blockchain by Eva RezUnchain Blockchain by Eva Rez
Unchain Blockchain by Eva Rez
 
Unchain Blockchain by Eva Rez
Unchain Blockchain by Eva RezUnchain Blockchain by Eva Rez
Unchain Blockchain by Eva Rez
 
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
 
Blockchain introduction
Blockchain introductionBlockchain introduction
Blockchain introduction
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentation
 
Block 16 - Ethereum block transaction info via aggregated views API by Block 16
Block 16 - Ethereum block transaction info via aggregated views API by Block 16Block 16 - Ethereum block transaction info via aggregated views API by Block 16
Block 16 - Ethereum block transaction info via aggregated views API by Block 16
 
Build on Streakk Chain - Blockchain
Build on Streakk Chain - BlockchainBuild on Streakk Chain - Blockchain
Build on Streakk Chain - Blockchain
 
Multi-Signature Crypto-Wallets: Nakov at SoftUnit Conf 2018
Multi-Signature Crypto-Wallets: Nakov at SoftUnit Conf 2018Multi-Signature Crypto-Wallets: Nakov at SoftUnit Conf 2018
Multi-Signature Crypto-Wallets: Nakov at SoftUnit Conf 2018
 
Nachos3 - Theoretical Part
Nachos3 - Theoretical PartNachos3 - Theoretical Part
Nachos3 - Theoretical Part
 
A research-oriented introduction to the cryptographic currencies (starting wi...
A research-oriented introduction to the cryptographic currencies (starting wi...A research-oriented introduction to the cryptographic currencies (starting wi...
A research-oriented introduction to the cryptographic currencies (starting wi...
 

Dernier

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
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
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
 
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
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
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
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
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
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
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
 
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.
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Dernier (20)

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
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
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
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
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
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
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 ...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
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...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
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
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
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...
 
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 ...
 
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...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

NodeJS Blockchain.info Wallet

  • 1. ☞ Blockchain.info ☞ Bitcoin blockchain1 info ☞ Popular Bitcoin wallet ☞ Offices in London & NYC ☞ Sjors Provoost ☞ Web Wallet Developer ☞ Commutes between Utrecht and London 1 The Bitcoin blockchain still has the most hash power behind it. 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 1
  • 2. Wallet in Browser 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 2
  • 3. Wallet in NodeJS Install npm install blockchain/my-wallet-v3#v3.24.5 Load Blockchain = require('blockchain-wallet-client') 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 3
  • 4. Create a wallet email = 'sjors+delft@blockchain.com' pwd = 'very_weak' Blockchain.MyWallet.createNewWallet( email, pwd, '', 'EUR', 'en', console.log, // Success console.error // Error ) // 1822bb00-5c33-46a9-bbcb-b75de17fca66 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 4
  • 5. Login user_id = '1822bb00-5c33-46a9-bbcb-b75de17fca66' pwd = 'very_weak' Blockchain.MyWallet.login( user_id, pwd, { twoFactor: null, sessionToken: null }, {} ).then(MyWallet.wallet.fetchAccountInfo) 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 5
  • 6. Get funding address account = MyWallet.wallet.hdwallet.accounts[0] account.receiveAddress // '1ALfF8Ps8bkZT1qyf2TVa1Lu3P74wUfog2' Show account balance // Loads balance and recent transactions MyWallet.wallet.getHistory() account.balance // 113702 (in Satoshi = €0,70) 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 6
  • 7. About wallets { "user_id": "1822bb00-5c33-46a9-bbcb-b75de17fca66", "options": { "pbkdf2_iterations": 5000 // Password is hashed using PBKDF2 }, "seed_hex": "65b4cd78ba92d490466532a7939e5405", // grant please funny inside coil else book play pole ostrich never arctic "address_labels": [{ "index": 1, "label": "Zakgeld" } ☞ encrypted in browser, stored on server ☞ we can't access your private keys, nor reset your password 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 7
  • 8. Spend coins p = new Blockchain.Payment() p .to('1AvPkgjx2RKFW6xeqKVoKjsmJMZWrqs17w') .from(0) .amount(50000) // In Satoshi = €0.35 .build() .sign() .publish() 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 8
  • 9. Import private key wallet = Blockchain.MyWallet.wallet pk = 'L3qqTb8FD1wWhfZjjyJSiwQZyp3oLbycBNB9So45bj4uAYrP5YmS' wallet.importLegacyAddress(pk, '') addr = wallet.keys[0].address; // 1AvPkgjx2RKFW6xeqKVoKjsmJMZWrqs17w Show balance: addr.getBalance() // 50000 // In Satoshi = €0.35 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 9
  • 10. Monitor address op = MyWallet.ws.msgAddrSub(account.receiveAddress) // '{"op":"addr_sub","addr":"1ALfF8Ps8bkZT1qyf2TVa1Lu3P74wUfog2"}' MyWallet.ws.send(op) WebSockets ☞ "a computer communications protocol, providing full-duplex communication channels over a single TCP connection." - Wikipedia 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 10
  • 11. { "op": "utx", "x": { "hash": "f22525fd3fdbac441267b4f68f13fb8f1cabd6d0967a48844647b91e3f9ef8ea", "inputs": [{ "prev_out": { "spent": true, "addr": "1Ea4SXJbd2z7NszrS23i5rAd4v7LjuuJCE", // Sender wallet "value": 3040127, // 0.003 BTC }, }], "out": [{ "spent": false, "addr": "1ALfF8Ps8bkZT1qyf2TVa1Lu3P74wUfog2", // Our wallet }, { ... // Change }] 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 11
  • 12. Process websocket message MyWallet.getSocketOnMessage = (msg) => { obj = JSON.parse(msg) if (obj.op === 'utx') { if (obj.x.out.filter( (output) => output.addr === account.receiveAddress ).length) { console.log('Coins received!') } } } 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 12
  • 13. Buy Bitcoin with NodeJS ☞ Partner company handles the purchase coinify = MyWallet.wallet.external.addCoinify() coinify.signup('NL','EUR').then(console.log) // user: ...., // offlineToken: 'AkwyQ...' ☞ Partner account details stored in wallet ☞ Bitcoin goes straight to your wallet 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 13
  • 14. ☞ Ask quote and buy: coinify.getBuyQuote(10 * 100, 'EUR', 'BTC').then((quote) => { console.log(quote.quoteAmount / 100000000, "BTC") quote.buy('card').then((trade) => console.log(trade.address) // Do some manual stuff with your creditcard ) }) ☞ Monitor purchase address (web socket): coinify.monitorPayments() coinify.trades[0].watchAddress().then(() => console.log('Bitcoin Received!')) 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 14
  • 15. Sign a message ☞ Prove that you have the private key for an address: addr = MyWallet.wallet.keys[0].address; // 1AvPkgjx2RKFW6xeqKVoKjsmJMZWrqs17w msg = 'Hallo Delft' sig = MyWallet.wallet.keys[0].signMessage(msg) // 'H2yfcyYDoSj+siL4rvMmnHIvKUDH4GThFHYGlQk28q79AhreibtQvmaH+5W6hRty+S1gQeFXbaKs04xjIsHRCOE=' ☞ Verify the proof: Blockchain.Helpers.verifyMessage('1AvPkgjx2RKFW6xeqKVoKjsmJMZWrqs17w', sig, msg ) // true 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 15
  • 16. Thank You Resources ☞ https://github.com/blockchain/my-wallet-v3 ☞ https://www.blockchain.com/careers/ 2016-12-07 - Dutch Blockchain Hackathon - Technology Deep Dive - sjors@blockchain.com 16