Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발

3,242 views

Published on

IBM 블록체인을 활용하여 투명하게 구호기금 관리하기
- Source code https://github.com/yunho0130/global-citizen
- IBM Cloud Blockchain
- Hyperledger Fabric
- Hyperledger Composer

Published in: Technology
  • Login to see the comments

[Call for code] IBM 블록체인을 활용하여 투명하게 구호기금 관리하기 - Hyperledger Fabric v1.1 by 맹개발

  1. 1. 1 IBM Watson & Cloud Platform Technical Service Professional Yunho Maeng 맹윤호Blockchain : Hyperledger Fabric 블록체인을 활용하여 투명하게 구호기금 관리하기
  2. 2. 2 Prerequisite for development environment
  3. 3. 3 http://ibm.biz/1808busan $ git clone https://github.com/yunho0130/global-citizen Download repository URL for hands-on
  4. 4. 4 Setting development environment For Windows User: Install VirtualBox (Recommended) https://www.virtualbox.org/wiki/Downloads
  5. 5. 5 Setting development environment For Windows User: Install Ubuntu 16.04 server(Recommended) http://releases.ubuntu.com/16.04/
  6. 6. 6 NVM: Node Version Manager $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash Install NVM
  7. 7. 7 NVM: Node Version Manager $ nvm install 8 Install Node v8 $ which node $ node -v
  8. 8. 8 NVM: Node Version Manager $ npm install -g composer-cli@0.19.5 Install Composer CLI
  9. 9. 9 Overview : Hyperledger Fabric & IBM
  10. 10. 10 Hyperledger Project https://gerrit.hyperledger.org/r/#/admin/projects/
  11. 11. 11 IBM Blockchain Platform IBM Blockchain Platform (IBM, 2017)
  12. 12. 12 Making blockchain real for business with over 400 engagements Trade Finance Pre and Post Trade Complex Risk Coverage Identity/ Know your customer (KYC) Unlisted Securities/ Private Equity Funds Loyalty Program Medicated Health Data Exchange Fraud/ Compliance Registry Distributed Energy/ Carbon Credit Supply Chain Food Safety Provenance/ Traceability many more at www.ibm.biz/BlockRef
  13. 13. 13 Hyperledger Members Premier General Associate Source: https://www.hyperledger.org/members Updated 15 November 2017 General
  14. 14. 14 IBM Blockchain Platform : Why IBM? IBM LinuxOne Architecture for Blockchain (IBM, 2018) IBM® 솔루션은 하드웨어 에서부터 상위 계층까지 보안을 통합하여 블록체 인 네트워크를 무단 액세 스로부터 안전하게 보호 합니다.
  15. 15. 15 Introduction Hyperledger Fabric https://youtu.be/lD9KAnkZUjU How it Works: Blockchain
  16. 16. 16 Introduction Hyperledger Fabric https://youtu.be/IgNfoQQ5Reg IBM Blockchain Car Lease Demo
  17. 17. 17 Private vs Public Blockchain
  18. 18. 18 Public Blockchain vs Private Blockchain https://remix.ethereum.org Ethereum Solidity: Smart contract
  19. 19. 19 Public Blockchain vs Private Blockchain https://remix.ethereum.org Ethereum Solidity: Smart contract
  20. 20. 20 Public Blockchain vs Private Blockchain https://etherscan.io/ Ethereum Solidity: Smart contract
  21. 21. 21 Public Blockchain vs Private Blockchain https://etherscan.io/tx/0xcf3da48fdbdffde2811c98c291f80957030f3e2520b38f2271c8b260ac886c38 Ethereum Solidity: Smart contract
  22. 22. 22 Public Blockchain vs Private Blockchain Hyperledger Fabric: Chaincode - Access Control (.acl), Deploy Changes http://composer-playground.mybluemix.net/
  23. 23. 23 Public Blockchain vs Private Blockchain Hyperledger Composer: Historian Record
  24. 24. 24 Hyperledger Fabric ICO? Utility Token vs Security Token Utility Token Security Token • There is no crypto currency in Hyperledger Fabric Project • However, you can create utility token. (Not necessary)
  25. 25. 25 Why Private Blockchain? Only TPS(Transactions Per Second)? DAG (Wikipedia, 2018)Ethereum Plasma Network (Buterin, 2017) • There are too many projects to increase TPS on public blockchain. • Ethererum Plasama Network, Sharding, DAG(Directed Acyclic Graph)
  26. 26. 26 Why Private Blockchain? Data Governance & Permission control • How to run data business on public blockchain? • How about GDPR? If some of your customers were European?
  27. 27. 27 Off-chian : Why we have to consider off-chain model
  28. 28. 28 Global Citizen : Management of donation for philanthropy
  29. 29. 29 IBM BaaS : Blockchain as a Service 2018-07-31 Update! Starter Plan support Hyperledger Fabric V1.1 (Formerly V0.6)
  30. 30. 30 Create blockchain service via IBM Cloud https://console.bluemix.net/developer/blockchain/dashboard
  31. 31. 31 IBM BaaS : Blockchain as a Service Starter Plan offer the $500 credit per account using BaaS https://www.ibm.com/blogs/blockchain/2018/06/by-developers-for-developers-the-ibm-blockchain-platform-starter-plan/
  32. 32. 32 IBM BaaS : Blockchain as a Service Price plan (Monthly based)
  33. 33. 33 Build Your First Network (BYFN) : Local https://github.com/jgkong/BlockchainNetwork-CompositeJourney/blob/jgkong-korean/README-ko.md If you have issue on IBM Cloud Account, try following tutorial
  34. 34. 34 Global Citizen with IBM BaaS https://github.com/yunho0130/global-citizen/blob/master/README-ko.md
  35. 35. 35 Global Citizen with IBM BaaS https://developer.ibm.com/kr/?post_type=pnext_journey&p=16191&preview=true
  36. 36. 36 Global Citizen with IBM BaaS https://developer.ibm.com/kr/?post_type=pnext_journey&p=16191&preview=true Flow
  37. 37. 37 Global Citizen: Composer model
  38. 38. 38 Global Citizen: Composer REST API
  39. 39. 39 Understanding Hyperledger Fabric
  40. 40. 40 Hyperledger Fabric V1.1 Hyperledger Fabric protocol (Sousa, 2017)
  41. 41. 41 Hyperledger Fabric V1.1 Hyperledger Fabric: Smartcontract (IBM, 2018)
  42. 42. 42 Hyperledger Fabric V1.1 A Fabric network with federated MSPs and running multiple (Androulaki, 2018) - gossip: 이벤트를 성공했는지 실패했는지를 체크할 수 있는 event listener와 같은 역할 - MSP: Membership Service Provider - Privacy through Channel: 네트워크간에도 참여자를 제한할 수 있는 채널 방식.
  43. 43. 43 Hyperledger Fabric : Smart contract
  44. 44. 44 Summary of a Hyperledger Fabric Block - txPayload=<operation, metadata>: 작업operation에 대한 argument나 데이터.
  45. 45. 45 Hyperledger Composer https://hyperledger.github.io/composer/latest/introduction/introduction
  46. 46. 46 How Composer Maps to Fabric Chaincode – Each Business Network is deployed to its own chaincode container – Container contains a static piece of Go chaincode that starts a Javascript virtual machine running transaction processors – Browse these containers to view diagnostic information (docker logs) – Embedded chaincode is not a Composer external interface Composer Client Fabric Client Composer Chaincode (Go) Composer Runtime (JS) End-User Code (JS) Fabric Shim (Go) Duktape JS VM Hyperledger Fabric Peer Events
  47. 47. 47 Technical Deep dive into Consensus
  48. 48. 48 Sample transaction: Step 1/7 – Propose transaction Application proposes transaction Endorsement policy: • “E0, E1 and E2 must sign” • (P3, P4 are not part of the policy) Client application submits a transaction proposal for Smart Contract A. It must target the required peers {E0, E1, E2} E0 E1 E2 Client Application SDK Endorser Ledger Committing Peer Application Ordering Node Smart Contract (Chaincode) Endorsement Policy Key: Hyperledger Fabric Network Ordering-Service O O O OP P4P3 A B A B A B A D Endorse Order Validate
  49. 49. 49 Sample transaction: Step 2/7 – Execute proposal Endorsers Execute Proposals E0, E1 & E2 will each execute the proposed transaction. None of these executions will update the ledger Each execution will capture the set of Read and Written data, called RW sets, which will now flow in the fabric. Transactions can be signed & encrypted Key: Hyperledger Fabric Network Ordering-Service Endorser Ledger Committing Peer Application Ordering Node Smart Contract (Chaincode) Endorsement Policy O O O O E0 E1 E2 P P4P3 A B A B A B A D Client Application SDK Endorse Order Validate
  50. 50. 50 Sample transaction: Step 3/7 – Proposal Response Application receives responses RW sets are asynchronously returned to application The RW sets are signed by each endorser, and also includes each record version number (This information will be checked much later in the consensus process) Key: Hyperledger Fabric Network Ordering-Service Endorser Ledger Committing Peer Application Ordering Node Smart Contract (Chaincode) Endorsement Policy O O O O E0 E1 E2 P P4P3 A B A B A B A D Client Application SDK Endorse Order Validate
  51. 51. 51 Sample transaction: Step 4/7 – Order Transaction Responses submitted for ordering Application submits responses as a transaction to be ordered. Ordering happens across the fabric in parallel with transactions submitted by other applications (other applications) Key: Hyperledger Fabric Network Ordering-Service Endorser Ledger Committing Peer Application Ordering Node Smart Contract (Chaincode) Endorsement Policy O O O O E0 E1 E2 P P4P3 A B A B A B A D Client Application SDK Endorse Order Validate
  52. 52. 52 Sample transaction: Step 5/7 – Deliver Transaction Hyperledger Fabric Network Ordering-Service Orderer delivers to committing peers Ordering service collects transactions into proposed blocks for distribution to committing peers. Peers can deliver to other peers in a hierarchy (not shown) Different ordering algorithms available: • SOLO (Single node, development) • Kafka (Crash fault tolerance) O O O O * Key: Endorser Ledger Committing Peer Application Ordering Node Smart Contract (Chaincode) Endorsement Policy E0 E1 E2 P P4P3 A B A B A B A D Client Application SDK Endorse Order Validate
  53. 53. 53 Sample transaction: Step 6/7 – Validate Transaction Hyperledger Fabric Network Ordering-Service Committing peers validate transactions Every committing peer validates against the endorsement policy. Also check RW sets are still valid for current world state Validated transactions are applied to the world state and retained on the ledger Invalid transactions are also retained on the ledger but do not update world state Endorser Ledger Committing Peer Application Ordering Node Smart Contract (Chaincode) Endorsement Policy Key: O O O O E0 E1 E2 P P4P3 A B A B A B A D Client Application SDK * * * * * Endorse Order Validate
  54. 54. 54 Sample transaction: Step 7/7 – Notify Transaction Client Application SDK Hyperledger Fabric Network Ordering-Service Committing peers notify applications Applications can register to be notified when transactions succeed or fail, and when blocks are added to the ledger Applications will be notified by each peer to which they are connected! ! ! ! ! ! Key: Endorser Ledger Committing Peer Application Ordering Node Smart Contract (Chaincode) Endorsement Policy O O O O E0 E1 E2 P P4P3 A B A B A B A D Endorse Order Validate
  55. 55. 55 Assets, Participants and Transactions Vehicle Vehicle Listing AuctioneerMember Place Offer Close Bidding Transaction Processors
  56. 56. 56 The blockchain developer Ledger … Blockchain Developer D f(abc); Smart Contract Blockchain developers’ primary interests are… They should NOT have to care about operational concerns, such as: Peers Consensus …and how they interact with the ledger and other systems of record: Systems IntegrationEvents ! Traditional Data Sources Traditional Processing Platforms Application X Security - Developer: 비즈니스 로직과 어플리케이션 만드는 사람.
  57. 57. 57 The blockchain operator Blockchain Operator O Blockchain operators’ primarily interests are in the deployment and operation of part of the blockchain: They should NOT have to care about development concerns, such as: Application code Smart contract code Peers Consensus ü Security X - Operator: 네트워크 자체를 운영하고 관리하는 사람.
  58. 58. 58 Summary of Key Roles Blockchain Developer D Blockchain Operator O Peers Consensus ü Security Systems IntegrationEvents ! Ledger … Traditional Data Sources Traditional Processing Platforms f(abc); Smart Contract Application Blockchain Architect A Business concerns $ Design Tradeoffs
  59. 59. 59 Workflow (NSC -> BSC -> End User) Network Service Consumer End user End-User Identity issues Connection profile creates refers toBusiness Service Consumer Identity issues Business Network Card (Connection profile + Business Service customizes and deploys Hyperledger Fabric Peer Chaincode container Ledger … Asset Registry Participant Registry Transaction Registry Identity Registry packages Business Network Archive Smart Contract Logic Business Service Consumer connects hosts Business Logic REST Interface Business App Integration Logic
  60. 60. 60 Hyperledger Fabric v1.2 and next version
  61. 61. 61 New! Hyperledger Fabric v1.2 •Private Data Collections: A way to keep certain data/transactions confidential among a subset of channel members. We also have an architecture document on this topic which can be found here. •Service Discovery: Discover network services dynamically, including orderers, peers, chaincode, and endorsement policies, to simplify client applications. •Access control: How to configure which client identities can interact with peer functions on a per channel basis. •Pluggable endorsement and validation: Utilize pluggable endorsement and validation logic per chaincode. https://hyperledger-fabric.readthedocs.io/en/release-1.2/whatsnew.html
  62. 62. 62 Consensus Mechanism Hyperledger Fabric Next version?: RAFT State transition of participant peers (Ha, 2017)Official document of Hyperledger fabric v1.2 (Hyperledger Foundation, 2018)
  63. 63. 63 Consensus Mechanism Summary of the single-decree Paxos consensus protocol(Ongaro, 2014) Paxos Algorithm : To understand the RAFT Common patterns for using a single replicated state machine(Ongaro, 2014)
  64. 64. 64 Consensus Mechanism Process for dynamic configuration of participant peers (Ha, 2017) Hyperledger Fabric Next version?: RAFT
  65. 65. 65 Consensus Mechanism RAFT Algorithm Summary (Ongaro, 2014) Hyperledger Fabric Next version?: RAFT
  66. 66. 66 Consensus Mechanism RAFT Algorithm Summary (Ongaro, 2014)
  67. 67. 67 Save the world with your code! Make your idea into reality
  68. 68. 68 Writing whitepaper & Making actual product! Right Now You don’t need to wait the main net launching or don’t lose your way to build DApp! You can use your familiar language with SDK! Chaincode (smart contracts) in Go or Node.js, Java, SDKs in Node.js, Java, Go, REST and Python(Hyperledger wiki,2018).
  69. 69. 69 Blockchain Use-Case Template Description of the Business Problem: 비즈니스 문제 List of Participants / Roles: 참가자 리스트와 역할 Description of Transactions: 트랜잭션에 대해 기술 Blockchain MVP Use Case Description: 최소기능제품MVP의 사용 예시 Types of Assets and Description: 자산의 유형
  70. 70. 70 Writing whitepaper & Making actual product! Right Now http://composer-playground.mybluemix.net/login?ref=web-%24default#deploy
  71. 71. Group Name / DOC ID / Month XX, 2018 / © 2018 IBM Corporation 71
  72. 72. 72 Register Call for code
  73. 73. 73 Register Call for code
  74. 74. 74 IBM Blockchain Foundation Developer Badge https://www.coursera.org/learn/ibm-blockchain-essentials-for-developers https://www.youracclaim.com/user/yunho-maeng
  75. 75. 75 Awesome Blockchain Kor : More examples https://github.com/yunho0130/awesome-blockchain-kor
  76. 76. 76 References 1. Androulaki, E., Barger, A., Bortnikov, V., Cachin, C., Christidis, K., De Caro, A., ... & Muralidharan, S. (2018, April). Hyperledger fabric: a distributed operating system for permissioned blockchains. In Proceedings of the Thirteenth EuroSys Conference (p. 30). ACM. 2. Hyperledger Foundation(2017) Fabric official release note v1.1 : Architecture Explained, https://hyperledger-fabric.readthedocs.io/en/release-1.1/arch- deep-dive.html 3. Hyperledger wiki (2018) Hyperledger Fabric: Key Characteristics, https://wiki.hyperledger.org/projects/Fabric 4. Ongaro, D. (2014). Consensus: Bridging theory and practice (Doctoral dissertation, Stanford University). https://purl.stanford.edu/qr033xr6097 5. Poon, J., & Buterin, V. (2017). Plasma: Scalable autonomous smart contracts. White paper. 6. Sousa, J., Bessani, A., & Vukolić, M. (2017). A byzantine fault-tolerant ordering service for the hyperledger fabric blockchain platform. arXiv preprint arXiv:1709.06921. 7. Yeoun-Ui Ha, Jae-Hwan Jin, & Myung-Joon Lee. (2017). Raft-D: A Consensus Algorithm for Dynamic Configuration of Participant Peers. Asia-pacific Journal of Multimedia Services Convergent with Art, Vol 7, 267-277, http://www.sersc.org/journals/AJMAHS/vol7_no2_2017/27.pdf 8. IBM (2017.11) IBM 블록체인 플랫폼 기술개요 (Kr-whitepaper-external), https://www-01.ibm.com/common/ssi/cgi- bin/ssialias?htmlfid=00013800KRKO 9. IBM (2018.02) 블록체인-IBM Systems 관점에서 본 효용 가치와 실행 시스템, https://www-01.ibm.com/common/ssi/cgi- bin/ssialias?htmlfid=LUS12348KRKO 10. IBM (2018) LinuxONE 블록체인 보안 인포그래픽, https://www-01.ibm.com/common/ssi/cgi-bin/ssialias?htmlfid=LU912346KRKO 11. IBM(2018), SPRI FORUM: 하이퍼레저 패브릭 구조 및 주요 구축사례
  77. 77. 77 IBM Watson & Cloud Platform Technical Service Professional Yunho Maeng 맹윤호 yunhomaeng@kr.ibm.com Blockchain : Hyperledger Fabric Q & A

×