SlideShare a Scribd company logo
1 of 63
Download to read offline
Concept of
BlockChain
&
Decentralized
Application
timakin / @__timakin__
YAP(achimon)C::Asia Hachioji 2016 mid in Shinagawa
• github: timakin
• twitter: @__timakin__
• DeNA -> Translimit
• Go / Ruby / Node
• Blog

medium: https://medium.com/@timakin

timekin.log: http://tech-savvy.hatenablog.com/
•
•
•
•
•
•
•
•
•
P2P 

P2P 

Chain Flow
hash
target nonce
transactions transactions transactions
blockblock block
Inside of blockchain
• JSON
JSON
•
nonce
• parent hash
hash
Example of block
{
difficulty: '137447',
extraData: '0x476574682f76312e302e312f6c696e75782f676f312e342e32',
gasLimit: 3141592,
gasUsed: 0,
hash:
'0x4d3063b91cbaa12bf2de81014c1319febc9f197c93f81b0746afaffaa9496620',
nonce: '0x28fda83cb19ed497',
number: 100,
parentHash:
'0x5885cdec1d1410580eaaf1fb7ef9db245a735822d48e816c73d926b7c9872f15',
size: 536,
timestamp: 1439451765,
totalDifficulty: '13551548',
transactions: [ ],
transactionsRoot:
'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
}
Chain management
• P2P
Node json
• Node
A
B
C
fork
Consensus Algorithm
• Proof of Work
• Node 0 

Node
• target nonce(hash value)
• Node 



• Proof of Stake
•
• ex) SHA256(prevhash + address + timestamp) <= 2^256 * balance (volume of stake) / diff
• 

Proof of Stake Velocity
•
• PoW 

10
•
•
• PoS
•
•
• Node
•
DApp Stack
Decentralized Application
P2P Node 

Permanent web

