blockchain for business on hyperledger

44
Blockchain For Business On Hyperledger Anna Derbakova Software Engineer (IBM Blockchain)

Upload: all-things-open

Post on 16-Apr-2017

366 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Blockchain for Business on Hyperledger

Blockchain For BusinessOn Hyperledger

Anna DerbakovaSoftware Engineer (IBM Blockchain)

Page 2: Blockchain for Business on Hyperledger

What is blockchain?

Page 3: Blockchain for Business on Hyperledger

Bitcoin

Two Innovations=

Page 4: Blockchain for Business on Hyperledger

An Economic Innovation

A topic for another day…

Page 5: Blockchain for Business on Hyperledger

A Technological Innovation

How is it possible that strangers on the internet can agree on the

accounting of over $5,000,000,000 with no central authority?

Page 6: Blockchain for Business on Hyperledger

A Technological Innovation

How is it possible that strangers on the internet can agree on the

accounting of over $5,000,000,000 with no central authority?

Answer: Blockchain

Page 7: Blockchain for Business on Hyperledger

More Than Bitcoin…

http://fortune.com/2016/10/19/walmart-ibm-blockchain-china-pork/

http://www.forbes.com/sites/yanzhonghuang/2014/07/16/the-2008-milk-scandal-revisited/#5adf77064428

“Consumers today want more transparency about where and

how a product came to be.”

Frank Yiannas, vice president of food safety at Walmart

http://blogs.wsj.com/cio/2016/10/19/wal-mart-turns-to-blockchain-for-tracking-pork-in-china/

Page 8: Blockchain for Business on Hyperledger

Blockchain

• Database

• Consensus Algorithms

• Peer-to-peer Communication

• Cryptography

Page 9: Blockchain for Business on Hyperledger

Block—chain• Hash — Fingerprint of data

Hash FunctionSHA-256

All Things Open 2016!

699dcaa3389af4a4a248e899a168132277c28f2cee8d994f69815c9047

d6bcdc

Page 10: Blockchain for Business on Hyperledger

Block—chain• Block — Collection of transactions +

hash of previous block

Tx_1Tx_2Tx_3

Hash FunctionSHA-256

bbf465d0c7b801a933714c4a5200f0d74afc80492f1b4acb3b48d51b94

3ef1e7

Page 11: Blockchain for Business on Hyperledger

Block—chain• Block — Collection of transactions +

hash of previous block

Tx_1Tx_2Tx_3

Tx_1Tx_2Tx_3

Tx_1Tx_2Tx_3

… …

Page 12: Blockchain for Business on Hyperledger

Block—chain• Block — Collection of transactions +

hash of previous block

Tx_1Tx_2Tx_3

Tx_1Tx_2Tx_3

Tx_1Tx_2Tx_3

… …

Page 13: Blockchain for Business on Hyperledger

Blockchain

• Database

• Consensus Algorithms

• Peer-to-peer Communication

• Cryptography

Page 14: Blockchain for Business on Hyperledger

The Really Hard StuffConsensus

Page 15: Blockchain for Business on Hyperledger

Consensus

Alice

Bob

Chuck

Dave

Which check will bounce?

$75

$75$75

$100

Page 16: Blockchain for Business on Hyperledger

Blockchain

• Database

• Consensus Algorithms

• Peer-to-peer Communication

• Cryptography

Page 17: Blockchain for Business on Hyperledger

Business Use Cases

Page 18: Blockchain for Business on Hyperledger

Asset Transfer• Anything that is capable of being owned or

controlled to produce value, is an asset

• Two fundamental types of assets– Tangible, e.g. a house– Intangible e.g. a mortgage

• Intangible assets subdivide– Financial, e.g. bond– Intellectual e.g. patents– Digital e.g. music

• Cash is also an asset

Page 19: Blockchain for Business on Hyperledger

Transferring An Asset• Asset is codified within a (smart) contract

• Asset is exchanged by updating contract state through an available action

vehicleState: var vin var manufacturer var make var model var year var owner

vehicleContract: createVehicle scrapVehicle updateOwner

Page 20: Blockchain for Business on Hyperledger

Pork Supply Chain

Page 21: Blockchain for Business on Hyperledger

Hyperledger Project

Page 22: Blockchain for Business on Hyperledger

Hyperledger Project• Cross-industry collaborative effort to support

blockchain-based distributed ledgers

• Focused on ledgers designed to support global business transactions

• Develop open protocols and standards for supporting blockchain

• https://www.hyperledger.org/

Page 23: Blockchain for Business on Hyperledger

How Is Hyperledger Different?

• Permissioned blockchain

• No miners or coins

• Provides a modular framework that supports different components for different uses

• Other consensus schemes, like PBFT (Practical Byzantine Fault Tolerance) may be used

Page 24: Blockchain for Business on Hyperledger

Let’s Build an app!

Page 25: Blockchain for Business on Hyperledger

Blockchain Application

Blockchain Network

Blockchain Application Web Application

End User

Transaction

HTTP Request

Browser, mobile, etc.

Chaincode (contract)

Chaincode

Peer

Ledger

MembershipService

REST

Page 26: Blockchain for Business on Hyperledger

Blockchain Network

Blockchain Network

Blockchain Application Web Application

