SlideShare a Scribd company logo
Hyperledger Fabric – v2.0
Alpha
FabToken Overview & Hands-On
Lab
Hyperledger Korea User Group
2
엔터프라이즈 블록체인 - Token
3
• R3 Corda – Tokens SDK
• JP Morgan Quorum – JPM Coin
- https://www.jpmorgan.com/global/news/digital-coin-payments
• Hyperledger Fabric v2 – FabToken
- Token Management Enablement in Hyperledger Fabric
 http://bit.ly/2KvVKb4
- Token (base support) - Support Issue, Transfer, and Redeem Token Operations
 https://jira.hyperledger.org/browse/FAB-11144
- Using FabToken
 https://hyperledger-fabric.readthedocs.io/en/latest/token/FabToken.html
FabToken
4
• Hyperledger Fabric v2.0
- https://github.com/hyperledger/fabric/tree/master/token
• Token Management System
• Unspent Transaction Output (UTXO) 모델
• 합의, 검증을 위해 Orderer, Peer 사용
• 토큰 생성, 관리를 위해 체인코드를 사용하지 않음.(Endorsement Policy X)
• s송/수신자 식별 – MSP
• Token Lifecycle: Issue, Transfer, Redeem, List
Unspent Transaction Output (UTXO)
5출처 - https://codechain.readthedocs.io/en/latest/transactions.html
Hyperledger Fabric – UTXO
6
• 패브릭에서는 상태(State)는 Key-Value 형태로 저장
Key : Namespace + TokenPrefix + Owner + TransactionId + Index
Value: Quantity
• Unspent Transaction(Output)은 Ledger(State DB)에 저장되고
Spent Transaction(Input)은 Ledger(State DB)에서 삭제됨.
Hyperledger Fabric – UTXO Transaction
7
Org1
100
IN OUT
Org1
100
IN OUT
Org1
50
Org2
50
Tx #1 Tx #2
{Org1-Tx#1, 100}
Issue to Org1(100) Transfer Org1 to Org2(50)
{Org1-Tx#2, 50}
{Org2-Tx#2-1, 50}
{Org1-Tx#1, 100}
Redeem from Org2(20)
Tx #3
Org2
50
IN OUT
Org2
30
20
{Org1-Tx#1, 100}
{Org1-Tx#2, 50}
{Org2-Tx#2-1, 50}
{Org2-Tx#3, 30}
{Tx#3-1, 20}
Token Transaction Flow
8
Client Prover Peer
① Request
(Issue,Transfer,Redeem)
② TokenTransaction
③ Envelope
④ Block
Peer
(Committer)
Validation(VSCC)
Commit(Simulation)
Prover Peer
9
• 연산(computation) 실행…
• 비밀정보 유지…
• 트랜잭션 상태, 토큰 몰록 질의 대응…
• 토큰 발행 및 전송 시 검증
- TokenTransaction 생성
Token Lifecycle
10
• Issue
• List
• Transfer
• Reedem
Token Lifecycle – issue (계속)
11
• 채널 내 허가 받은 MSP에 의해 토큰 생성
- IssuingPolicy : v2.0 alpha 버전에서는 ANY로 설정됨.
• 속성
- Owner: MSP
- Type: 토큰 이름. 예> FabCoin, HLKUGCoin,…
- Quantity
Token Lifecycle - issue
12
• SDK (node.js)
const tokenclient = client.newTokenClient(mychannel);
const txId = client.newTransactionID();
const param = {
owner: user1.getIdentity().serialize(),
type: 'USD',
quantity: '500',
};
const issueRequest = {
params: [param],
txId: txId,
};
const result = await tokenClient.issue(issueRequest);
Token Lifecycle – list (계속)
13
• Unspent 토큰에 대해 질의
- 권한: 토큰 소유자 MSP
• 질의 결과 값
- TokenID: 트랜잭션 ID, 인덱스
- Type: 토큰 이름. 예> FabCoin, HLKUGCoin,…
- Quantity
Token Lifecycle - list
14
• SDK (node.js)
const user1Tokenclient = client1.newTokenClient(mychannel);
const mytokens = await user1TokenClient.list();
for (const token of tokens) {
// get token.id, token.type, and token.quantity
// token.id will be used for transfer and redeem
}
Token Lifecycle – transfer (계속)
15
• 토크 전달, 토큰 소비
- 권한: 토큰 ID의 소유자(MSP)
• 파라미터
- Token ID: 토큰 ID
- Quantity
- Recipient: 수신자(MSP)
Token Lifecycle - transfer
16
• SDK (node.js)
const txId = client1.newTransactionID();
const param = {
owner: user2.getIdentity().serialize(),
quantity: '300',
};
// create the request for transfer
const transferRequest = {
tokenIds: [tokenid1],
params: [param],
txId: txId,
};
const mytokens = await user1TokenClient.transfer(transferRequest);
Token Lifecycle – redeem (계속)
17
• 비즈니스 네트워크(채널)에서 asset(token) 제거
- 권한: 토큰 ID의 소유자(MSP)
- Reedm된 토큰은 transfer/change되지 않음.
• 파라미터
- Token ID: 토큰 ID
- Quantity
Token Lifecycle - redeem
18
• SDK (node.js)
const user2Tokenclient = client2.newTokenClient(mychannel);
const txId = client2.newTransactionID();
const param = {
quantity: '100',
};
const redeemRequest = {
tokenIds: [tokenid2],
params: [param],
txId: txId,
};
const result = await user2TokenClient.redeem(redeemRequest);
핸즈온 랩 자료
19
http://bit.ly/hlkug_handson190
6
BYFN(Building Your First Network)
20
Peer Peer
Peer PeerOrderer
Org1
Org2peer0.org1.example.com
peer1.org1.example.com
peer0.org2.example.comorderer.example.com
fabric_byfn
peer1.org2.example.com
Future features
21
• non-fungible tokens
- Non fungible tokens cannot be merged or divided.
• chaincode interoperability
- allows tokens to be issued, transferred, and redeemed by chaincode
22
감사합니다.

More Related Content

What's hot

Introduction To Solidity
Introduction To SolidityIntroduction To Solidity
Introduction To Solidity
101 Blockchains
 
Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門
Atsushi Tadokoro
 

What's hot (20)

Multi-Tenancy with Spring Boot
Multi-Tenancy with Spring Boot Multi-Tenancy with Spring Boot
Multi-Tenancy with Spring Boot
 
Blockchain Solution for the Global Bond Markets
Blockchain Solution for the Global Bond MarketsBlockchain Solution for the Global Bond Markets
Blockchain Solution for the Global Bond Markets
 
Cosmos SDK Workshop: How to Build a Blockchain from Scratch
Cosmos SDK Workshop: How to Build a Blockchain from ScratchCosmos SDK Workshop: How to Build a Blockchain from Scratch
Cosmos SDK Workshop: How to Build a Blockchain from Scratch
 
DAOs on Ethereum: The Future of Venture Finance
DAOs on Ethereum: The Future of Venture FinanceDAOs on Ethereum: The Future of Venture Finance
DAOs on Ethereum: The Future of Venture Finance
 
Practical Tools for Enterprise Uses of Hyperledger Fabric (Audit and System ...
 Practical Tools for Enterprise Uses of Hyperledger Fabric (Audit and System ... Practical Tools for Enterprise Uses of Hyperledger Fabric (Audit and System ...
Practical Tools for Enterprise Uses of Hyperledger Fabric (Audit and System ...
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golang
 
Supporting trade finance with letters of credit on corda
Supporting trade finance with letters of credit on cordaSupporting trade finance with letters of credit on corda
Supporting trade finance with letters of credit on corda
 
Presentación sobre Bitcoin
Presentación sobre BitcoinPresentación sobre Bitcoin
Presentación sobre Bitcoin
 
Blockchain consensus algorithms
Blockchain consensus algorithmsBlockchain consensus algorithms
Blockchain consensus algorithms
 
Introduction to Bitcoin's Scripting Language
Introduction to Bitcoin's Scripting LanguageIntroduction to Bitcoin's Scripting Language
Introduction to Bitcoin's Scripting Language
 
Introduction To Solidity
Introduction To SolidityIntroduction To Solidity
Introduction To Solidity
 
Ethereum 스마트 컨트랙트 보안
Ethereum 스마트 컨트랙트 보안Ethereum 스마트 컨트랙트 보안
Ethereum 스마트 컨트랙트 보안
 
Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門Interactive Music II - SuperCollider入門
Interactive Music II - SuperCollider入門
 
Building secure applications with keycloak
Building secure applications with keycloak Building secure applications with keycloak
Building secure applications with keycloak
 
Introduction to Qt programming
Introduction to Qt programmingIntroduction to Qt programming
Introduction to Qt programming
 
Qt Application Programming with C++ - Part 2
Qt Application Programming with C++ - Part 2Qt Application Programming with C++ - Part 2
Qt Application Programming with C++ - Part 2
 
01 - Introduction to Hyperledger : A Blockchain Technology for Business
01 - Introduction to Hyperledger : A Blockchain Technology for Business01 - Introduction to Hyperledger : A Blockchain Technology for Business
01 - Introduction to Hyperledger : A Blockchain Technology for Business
 
NFT Marketplace Development - Coinjoker
NFT Marketplace Development - CoinjokerNFT Marketplace Development - Coinjoker
NFT Marketplace Development - Coinjoker
 
Hyperledger
HyperledgerHyperledger
Hyperledger
 
Blockchain for IoT - Smart Home
Blockchain for IoT - Smart HomeBlockchain for IoT - Smart Home
Blockchain for IoT - Smart Home
 

Similar to Hyperledger Fabric v2.0 Alpha - FabToken Overview, Hands-On Lab

Presentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosPresentation_Topalidis_Giorgos
Presentation_Topalidis_Giorgos
Giorgos Topalidis
 

Similar to Hyperledger Fabric v2.0 Alpha - FabToken Overview, Hands-On Lab (20)

Building a NFT Marketplace DApp
Building a NFT Marketplace DAppBuilding a NFT Marketplace DApp
Building a NFT Marketplace DApp
 
Basics of Block Chain
Basics of Block ChainBasics of Block Chain
Basics of Block Chain
 
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
 
Presentation topalidis giorgos
Presentation topalidis giorgosPresentation topalidis giorgos
Presentation topalidis giorgos
 
Presentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosPresentation_Topalidis_Giorgos
Presentation_Topalidis_Giorgos
 
20221110 MetaCoin
20221110 MetaCoin20221110 MetaCoin
20221110 MetaCoin
 
Securing Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTPSecuring Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTP
 
Tagcash Developers
Tagcash DevelopersTagcash Developers
Tagcash Developers
 
Corda Developer Bootcamp: Tokens
Corda Developer Bootcamp: TokensCorda Developer Bootcamp: Tokens
Corda Developer Bootcamp: Tokens
 
Bitmark and Hyperledger Workshop: the Digital Assets and Property
Bitmark and Hyperledger Workshop: the Digital Assets and PropertyBitmark and Hyperledger Workshop: the Digital Assets and Property
Bitmark and Hyperledger Workshop: the Digital Assets and Property
 
Asset tokenization Real Estate Reinvented
Asset tokenization Real Estate ReinventedAsset tokenization Real Estate Reinvented
Asset tokenization Real Estate Reinvented
 
Scalable IoT platform
Scalable IoT platformScalable IoT platform
Scalable IoT platform
 
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
“Technical Intro to Blockhain” by Yurijs Pimenovs from Paybis at CryptoCurren...
 
Cotopaxi - IoT testing toolkit (3rd release - Black Hat Europe 2019 Arsenal)
Cotopaxi - IoT testing toolkit (3rd release - Black Hat Europe 2019 Arsenal)Cotopaxi - IoT testing toolkit (3rd release - Black Hat Europe 2019 Arsenal)
Cotopaxi - IoT testing toolkit (3rd release - Black Hat Europe 2019 Arsenal)
 
Corda Developer Bootcamp: Tokens
Corda Developer Bootcamp:  TokensCorda Developer Bootcamp:  Tokens
Corda Developer Bootcamp: Tokens
 
Is there a token for that? Tokens demystified.
Is there a token for that? Tokens demystified.Is there a token for that? Tokens demystified.
Is there a token for that? Tokens demystified.
 
以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12
 
Ethereum smart contracts - door Peter Reitsma
Ethereum smart contracts - door Peter ReitsmaEthereum smart contracts - door Peter Reitsma
Ethereum smart contracts - door Peter Reitsma
 
Demystify blockchain development with hyperledger fabric
Demystify blockchain development with hyperledger fabricDemystify blockchain development with hyperledger fabric
Demystify blockchain development with hyperledger fabric
 
IBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger Workshop
IBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger WorkshopIBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger Workshop
IBM Cloud Côte D'Azur Meetup - 20181004 - Blockchain Hyperledger Workshop
 

More from Hyperledger Korea User Group

More from Hyperledger Korea User Group (7)

Hyperledger Meetup Korea #28 - HTS(Hedera Token Service), DeFi 스왑 및 유동성 프로토콜
Hyperledger Meetup Korea #28 - HTS(Hedera Token Service), DeFi 스왑 및 유동성 프로토콜Hyperledger Meetup Korea #28 - HTS(Hedera Token Service), DeFi 스왑 및 유동성 프로토콜
Hyperledger Meetup Korea #28 - HTS(Hedera Token Service), DeFi 스왑 및 유동성 프로토콜
 
Hyperledger Fabric v2.0: 새로운 기능
Hyperledger Fabric v2.0: 새로운 기능Hyperledger Fabric v2.0: 새로운 기능
Hyperledger Fabric v2.0: 새로운 기능
 
1909 Hyperledger Besu(a.k.a pantheon) Overview
1909 Hyperledger Besu(a.k.a pantheon) Overview1909 Hyperledger Besu(a.k.a pantheon) Overview
1909 Hyperledger Besu(a.k.a pantheon) Overview
 
1908 Hyperledger Fabric 소개 및 첫 네트워크 구축하기
1908 Hyperledger Fabric 소개 및 첫 네트워크 구축하기1908 Hyperledger Fabric 소개 및 첫 네트워크 구축하기
1908 Hyperledger Fabric 소개 및 첫 네트워크 구축하기
 
[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기
[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기
[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기
 
[2019.03] 멀티 노드에서 Hyperledger Fabric 네트워크 구성하기
[2019.03] 멀티 노드에서 Hyperledger Fabric 네트워크 구성하기[2019.03] 멀티 노드에서 Hyperledger Fabric 네트워크 구성하기
[2019.03] 멀티 노드에서 Hyperledger Fabric 네트워크 구성하기
 
[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능
[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능
[2019.1] 하이퍼레저 패브릭 v1.3, v1.4 새로운 기능
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 

Hyperledger Fabric v2.0 Alpha - FabToken Overview, Hands-On Lab

  • 1. Hyperledger Fabric – v2.0 Alpha FabToken Overview & Hands-On Lab Hyperledger Korea User Group
  • 2. 2
  • 3. 엔터프라이즈 블록체인 - Token 3 • R3 Corda – Tokens SDK • JP Morgan Quorum – JPM Coin - https://www.jpmorgan.com/global/news/digital-coin-payments • Hyperledger Fabric v2 – FabToken - Token Management Enablement in Hyperledger Fabric  http://bit.ly/2KvVKb4 - Token (base support) - Support Issue, Transfer, and Redeem Token Operations  https://jira.hyperledger.org/browse/FAB-11144 - Using FabToken  https://hyperledger-fabric.readthedocs.io/en/latest/token/FabToken.html
  • 4. FabToken 4 • Hyperledger Fabric v2.0 - https://github.com/hyperledger/fabric/tree/master/token • Token Management System • Unspent Transaction Output (UTXO) 모델 • 합의, 검증을 위해 Orderer, Peer 사용 • 토큰 생성, 관리를 위해 체인코드를 사용하지 않음.(Endorsement Policy X) • s송/수신자 식별 – MSP • Token Lifecycle: Issue, Transfer, Redeem, List
  • 5. Unspent Transaction Output (UTXO) 5출처 - https://codechain.readthedocs.io/en/latest/transactions.html
  • 6. Hyperledger Fabric – UTXO 6 • 패브릭에서는 상태(State)는 Key-Value 형태로 저장 Key : Namespace + TokenPrefix + Owner + TransactionId + Index Value: Quantity • Unspent Transaction(Output)은 Ledger(State DB)에 저장되고 Spent Transaction(Input)은 Ledger(State DB)에서 삭제됨.
  • 7. Hyperledger Fabric – UTXO Transaction 7 Org1 100 IN OUT Org1 100 IN OUT Org1 50 Org2 50 Tx #1 Tx #2 {Org1-Tx#1, 100} Issue to Org1(100) Transfer Org1 to Org2(50) {Org1-Tx#2, 50} {Org2-Tx#2-1, 50} {Org1-Tx#1, 100} Redeem from Org2(20) Tx #3 Org2 50 IN OUT Org2 30 20 {Org1-Tx#1, 100} {Org1-Tx#2, 50} {Org2-Tx#2-1, 50} {Org2-Tx#3, 30} {Tx#3-1, 20}
  • 8. Token Transaction Flow 8 Client Prover Peer ① Request (Issue,Transfer,Redeem) ② TokenTransaction ③ Envelope ④ Block Peer (Committer) Validation(VSCC) Commit(Simulation)
  • 9. Prover Peer 9 • 연산(computation) 실행… • 비밀정보 유지… • 트랜잭션 상태, 토큰 몰록 질의 대응… • 토큰 발행 및 전송 시 검증 - TokenTransaction 생성
  • 10. Token Lifecycle 10 • Issue • List • Transfer • Reedem
  • 11. Token Lifecycle – issue (계속) 11 • 채널 내 허가 받은 MSP에 의해 토큰 생성 - IssuingPolicy : v2.0 alpha 버전에서는 ANY로 설정됨. • 속성 - Owner: MSP - Type: 토큰 이름. 예> FabCoin, HLKUGCoin,… - Quantity
  • 12. Token Lifecycle - issue 12 • SDK (node.js) const tokenclient = client.newTokenClient(mychannel); const txId = client.newTransactionID(); const param = { owner: user1.getIdentity().serialize(), type: 'USD', quantity: '500', }; const issueRequest = { params: [param], txId: txId, }; const result = await tokenClient.issue(issueRequest);
  • 13. Token Lifecycle – list (계속) 13 • Unspent 토큰에 대해 질의 - 권한: 토큰 소유자 MSP • 질의 결과 값 - TokenID: 트랜잭션 ID, 인덱스 - Type: 토큰 이름. 예> FabCoin, HLKUGCoin,… - Quantity
  • 14. Token Lifecycle - list 14 • SDK (node.js) const user1Tokenclient = client1.newTokenClient(mychannel); const mytokens = await user1TokenClient.list(); for (const token of tokens) { // get token.id, token.type, and token.quantity // token.id will be used for transfer and redeem }
  • 15. Token Lifecycle – transfer (계속) 15 • 토크 전달, 토큰 소비 - 권한: 토큰 ID의 소유자(MSP) • 파라미터 - Token ID: 토큰 ID - Quantity - Recipient: 수신자(MSP)
  • 16. Token Lifecycle - transfer 16 • SDK (node.js) const txId = client1.newTransactionID(); const param = { owner: user2.getIdentity().serialize(), quantity: '300', }; // create the request for transfer const transferRequest = { tokenIds: [tokenid1], params: [param], txId: txId, }; const mytokens = await user1TokenClient.transfer(transferRequest);
  • 17. Token Lifecycle – redeem (계속) 17 • 비즈니스 네트워크(채널)에서 asset(token) 제거 - 권한: 토큰 ID의 소유자(MSP) - Reedm된 토큰은 transfer/change되지 않음. • 파라미터 - Token ID: 토큰 ID - Quantity
  • 18. Token Lifecycle - redeem 18 • SDK (node.js) const user2Tokenclient = client2.newTokenClient(mychannel); const txId = client2.newTransactionID(); const param = { quantity: '100', }; const redeemRequest = { tokenIds: [tokenid2], params: [param], txId: txId, }; const result = await user2TokenClient.redeem(redeemRequest);
  • 20. BYFN(Building Your First Network) 20 Peer Peer Peer PeerOrderer Org1 Org2peer0.org1.example.com peer1.org1.example.com peer0.org2.example.comorderer.example.com fabric_byfn peer1.org2.example.com
  • 21. Future features 21 • non-fungible tokens - Non fungible tokens cannot be merged or divided. • chaincode interoperability - allows tokens to be issued, transferred, and redeemed by chaincode