Decentralized Application
Processing
File Storage Database
Decentralized Application
Processing
File Storage Database
Processing
File Storage Database
Euthareum
•
•
ether
Euthareum Client
• Geth (go-euthareum)
Node
Install
https://github.com/ethereum/go-ethereum
OS
# install euthareum
$ brew tap ethereum/ethereum
$ brew install ethereum
# install go, gmp
$ brew install gmp go
# install geth
$ git clone https://github.com/ethereum/go-ethereum
$ cd go-ethereum
$ make geth
Build private network
$ mkdir /home/test_u/eth_private_net
{
"nonce": "0x0000000000000042",
"timestamp": "0x0",
"parentHash":
"0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x0",
"gasLimit": "0x8000000",
"difficulty": "0x4000",
"mixhash":
"0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x3333333333333333333333333333333333333333",
"alloc": {}
}
Genesis
Connect to private network
$ geth --networkid "10" --nodiscover --datadir "/home/test_u/
eth_private_net" --genesis "/home/test_u/eth_private_net/
myGenesis.json" console 2>> /home/test_u/eth_private_net/
geth_err.log
# private 10 id
# peer
# console
Contract Code
# Solidity
$ sudo add-apt-repository ppa:ethereum/ethereum
$ sudo apt-get update
$ sudo apt-get install solc
$ brew install cpp-ethereum
$ brew linkapps cpp-ethereum
$ solc —-version
$ which solc
# solc geth
$ admin.setSolc(“which solc path")
$ eth.getCompilers()
•
• Ethereum Virtual Machine

Euthareum
• Solidity
• IDE: https://github.com/ethereum/browser-solidity
Contract Code
# Solidity
contract SingleNumRegister {
uint storedData;
function set(uint x) {
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}
}
Solidity JavaScript
Contract Code
#
$ var source = "contract SingleNumRegister { uint storedData;
function set(uint x) { storedData = x; } function get() constant
returns (uint retVal) { return storedData; }}"
$ var sourceCompiled = eth.compile.solidity(source)
#
$ var contractAbiDefinition =
sourceCompiled.SingleNumRegister.info.abiDefinition
$ var sourceCompiledContract = eth.contract(contractAbiDefinition)
$ var contract = sourceCompiledContract.new({from:eth.accounts[0],
data: sourceCompiled.SingleNumRegister.code})
Node
Contract Code
$ contract
{
address: '0x8ea277dfe4195daf7b8c101d79da35d1eb4c4aeb',
transactionHash:
'0xeb76caefdfe5a9aa10b11743d317cf15f881d3b2e52ba3251dcf8e0718ed5b33'
,
allEvents: function (),
get: function (),
set: function ()
}
#
$ contractAbiDefinition
Contract Code
#
$ var cnt = eth.contract([{ constant: false, inputs: [{ name: 'x',
type: 'uint256' } ], name: 'set', outputs: [ ], type: 'function' },
{ constant: true, inputs: [ ], name: 'get', outputs: [{ name:
'retVal', type: 'uint256' } ], type:
'function' } ]).at(‘0x8ea277dfe4195daf7b8c101d79da35d1eb4c4aeb');
#
$ cnt.set.sendTransaction(3,{from:eth.accounts[0]})
‘0x979c4e413a647673632d74a6c8b7f5b25a3260f3fefa4abea2dc265d61215939'
#
$ cnt.get()
Run the app on EVM
# RPC geth
$ geth --networkid "10" --nodiscover --datadir "/home/test_u/
eth_private_net" --genesis "/home/test_u/eth_private_net/myGenesis.json"
--mine --unlock 0xa7653f153f9ead98dc3be08abfc5314f596f97c6 --rpc --rpcaddr
"192.168.5.6" --rpcport "8545" --rpccorsdomain "*" console 2>> /home/
test_u/eth_private_net/geth_err.log
# meteor project
$ cd ~/eth-test #
$ meteor create simple-app # Meteor
$ meteor add twbs:bootstrap
$ meteor add ethereum:web3
$ meteor add ethereum:accounts
$ meteor add ethereum:blocks
EVM
Run the app on EVM
# geth
$ vim client/lib/init.js
```
//Web3
web3 = new Web3();
//RPC
if(!web3.currentProvider)
web3.setProvider(new web3.providers.HttpProvider("http://localhost:
8545"));
// EthAccounts
EthAccounts.init();
//EthBlocks
EthBlocks.init();
```
Run the app on EVM
$ vim client/main.html
```
<head>
<title>Simple Ether Wallet</title>
</head>
<body>
<template name="nodeStatusComponent">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Node Status</h4>
</div>
<table class="table">
<tbody>
<tr>
<th scope="row">Node</th>
<td>{{currentProvider}}</td>
</tr>
<tr>
<th scope="row">Is Mining?</th>
<td>{{isMining}}</td>
</tr>
<tr>
<th scope="row">Hashrate</th>
<td>{{currentHashrate}}</td>
</tr>
<tr>
<th scope="row">Peer Count</th>
<td>{{currentPeerCount}}</td>
</tr>
</tbody>
</table>
</div>
</template>
```
Run the app on EVM
#
$ vim client/main.html
```
<head>
<title>Simple Ether Wallet</title>
</head>
<body>
<template name="nodeStatusComponent">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Node Status</h4>
</div>
<table class="table">
<tbody>
<tr>
<th scope="row">Node</th>
<td>{{currentProvider}}</td>
</tr>
<tr>
<th scope="row">Is Mining?</th>
<td>{{isMining}}</td>
</tr>
<tr>
<th scope="row">Hashrate</th>
<td>{{currentHashrate}}</td>
</tr>
<tr>
<th scope="row">Peer Count</th>
<td>{{currentPeerCount}}</td>
</tr>
</tbody>
</table>
</div>
</template>
```
Run the app on EVM
#
$ vim client/main.js
```
// nodeStatusComponent
Template.nodeStatusComponent.helpers({
//
currentProvider: function(){
return web3.currentProvider.host;
},
//
// true false
isMining: function(){
return web3.eth.mining;
},
//
currentHashrate: function(){
return web3.eth.hashrate;
},
//
currentPeerCount: function(){
return web3.net.peerCount;
}
});
```
meteor 

Euthareum
•
• Euthareum
BigChainDB
•
•
• key-value
JSON
• python
BigChainDB
RethinkDB
BigChainDB
https://speakerdeck.com/vrde/bigchaindb-how-we-built-a-blockchain-database-
on-top-of-rethinkdb
Install, Configuration
# rethinkdb http://rethinkdb.com/docs/install/
# bigchainDB
$ sudo pip install bigchaindb
$ vim instance1.conf
```

server-tag=original
directory=/data
bind=all
direct-io
# Replace node?_hostname with actual node hostnames below, e.g.
rdb.examples.com
join=node0_hostname:29015
join=node1_hostname:29015
join=node2_hostname:29015
# continue until there's a join= line for each node in the
federation

```
Run the BigChainDB server
# rethinkdb bigchaindb server
$ rethinkdb --config-file path/to/instance1.conf
$ bigchaindb init
$ bigchaindb set-shards 1
$ bigchaindb set-replicas 1
$ bigchaindb start
Create a Digital Asset
from bigchaindb import crypto
#
testuser1_priv, testuser1_pub = crypto.generate_key_pair()
#
digital_asset_payload = {'msg': 'Hello BigchainDB!'}
#
tx = b.create_transaction(b.me, testuser1_pub, None, 'CREATE',
payload=digital_asset_payload)
#
tx_signed = b.sign_transaction(tx, b.me_private)
#
b.write_transaction(tx_signed)
#
tx_retrieved = b.get_transaction(tx_signed['id'])
tx_retrieved
BigChainDB
•
• key-value RethinkDB
IPFS
•
• gateway REST API
curl
• P2P
Install
https://ipfs.io/docs/install/
go
#
$ ipfs init
$ ipfs daemon


# peer
$ ipfs swarm peers
# ipfs image
$ ipfs cat /ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ/cat.jpg
>cat.jpg
$ open cat.jpg
# localhost webui
$ open http://localhost:5001/webui
WEBUI
Upload assets
#
$ ipfs add test.jpg
added QmaC9pUA3grWJ948u1VWRLG1wPLP8YZe7b3HopBGk4zZyA test.jpg
$ ipfs cat /ipfs/QmaC9pUA3grWJ948u1VWRLG1wPLP8YZe7b3HopBGk4zZyA > butaman.jpg
$ open https://ipfs.io/ipfs/QmaC9pUA3grWJ948u1VWRLG1wPLP8YZe7b3HopBGk4zZyA
#
$ ipfs add -r ~/myproject
# Fuse
$ ipfs mount
$ ls /ipfs/$hash/
#
$ ipfs add -q test.mp4
API Client
var ipfs = require('ipfs-client');
var stream =
ipfs.cat('QmTE9Xp76E67vkYeygbKJrsVj8W2LLcyUifuMHMEkyRfUL');
stream.pipe(process.stdout);
ipfs.add(process.stdin, function(err, hash) {
console.log(hash);
});
https://www.npmjs.com/package/ipfs-client
API
Scala Go JavaScript
ex) gx-go
https://github.com/whyrusleeping/gx-go
ipfs version 