End User

Transaction

HTTP Request

Browser, mobile, etc.

Chaincode (contract)

Chaincode

Peer

Ledger

MembershipService

REST

Page 27: Blockchain for Business on Hyperledger

• Docker images provided

• Single peer + membership service

• Four peers + membership service

Blockchain Network

Peer

Ledger

MembershipService

Page 28: Blockchain for Business on Hyperledger

Chaincode (Smart Contract)

Blockchain Network

Blockchain Application Web Application

End User

Transaction

HTTP Request

Browser, mobile, etc.

Chaincode (contract)

Chaincode

Peer

Ledger

MembershipService

REST

Page 29: Blockchain for Business on Hyperledger

• Implemented in Go

• Packaged together with dependencies

• Docker container running on the validating peer

Chaincode (Smart Contract)

Peer

LedgerChaincode

Query

Init

Invoke

Page 30: Blockchain for Business on Hyperledger

• Stores the “account” state variable

• Invoke action adds value to “account”

• Query action retrieves the value of “account”

Crowd Funding Chaincode

Chaincode

Query

Init

Invoke

accountState: var amount

accountContract: addValue

Page 31: Blockchain for Business on Hyperledger

Web Application

Blockchain Network

Blockchain Application Web Application

End User

Transaction

HTTP Request

Browser, mobile, etc.

Chaincode (contract)

Chaincode

Peer

Ledger

MembershipService

REST

Page 32: Blockchain for Business on Hyperledger

Web Application

Blockchain Network

Blockchain Application

Transaction

Chaincode

Peer

Ledger

MembershipService

• Implemented with Node.js (uses the “hfc” NPM module)• Registers and enrolls users• Deploys, invokes, and queries the chaincode

Web ApplicationREST

Page 33: Blockchain for Business on Hyperledger

Front End Application

Blockchain Network

Blockchain Application Web Application

End User

Transaction

HTTP Request

Browser, mobile, etc.

Chaincode (contract)

Chaincode

Peer

Ledger

MembershipService

REST

Page 34: Blockchain for Business on Hyperledger

Getting Started Tutorial: http://bit.ly/hyperledger-basics

Questions?

Anna Derbakova: [email protected] https://www.linkedin.com/in/annadderbakova

Page 35: Blockchain for Business on Hyperledger

Backup

Page 36: Blockchain for Business on Hyperledger

Proof of Work*

Alice Bob Chuck Dave$100 $100 $100 $100

Honest Honest HonestDishonest

Our Simple Bank has four account holders and no central authority. How can we reach consensus on our account values?

*This simplistic example leaves out details for the purpose of explaining PoW in 5 minutes.

Page 37: Blockchain for Business on Hyperledger

Proof of WorkEveryone starts trying to solve a very difficult (but easily verifiable) problem. It’s so difficult, with four people working, it will only be solved once every 10 minutes.

Alice Bob Chuck Dave$100 $100 $100 $100

Honest Honest HonestDishonest

Page 38: Blockchain for Business on Hyperledger

Proof of Work

While attempting to solve the problem, our actors also announce transactions.

Alice - send $50 to Dave

Bob - send $20 to Alice

Chuck - send $1,000 to Dave

Alice Bob Chuck Dave$100 $100 $100 $100

Honest Honest HonestDishonest

Page 39: Blockchain for Business on Hyperledger

Proof of Work

Alice solves the problem first. She announces the solution.

Valid transactions Alice heard

Alice - send $50 to Dave

Bob - send $20 to Alice

= hash solution +Alice’s block

Alice Bob Chuck Dave$100 $100 $100 $100

Page 40: Blockchain for Business on Hyperledger

$150$100$80$70

Proof of Work

Alice Bob Chuck Dave

Honest Honest HonestDishonest

After verifying Alice’s solution, everyone starts working on a new problem that includes the hash of Alice’s block.

Alice’s block

Alice Bob Chuck Dave

Page 41: Blockchain for Business on Hyperledger

Proof of Work

Alice Bob Chuck Dave$70 $80 $100 $150

Honest Honest HonestDishonest

Bob finds the next solution.

New transactions

Dave - send $10 to Bob

Dave - send $20 to Alice

= hash (solution +Alice’s block

)Bob’s block

Page 42: Blockchain for Business on Hyperledger

Proof of Work

Alice Bob Chuck Dave$90 $90 $100 $120

Honest Honest HonestDishonest

Chuck finds the next solution, but includes fake transactions his block.

Alice, Bob, and Dave ignore his block and keep looking for another solution.

Alice’s block

Bob’s block

Chuck’s block

Page 43: Blockchain for Business on Hyperledger

Proof of Work

Alice Bob Chuck Dave$90 $90 $100 $120

Honest Honest HonestDishonest

Chuck finds the solution again, but he doesn’t include previous blocks in an attempt to erase old transactions.

Again, he is ignored because it’s not the longest chain.Alice’s

blockBob’s block

Chuck’s block

Page 44: Blockchain for Business on Hyperledger

Proof of Work

Alice Bob Chuck Dave$90 $90 $100 $120

Honest Honest HonestDishonest

Chuck can’t fake a longer chain because solving these problems requires too much work. Chuck gives up!

Alice’s block

Bob’s block