Bitmark and Hyperledger Workshop: the Digital Assets and Property

Preview:

Citation preview

Bitmark and Hyperledger Workshop The Digital Assets and Property

Jollen 2017.03.21 @Taipei

<jollen@bitmark.com> Bitmark Inc.

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

Agenda

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

• 徹底認識 Hyperledger Fabric 架構

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

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

• 創建數位資產:Bitmark 實作

1.0

2.0

3.0

FinTech and Cryptocurrency

Non-fintech

Distributed ledger

3

Background

PreviousHash Timestamp

MerkleRoot Nonce

Block #11211

PreviousHash Timestamp

MerkleRoot Nonce

Block #11212

PreviousHash Timestamp

MerkleRoot Nonce

Block #11213

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

transactions

4

Background

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

How a Blockchain Works

5

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

Preliminary

Hyperledger Fabric

the “network”the “ledger”

7

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 “hfc@0.6.5” module

8

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

Chaincode

• Software-defined assets

• Transaction instructions for modifying assets

• Aka “smart contracts”

• Business logic

10

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

System Architecture

• Transactions

• Deploy transactions

• Invoke transactions

• Blockchain datastructures

• Nodes

12

• 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

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

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

智能合約撰寫

• 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

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

Semantic Web Stack

18

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

Web 3.0 and Assets

• Publish / Share

• Transfer / Sell

• “Copyright (C) 2017 Jollen”

• Defined assets on the ledger

19

Thank You !

Questions ? Or by email through jollen@bitmark.com

Recommended