go package manager
ex) ipfs-pics
https://ipfs.pics/
ipfs
script
IPFS
•
• gateway REST API curl
• gateway


(https://ipfs.io/ipfs/$hash)
•
DApp
•
• DB Storage
CDN
BigChainDB
Peer Node IPFS
Peer Node
Processing
File Storage Database
tr tr tr
bb b
bb b bb b
•
• P2P
CDN
• Node
Client-Server
• or <
•


http://www.meti.go.jp/press/2016/04/20160428003/
20160428003-2.pdf
• 

http://www.slideshare.net/ks91020/ss-58535780
• 5 

http://www.slideshare.net/cookle/5-58379474
• Ethereum-WhitePaper-JP 

https://github.com/kurihei/Ethereum-WhitePaper-JP/blob/master/%5BJapanese%5D-White-
Paper.md
• Ethereum Specification 

https://github.com/ethereum/go-ethereum/wiki/Ethereum-Specification
• Gitbook Ethereum 

https://www.gitbook.com/book/a-mitani/mastering-ethereum/details
• BigchainDB: how we built a blockchain database on top of RethinkDB 

https://speakerdeck.com/vrde/bigchaindb-how-we-built-a-blockchain-database-on-top-of-rethinkdb
• White Paper: BigchainDB: A Scalable Blockchain Database(DRAFT) 

https://www.bigchaindb.com/whitepaper/bigchaindb-whitepaper.pdf
• White Paper: IPFS - Content Addressed, Versioned, P2P File System (DRAFT 3) 

https://ipfs.io/ipfs/QmR7GSQM93Cx5eAg6a6yRzNde1FQv7uL6X1o4k7zrJa3LX/ipfs.draft3.pdf
• OSS
Go Go
• Docs White Paper
pdf
•
• Euthareum
Github
Github
Concept of BlockChain & Decentralized Application

More Related Content

What's hot

Webinar slides: How to Secure MongoDB with ClusterControl
Webinar slides: How to Secure MongoDB with ClusterControlWebinar slides: How to Secure MongoDB with ClusterControl
Webinar slides: How to Secure MongoDB with ClusterControlSeveralnines
 
Building Your First Data Science Applicatino in MongoDB
Building Your First Data Science Applicatino in MongoDBBuilding Your First Data Science Applicatino in MongoDB
Building Your First Data Science Applicatino in MongoDBMongoDB
 
The Ethereum Geth Client
The Ethereum Geth ClientThe Ethereum Geth Client
The Ethereum Geth ClientArnold Pham
 
FwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.jsFwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.jsTimur Shemsedinov
 
How does cryptography work? by Jeroen Ooms
How does cryptography work?  by Jeroen OomsHow does cryptography work?  by Jeroen Ooms
How does cryptography work? by Jeroen OomsAjay Ohri
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talkLocaweb
 
Node.js - async for the rest of us.
Node.js - async for the rest of us.Node.js - async for the rest of us.
Node.js - async for the rest of us.Mike Brevoort
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueGleicon Moraes
 
Roll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaRoll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaJon Moore
 
"The little big project. From zero to hero in two weeks with 3 front-end engi...
"The little big project. From zero to hero in two weeks with 3 front-end engi..."The little big project. From zero to hero in two weeks with 3 front-end engi...
"The little big project. From zero to hero in two weeks with 3 front-end engi...Fwdays
 
Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain Conor Svensson
 
Java and the blockchain - introducing web3j
Java and the blockchain - introducing web3jJava and the blockchain - introducing web3j
Java and the blockchain - introducing web3jConor Svensson
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queueBrandon Lamb
 
An opinionated intro to Node.js - devrupt hospitality hackathon
An opinionated intro to Node.js - devrupt hospitality hackathonAn opinionated intro to Node.js - devrupt hospitality hackathon
An opinionated intro to Node.js - devrupt hospitality hackathonLuciano Mammino
 
Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015Rhea Myers
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleIan Barber
 

What's hot (20)

Webinar slides: How to Secure MongoDB with ClusterControl
Webinar slides: How to Secure MongoDB with ClusterControlWebinar slides: How to Secure MongoDB with ClusterControl
Webinar slides: How to Secure MongoDB with ClusterControl
 
Building Your First Data Science Applicatino in MongoDB
Building Your First Data Science Applicatino in MongoDBBuilding Your First Data Science Applicatino in MongoDB
Building Your First Data Science Applicatino in MongoDB
 
The Ethereum Geth Client
The Ethereum Geth ClientThe Ethereum Geth Client
The Ethereum Geth Client
 
FwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.jsFwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.js
 
How does cryptography work? by Jeroen Ooms
How does cryptography work?  by Jeroen OomsHow does cryptography work?  by Jeroen Ooms
How does cryptography work? by Jeroen Ooms
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talk
 
Node.js - async for the rest of us.
Node.js - async for the rest of us.Node.js - async for the rest of us.
Node.js - async for the rest of us.
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message Queue
 
Node.js Stream API
Node.js Stream APINode.js Stream API
Node.js Stream API
 
Roll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaRoll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and Lua
 
"The little big project. From zero to hero in two weeks with 3 front-end engi...
"The little big project. From zero to hero in two weeks with 3 front-end engi..."The little big project. From zero to hero in two weeks with 3 front-end engi...
"The little big project. From zero to hero in two weeks with 3 front-end engi...
 
Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain
 
Nginx-lua
Nginx-luaNginx-lua
Nginx-lua
 
Java and the blockchain - introducing web3j
Java and the blockchain - introducing web3jJava and the blockchain - introducing web3j
Java and the blockchain - introducing web3j
 
Redis as a message queue
Redis as a message queueRedis as a message queue
Redis as a message queue
 
An opinionated intro to Node.js - devrupt hospitality hackathon
An opinionated intro to Node.js - devrupt hospitality hackathonAn opinionated intro to Node.js - devrupt hospitality hackathon
An opinionated intro to Node.js - devrupt hospitality hackathon
 
Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015
 
Web3j 2.0 Update
Web3j 2.0 UpdateWeb3j 2.0 Update
Web3j 2.0 Update
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made Simple
 

Viewers also liked

Blockchain: The Information Technology of the Future
Blockchain: The Information Technology of the FutureBlockchain: The Information Technology of the Future
Blockchain: The Information Technology of the FutureMelanie Swan
 
Everything dApp (Blockchain University Module II)
Everything dApp (Blockchain University Module II)Everything dApp (Blockchain University Module II)
Everything dApp (Blockchain University Module II)Tom Ding
 
Blockchain 3.0 - Decentral Applications
Blockchain 3.0 - Decentral ApplicationsBlockchain 3.0 - Decentral Applications
Blockchain 3.0 - Decentral ApplicationsBart Waeterschoot
 
Block chain 101 what it is, why it matters
Block chain 101  what it is, why it mattersBlock chain 101  what it is, why it matters
Block chain 101 what it is, why it mattersPaul Brody
 
How does a blockchain work?
How does a blockchain work?How does a blockchain work?
How does a blockchain work?Deloitte UK
 
Decentralised Web: IPFS project, David Dias, Protocol Labs, IPFS
Decentralised Web: IPFS project, David Dias, Protocol Labs, IPFS Decentralised Web: IPFS project, David Dias, Protocol Labs, IPFS
Decentralised Web: IPFS project, David Dias, Protocol Labs, IPFS Alan Quayle
 
Blockchain Programming
Blockchain ProgrammingBlockchain Programming
Blockchain ProgrammingRhea Myers
 
Becoming a blockchain professional
Becoming a blockchain professionalBecoming a blockchain professional
Becoming a blockchain professionalPortia Burton
 
Data Structures in and on IPFS
Data Structures in and on IPFSData Structures in and on IPFS
Data Structures in and on IPFSC4Media
 
Technological Unemployment and the Robo-Economy
Technological Unemployment and the Robo-EconomyTechnological Unemployment and the Robo-Economy
Technological Unemployment and the Robo-EconomyMelanie Swan
 
State of Blockchain Q4 2016
State of Blockchain Q4 2016State of Blockchain Q4 2016
State of Blockchain Q4 2016CoinDesk
 
State of Bitcoin and Blockchain 2016
State of Bitcoin and Blockchain 2016State of Bitcoin and Blockchain 2016
State of Bitcoin and Blockchain 2016CoinDesk
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with DataSeth Familian
 
State channels and scalability
State channels and scalabilityState channels and scalability
State channels and scalabilityMartin Köppelmann
 
ConsenSys Ethereum Total Return Swap in Japanese
ConsenSys Ethereum Total Return Swap in JapaneseConsenSys Ethereum Total Return Swap in Japanese
ConsenSys Ethereum Total Return Swap in JapaneseJohn Lilic
 

Viewers also liked (20)

Wysiwig on Rails
Wysiwig on RailsWysiwig on Rails
Wysiwig on Rails
 
Blockchain: The Information Technology of the Future
Blockchain: The Information Technology of the FutureBlockchain: The Information Technology of the Future
Blockchain: The Information Technology of the Future
 
Everything dApp (Blockchain University Module II)
Everything dApp (Blockchain University Module II)Everything dApp (Blockchain University Module II)
Everything dApp (Blockchain University Module II)
 
Blockchain 3.0 - Decentral Applications
Blockchain 3.0 - Decentral ApplicationsBlockchain 3.0 - Decentral Applications
Blockchain 3.0 - Decentral Applications
 
Block chain 101 what it is, why it matters
Block chain 101  what it is, why it mattersBlock chain 101  what it is, why it matters
Block chain 101 what it is, why it matters
 
Blockchain 2.0
Blockchain 2.0Blockchain 2.0
Blockchain 2.0
 
How does a blockchain work?
How does a blockchain work?How does a blockchain work?
How does a blockchain work?
 
IPFS: The Permanent Web
IPFS: The Permanent WebIPFS: The Permanent Web
IPFS: The Permanent Web
 
Decentralised Web: IPFS project, David Dias, Protocol Labs, IPFS
Decentralised Web: IPFS project, David Dias, Protocol Labs, IPFS Decentralised Web: IPFS project, David Dias, Protocol Labs, IPFS
Decentralised Web: IPFS project, David Dias, Protocol Labs, IPFS
 
Blockchain Vision
Blockchain VisionBlockchain Vision
Blockchain Vision
 
Blockchain Programming
Blockchain ProgrammingBlockchain Programming
Blockchain Programming
 
Becoming a blockchain professional
Becoming a blockchain professionalBecoming a blockchain professional
Becoming a blockchain professional
 
Data Structures in and on IPFS
Data Structures in and on IPFSData Structures in and on IPFS
Data Structures in and on IPFS
 
Technological Unemployment and the Robo-Economy
Technological Unemployment and the Robo-EconomyTechnological Unemployment and the Robo-Economy
Technological Unemployment and the Robo-Economy
 
Excelの話
Excelの話Excelの話
Excelの話
 
State of Blockchain Q4 2016
State of Blockchain Q4 2016State of Blockchain Q4 2016
State of Blockchain Q4 2016
 
State of Bitcoin and Blockchain 2016
State of Bitcoin and Blockchain 2016State of Bitcoin and Blockchain 2016
State of Bitcoin and Blockchain 2016
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
State channels and scalability
State channels and scalabilityState channels and scalability
State channels and scalability
 
ConsenSys Ethereum Total Return Swap in Japanese
ConsenSys Ethereum Total Return Swap in JapaneseConsenSys Ethereum Total Return Swap in Japanese
ConsenSys Ethereum Total Return Swap in Japanese
 

Similar to Concept of BlockChain & Decentralized Application

Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationBen Hall
 
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 201910 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019Matt Raible
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCLFastly
 
ql.io: Consuming HTTP at Scale
ql.io: Consuming HTTP at Scale ql.io: Consuming HTTP at Scale
ql.io: Consuming HTTP at Scale Subbu Allamaraju
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applicationsTom Croucher
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuningAOE
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020Matt Raible
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsasync_io
 
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰KAI CHU CHUNG
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebookguoqing75
 
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James WilliamsSF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James WilliamsPhilip Stehlik
 
02 banking trojans-thomassiebert
02 banking trojans-thomassiebert02 banking trojans-thomassiebert
02 banking trojans-thomassiebertgeeksec80
 
Vue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMRVue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMRJavier Abadía
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serializationGWTcon
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeKAI CHU CHUNG
 

Similar to Concept of BlockChain & Decentralized Application (20)

Real World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS ApplicationReal World Lessons on the Pain Points of Node.JS Application
Real World Lessons on the Pain Points of Node.JS Application
 
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 201910 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
 
Geth important commands
Geth important commandsGeth important commands
Geth important commands
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
ql.io: Consuming HTTP at Scale
ql.io: Consuming HTTP at Scale ql.io: Consuming HTTP at Scale
ql.io: Consuming HTTP at Scale
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
 
Sinatra for REST services
Sinatra for REST servicesSinatra for REST services
Sinatra for REST services
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Pycon - Python for ethical hackers
Pycon - Python for ethical hackers Pycon - Python for ethical hackers
Pycon - Python for ethical hackers
 
ql.io at NodePDX
ql.io at NodePDXql.io at NodePDX
ql.io at NodePDX
 
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰如何透過 Go-kit 快速搭建微服務架構應用程式實戰
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook
 
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James WilliamsSF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
 
02 banking trojans-thomassiebert
02 banking trojans-thomassiebert02 banking trojans-thomassiebert
02 banking trojans-thomassiebert
 
Vue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMRVue.js + Django - configuración para desarrollo con webpack y HMR
Vue.js + Django - configuración para desarrollo con webpack y HMR
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
 
Serenity Now
Serenity NowSerenity Now
Serenity Now
 

Recently uploaded

Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfalene1
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书rnrncn29
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.elesangwon
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodManicka Mamallan Andavar
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 
List of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfList of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfisabel213075
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdfsahilsajad201
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosVictor Morales
 
signals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsignals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsapna80328
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSneha Padhiar
 

Recently uploaded (20)

Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument method
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 
List of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdfList of Accredited Concrete Batching Plant.pdf
List of Accredited Concrete Batching Plant.pdf
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdf
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitos
 
signals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsignals in triangulation .. ...Surveying
signals in triangulation .. ...Surveying
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
 

Concept of BlockChain & Decentralized Application

  • 1. Concept of BlockChain & Decentralized Application timakin / @__timakin__ YAP(achimon)C::Asia Hachioji 2016 mid in Shinagawa
  • 2.
  • 3. • github: timakin • twitter: @__timakin__ • DeNA -> Translimit • Go / Ruby / Node • Blog
 medium: https://medium.com/@timakin
 timekin.log: http://tech-savvy.hatenablog.com/
  • 4.
  • 6.
  • 8.
  • 10.
  • 12. Chain Flow hash target nonce transactions transactions transactions blockblock block
  • 13. Inside of blockchain • JSON JSON • nonce • parent hash hash
  • 14. Example of block { difficulty: '137447', extraData: '0x476574682f76312e302e312f6c696e75782f676f312e342e32', gasLimit: 3141592, gasUsed: 0, hash: '0x4d3063b91cbaa12bf2de81014c1319febc9f197c93f81b0746afaffaa9496620', nonce: '0x28fda83cb19ed497', number: 100, parentHash: '0x5885cdec1d1410580eaaf1fb7ef9db245a735822d48e816c73d926b7c9872f15', size: 536, timestamp: 1439451765, totalDifficulty: '13551548', transactions: [ ], transactionsRoot: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421', }
  • 17. Consensus Algorithm • Proof of Work • Node 0 
 Node • target nonce(hash value) • Node 
 
 • Proof of Stake • • ex) SHA256(prevhash + address + timestamp) <= 2^256 * balance (volume of stake) / diff • 
 Proof of Stake Velocity
  • 18.
  • 19. • • PoW 
 10 • • • PoS • • • Node •
  • 20.
  • 21.
  • 22.
  • 24. Decentralized Application P2P Node 
 Permanent web

  • 26. Decentralized Application Processing File Storage Database Processing File Storage Database
  • 28. Euthareum Client • Geth (go-euthareum) Node
  • 29. Install https://github.com/ethereum/go-ethereum OS # install euthareum $ brew tap ethereum/ethereum $ brew install ethereum # install go, gmp $ brew install gmp go # install geth $ git clone https://github.com/ethereum/go-ethereum $ cd go-ethereum $ make geth
  • 30. Build private network $ mkdir /home/test_u/eth_private_net { "nonce": "0x0000000000000042", "timestamp": "0x0", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x0", "gasLimit": "0x8000000", "difficulty": "0x4000", "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", "coinbase": "0x3333333333333333333333333333333333333333", "alloc": {} } Genesis
  • 31. Connect to private network $ geth --networkid "10" --nodiscover --datadir "/home/test_u/ eth_private_net" --genesis "/home/test_u/eth_private_net/ myGenesis.json" console 2>> /home/test_u/eth_private_net/ geth_err.log # private 10 id # peer # console
  • 32. Contract Code # Solidity $ sudo add-apt-repository ppa:ethereum/ethereum $ sudo apt-get update $ sudo apt-get install solc $ brew install cpp-ethereum $ brew linkapps cpp-ethereum $ solc —-version $ which solc # solc geth $ admin.setSolc(“which solc path") $ eth.getCompilers() • • Ethereum Virtual Machine
 Euthareum • Solidity • IDE: https://github.com/ethereum/browser-solidity
  • 33. Contract Code # Solidity contract SingleNumRegister { uint storedData; function set(uint x) { storedData = x; } function get() constant returns (uint retVal) { return storedData; } } Solidity JavaScript
  • 34. Contract Code # $ var source = "contract SingleNumRegister { uint storedData; function set(uint x) { storedData = x; } function get() constant returns (uint retVal) { return storedData; }}" $ var sourceCompiled = eth.compile.solidity(source) # $ var contractAbiDefinition = sourceCompiled.SingleNumRegister.info.abiDefinition $ var sourceCompiledContract = eth.contract(contractAbiDefinition) $ var contract = sourceCompiledContract.new({from:eth.accounts[0], data: sourceCompiled.SingleNumRegister.code}) Node
  • 35. Contract Code $ contract { address: '0x8ea277dfe4195daf7b8c101d79da35d1eb4c4aeb', transactionHash: '0xeb76caefdfe5a9aa10b11743d317cf15f881d3b2e52ba3251dcf8e0718ed5b33' , allEvents: function (), get: function (), set: function () } # $ contractAbiDefinition
  • 36. Contract Code # $ var cnt = eth.contract([{ constant: false, inputs: [{ name: 'x', type: 'uint256' } ], name: 'set', outputs: [ ], type: 'function' }, { constant: true, inputs: [ ], name: 'get', outputs: [{ name: 'retVal', type: 'uint256' } ], type: 'function' } ]).at(‘0x8ea277dfe4195daf7b8c101d79da35d1eb4c4aeb'); # $ cnt.set.sendTransaction(3,{from:eth.accounts[0]}) ‘0x979c4e413a647673632d74a6c8b7f5b25a3260f3fefa4abea2dc265d61215939' # $ cnt.get()
  • 37. Run the app on EVM # RPC geth $ geth --networkid "10" --nodiscover --datadir "/home/test_u/ eth_private_net" --genesis "/home/test_u/eth_private_net/myGenesis.json" --mine --unlock 0xa7653f153f9ead98dc3be08abfc5314f596f97c6 --rpc --rpcaddr "192.168.5.6" --rpcport "8545" --rpccorsdomain "*" console 2>> /home/ test_u/eth_private_net/geth_err.log # meteor project $ cd ~/eth-test # $ meteor create simple-app # Meteor $ meteor add twbs:bootstrap $ meteor add ethereum:web3 $ meteor add ethereum:accounts $ meteor add ethereum:blocks EVM
  • 38. Run the app on EVM # geth $ vim client/lib/init.js ``` //Web3 web3 = new Web3(); //RPC if(!web3.currentProvider) web3.setProvider(new web3.providers.HttpProvider("http://localhost: 8545")); // EthAccounts EthAccounts.init(); //EthBlocks EthBlocks.init(); ```
  • 39. Run the app on EVM $ vim client/main.html ``` <head> <title>Simple Ether Wallet</title> </head> <body> <template name="nodeStatusComponent"> <div class="panel panel-default"> <div class="panel-heading"> <h4>Node Status</h4> </div> <table class="table"> <tbody> <tr> <th scope="row">Node</th> <td>{{currentProvider}}</td> </tr> <tr> <th scope="row">Is Mining?</th> <td>{{isMining}}</td> </tr> <tr> <th scope="row">Hashrate</th> <td>{{currentHashrate}}</td> </tr> <tr> <th scope="row">Peer Count</th> <td>{{currentPeerCount}}</td> </tr> </tbody> </table> </div> </template> ```
  • 40. Run the app on EVM # $ vim client/main.html ``` <head> <title>Simple Ether Wallet</title> </head> <body> <template name="nodeStatusComponent"> <div class="panel panel-default"> <div class="panel-heading"> <h4>Node Status</h4> </div> <table class="table"> <tbody> <tr> <th scope="row">Node</th> <td>{{currentProvider}}</td> </tr> <tr> <th scope="row">Is Mining?</th> <td>{{isMining}}</td> </tr> <tr> <th scope="row">Hashrate</th> <td>{{currentHashrate}}</td> </tr> <tr> <th scope="row">Peer Count</th> <td>{{currentPeerCount}}</td> </tr> </tbody> </table> </div> </template> ```
  • 41. Run the app on EVM # $ vim client/main.js ``` // nodeStatusComponent Template.nodeStatusComponent.helpers({ // currentProvider: function(){ return web3.currentProvider.host; }, // // true false isMining: function(){ return web3.eth.mining; }, // currentHashrate: function(){ return web3.eth.hashrate; }, // currentPeerCount: function(){ return web3.net.peerCount; } }); ``` meteor 

  • 45. Install, Configuration # rethinkdb http://rethinkdb.com/docs/install/ # bigchainDB $ sudo pip install bigchaindb $ vim instance1.conf ```
 server-tag=original directory=/data bind=all direct-io # Replace node?_hostname with actual node hostnames below, e.g. rdb.examples.com join=node0_hostname:29015 join=node1_hostname:29015 join=node2_hostname:29015 # continue until there's a join= line for each node in the federation
 ```
  • 46. Run the BigChainDB server # rethinkdb bigchaindb server $ rethinkdb --config-file path/to/instance1.conf $ bigchaindb init $ bigchaindb set-shards 1 $ bigchaindb set-replicas 1 $ bigchaindb start
  • 47. Create a Digital Asset from bigchaindb import crypto # testuser1_priv, testuser1_pub = crypto.generate_key_pair() # digital_asset_payload = {'msg': 'Hello BigchainDB!'} # tx = b.create_transaction(b.me, testuser1_pub, None, 'CREATE', payload=digital_asset_payload) # tx_signed = b.sign_transaction(tx, b.me_private) # b.write_transaction(tx_signed) # tx_retrieved = b.get_transaction(tx_signed['id']) tx_retrieved
  • 49. IPFS • • gateway REST API curl • P2P
  • 50. Install https://ipfs.io/docs/install/ go # $ ipfs init $ ipfs daemon 
 # peer $ ipfs swarm peers # ipfs image $ ipfs cat /ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ/cat.jpg >cat.jpg $ open cat.jpg # localhost webui $ open http://localhost:5001/webui
  • 51. WEBUI
  • 52. Upload assets # $ ipfs add test.jpg added QmaC9pUA3grWJ948u1VWRLG1wPLP8YZe7b3HopBGk4zZyA test.jpg $ ipfs cat /ipfs/QmaC9pUA3grWJ948u1VWRLG1wPLP8YZe7b3HopBGk4zZyA > butaman.jpg $ open https://ipfs.io/ipfs/QmaC9pUA3grWJ948u1VWRLG1wPLP8YZe7b3HopBGk4zZyA # $ ipfs add -r ~/myproject # Fuse $ ipfs mount $ ls /ipfs/$hash/ # $ ipfs add -q test.mp4
  • 53. API Client var ipfs = require('ipfs-client'); var stream = ipfs.cat('QmTE9Xp76E67vkYeygbKJrsVj8W2LLcyUifuMHMEkyRfUL'); stream.pipe(process.stdout); ipfs.add(process.stdin, function(err, hash) { console.log(hash); }); https://www.npmjs.com/package/ipfs-client API Scala Go JavaScript
  • 56. IPFS • • gateway REST API curl • gateway 
 (https://ipfs.io/ipfs/$hash) •
  • 57. DApp • • DB Storage CDN BigChainDB Peer Node IPFS Peer Node Processing File Storage Database tr tr tr bb b bb b bb b
  • 58.
  • 61. • Ethereum-WhitePaper-JP 
 https://github.com/kurihei/Ethereum-WhitePaper-JP/blob/master/%5BJapanese%5D-White- Paper.md • Ethereum Specification 
 https://github.com/ethereum/go-ethereum/wiki/Ethereum-Specification • Gitbook Ethereum 
 https://www.gitbook.com/book/a-mitani/mastering-ethereum/details • BigchainDB: how we built a blockchain database on top of RethinkDB 
 https://speakerdeck.com/vrde/bigchaindb-how-we-built-a-blockchain-database-on-top-of-rethinkdb • White Paper: BigchainDB: A Scalable Blockchain Database(DRAFT) 
 https://www.bigchaindb.com/whitepaper/bigchaindb-whitepaper.pdf • White Paper: IPFS - Content Addressed, Versioned, P2P File System (DRAFT 3) 
 https://ipfs.io/ipfs/QmR7GSQM93Cx5eAg6a6yRzNde1FQv7uL6X1o4k7zrJa3LX/ipfs.draft3.pdf
  • 62. • OSS Go Go • Docs White Paper pdf • • Euthareum Github Github