20
Bitmark and Hyperledger Workshop The Digital Assets and Property Jollen 2017.03.21 @Taipei <[email protected]> Bitmark Inc. https://bitmark.com https://github.com/bitmark-inc

Bitmark and Hyperledger Workshop: the Digital Assets and Property

Embed Size (px)

Citation preview

Page 1: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Bitmark and Hyperledger Workshop The Digital Assets and Property

Jollen 2017.03.21 @Taipei

<[email protected]> Bitmark Inc.

https://bitmark.com https://github.com/bitmark-inc

Page 2: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Agenda

• Hyperledger 全球區塊鏈開源計畫介紹

• 徹底認識 Hyperledger Fabric 架構

• Web 3.0 簡介:Proof、Cryptography 與數位資產

• 打造智能合約:Hyperledger Fabric 實作

• 創建數位資產:Bitmark 實作

Page 3: Bitmark and Hyperledger Workshop: the Digital Assets and Property

1.0

2.0

3.0

FinTech and Cryptocurrency

Non-fintech

Distributed ledger

3

Background

Page 4: Bitmark and Hyperledger Workshop: the Digital Assets and Property

PreviousHash Timestamp

MerkleRoot Nonce

Block #11211

PreviousHash Timestamp

MerkleRoot Nonce

Block #11212

PreviousHash Timestamp

MerkleRoot Nonce

Block #11213

Merkle tree ⽤用來紀錄這個區塊裡的

transactions

4

Background

Page 5: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Source: https://www.ft.com/content/eb1f8256-7b4b-11e5-a1fe-567b37f80b64#axzz3qe4rV5dH

How a Blockchain Works

5

Page 6: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Consensus Algorithms

• Proof-of-work

• Proof-of-stake

• Proof-of [ resource | existance | relibility | … ]

• “Hybrid”

• PBFT (Practical Byzantine Fault Tolerance - 拜占庭容錯算法)

• Paxos / The Part-Time Parliament (希臘城邦算法)

• DPoS (Delegate Proof of Stake)

6

Page 7: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Preliminary

Hyperledger Fabric

the “network”the “ledger”

7

Page 8: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Prerequisite

• Digital Assets

• Aka the “web 3.0”

• Digital property and the “Internet of Trust”

• Chaincode

• Aka the “code on the blockchain”

• Node.js

• Use the “[email protected]” module

8

Page 9: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Assets

• Range from the tangible (real estate and hardware) to the intangible (contracts and intellectual property)

• How to define Assets

• Bitmark Desktop

• Fabric Composer

• etc

9

Page 10: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Chaincode

• Software-defined assets

• Transaction instructions for modifying assets

• Aka “smart contracts”

• Business logic

10

Page 11: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Exchange Assets

• The “transaction”

• Using unspent transaction outputs as the inputs for subsequent transactions

• Fabric allows for any asset to be represented in binary or JSON format.

• Assets live in Fabric as a collection of key-value pairs (KVP)

11

Page 12: Bitmark and Hyperledger Workshop: the Digital Assets and Property

System Architecture

• Transactions

• Deploy transactions

• Invoke transactions

• Blockchain datastructures

• Nodes

12

Page 13: Bitmark and Hyperledger Workshop: the Digital Assets and Property

• The transaction flow consists of a transaction proposal sent by an application client to specific endorsing peers

• The peer executes a chaincode function to simulate the transaction

• The proposal response gets sent back to the client along with an endorsement signature

Chaincode and Transaction

13

Page 14: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Register and Enroll

Source: https://hyperledger-fabric.readthedocs.io/en/latest/txflow.html

1. Register and enroll with the organization’s certificate authority (CA)

2. Install chaincode on the peers and instantiate on the channel

14

Page 15: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Transaction Flow

Source: https://hyperledger-fabric.readthedocs.io/en/latest/txflow.html

1. Client A initiates a transaction

2. Endorsing peers verify signature & execute the transaction

3. Proposal responses are inspected

4. Client assembles endorsements into a transaction

5. Transaction is validated and committed

6. Ledger updated

15

Page 16: Bitmark and Hyperledger Workshop: the Digital Assets and Property

智能合約撰寫

• The chaincode contains logic defining a set of transaction instructions

• Agree upon price for an asset

• An endorsement policy to state that both peerA and peerB must endorse any transaction

16

Page 17: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Chaincode and Ledger

• Chaincode functions execute against the ledger current state database and are initiated through a transaction proposal

• Each transaction results in a set of asset key-value pairs that are committed to the ledger as creates, updates, or deletes

17

Page 18: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Semantic Web Stack

18

Source: https://en.wikipedia.org/wiki/Semantic_Web_Stack18

Page 19: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Web 3.0 and Assets

• Publish / Share

• Transfer / Sell

• “Copyright (C) 2017 Jollen”

• Defined assets on the ledger

19

Page 20: Bitmark and Hyperledger Workshop: the Digital Assets and Property

Thank You !

Questions ? Or by email through [email protected]