Hyperledger Fabric v1:

Similar documents
Hyperledger fabric: towards scalable blockchain for business

A Byzantine Fault-Tolerant Ordering Service for the Hyperledger Fabric Blockchain Platform

Blockchain, cryptography, and consensus

CONSENSUS PROTOCOLS & BLOCKCHAINS. Techruption Lecture March 16 th, 2017 Maarten Everts (TNO & University of Twente)

Blockchain for Enterprise: A Security & Privacy Perspective through Hyperledger/fabric

Cryptocurrency and Blockchain Research

SCP: A Computationally Scalable Byzantine Consensus Protocol for Blockchains

Distributed Ledger Technology & Fintech Applications. Hart Montgomery, NFIC 2017

Blockchain, cryptography, and consensus

Bitcoin and Blockchain

Hyperledger Fabric v1.0 Deep Dive. Binh Nguyen, IBM

Data Consistency and Blockchain. Bei Chun Zhou (BlockChainZ)

Blockchains & Cryptocurrencies

ENEE 457: E-Cash and Bitcoin

BlockFin A Fork-Tolerant, Leaderless Consensus Protocol April

Enhanced Immutability of Permissioned Blockchain Networks by Tethering Provenance with a Public Blockchain Network

ISSUSE AND FEATURES TO CONSIDER WHEN SELECTING A BLOCKCHAIN SYSTEM. Find us at

Resource-Efficient Mining (REM) with Proofs of Useful Work (PoUW)

GRADUBIQUE: AN ACADEMIC TRANSCRIPT DATABASE USING BLOCKCHAIN ARCHITECTURE

Hyperledger - Project Overview. January 2018

Physical Access Control Management System Based on Permissioned Blockchain

Transactions Between Distributed Ledgers

Candidates Day Modeling the Energy Consumption of. Ryan Cole Liang Cheng. CSE Department Lehigh University

A Blockchain-based Mapping System

Performance Benchmarking & Optimizing Hyperledger Fabric Blockchain Platform

hyperledger-fabricdocs Documentation

REM: Resource Efficient Mining for Blockchains

Using Chains for what They re Good For

Will Martino (me) Kadena

A Byzantine Fault-Tolerant Ordering Service for the Hyperledger Fabric Blockchain Platform

SmartPool: practical decentralized pool mining. Loi Luu, Yaron Velner, Jason Teutsch, and Prateek Saxena August 18, 2017

The power of Blockchain: Smart Contracts. Foteini Baldimtsi

The objectives of this project include the following. Note that students are expected to choose a subset of goals to fulfill:

Catena: Preventing Lies with

BBc-1 : Beyond Blockchain One - An Architecture for Promise-Fixation Device in the Air -

primechain building blockchains for a better world

A Lightweight Blockchain Consensus Protocol

EECS 498 Introduction to Distributed Systems

Table of Contents HOL EMT

IBM 开源技术微讲堂区块链和 HyperLedger 系列列

Algorand: Scaling Byzantine Agreements for Cryptocurrencies

Distributed Algorithms Bitcoin

Technical White Paper of. MOAC Mother of All Chains. June 8 th, 2017

Blockchain Frameworks

Ethereum. Campbell R. Harvey* Duke University and NBER. Ashwin Ramachandran Duke University. Brent Xu ConsenSys. Innovation and Cryptoventures

Analyzing the Effects of Network Latency on Blockchain Performance and Security Using the Whiteblock Testing Platform

SpaceMint Overcoming Bitcoin s waste of energy

Lecture 44 Blockchain Security I (Overview)

Hyperledger Architecture, Volume II Smart Contracts

What s new under the blockchain sun. HYPERLEDGER FABRIC AND A SHORT SURVEY OF INTERLEDGER. DIDIER PH MARTIN, PHD.

Who wants to be a millionaire? A class in creating your own cryptocurrency

ICS 421 & ICS 690. Bitcoin & Blockchain. Assoc. Prof. Lipyeow Lim Information & Computer Sciences Department University of Hawai`i at Mānoa

Alternative Consensus

The Transaction Graph for Modeling Blockchain Semantics

The Not-So-Short ZILLIQA Technical FAQ

Next Paradigm for Decentralized Apps. Table of Contents 1. Introduction 1. Color Spectrum Overview 3. Two-tier Architecture of Color Spectrum 4

CS 4770: Cryptography. CS 6750: Cryptography and Communication Security. Alina Oprea Associate Professor, CCIS Northeastern University

Blockchain. CS 240: Computing Systems and Concurrency Lecture 20. Marco Canini

Blockchain, Cryptocurrency, Smart Contracts and Initial Coin Offerings: A Technical Perspective

Lecture 3. Introduction to Cryptocurrencies

Introduction to Bitcoin I

Problem: Equivocation!

Fabric Development Update & Discussion. Binh Nguyen

Radix - Tempo. Dan Hughes Abstract

Computer Security. 14. Blockchain & Bitcoin. Paul Krzyzanowski. Rutgers University. Spring 2019

Security (and finale) Dan Ports, CSEP 552

Deconstructing Blockchains: Concepts, Systems, and Insights

BaFin-Tech 2018 BlockChain & Security (from #developerview)

BLOCKCHAIN CADEC Pär Wenåker & Peter Larsson

Nervos CKB: A common knowledge base for blockchains and applications

Solida: A Blockchain Protocol Based on Reconfigurable Byzantine Consensus

Lessons Learned from running Hyperledger Demos on z/vm Linux. Yongkook(Alex) Kim Vicom Infinity June 23 rd 2017 Ohio State University

Blockchain! What consultants should know about it. Daniel

Ergo platform. Dmitry Meshkov

Blockchain Basics A. Introduction B. Key Properties

Blockchain (a.k.a. the slowest, most fascinating database you ll ever see)

PBFT vs Proof-of-Authority: Applying the CAP Theorem to Permissioned Blockchain

Blockchain Beyond Bitcoin. Mark O Connell

Untangling Blockchain: A Data Processing View of Blockchain Systems

Introduction to Cryptoeconomics

D3.2 Specification of security enablers for data management

The security and insecurity of blockchains and smart contracts

Block Gas Limits vs. Transactional Throughput: A Performance Analysis of the Ubiq Platform

Abstraction: Distributed Ledger

Radix - Tempo. Dan Hughes

Flowchain: A case study on building a Blockchain for the IoT

BLOCKCHAIN ARCHITECT Certification. Blockchain Architect

The Use of Blockchain Technology in Smart Contracts

Distributed Ledger With Secure Data Deletion

Technical Analysis of Established Blockchain Systems

Blockchain & Distributed Internet Infrastructure

POLARIS ADAPTIVE STATE SHARDING TECHNOLOGY, A SECURE SHARDING PROTOCOL FOR BLOCKCHAINS.

hard to perform, easy to verify

Proof of Stake Made Simple with Casper

The game If you listen very carefully during the first 4 cards (or use the cheat sheet) you will get an advantage on the last 5 cards

hyperledger-fabricdocs Documentation

Hyperledger. Blockchain Performance Metrics. About This Paper ABOUT HYPERLEDGER

EVALUATION OF PROOF OF WORK (POW) BLOCKCHAINS SECURITY NETWORK ON SELFISH MINING

Viacoin Whitepaper. Viacoin Dev Team September 12, Abstract

Blockchain & Smart Contracts Introduction. Dr. Sebastian Bürgel

Transcription:

Marko Vukolić, IBM Research - Zurich May 4, 2017 Hyperledger Fabric v1: Rethinking Permissioned Blockchains Blockchain: du Bitcoin au Smart Contract 4 Mai 2017 2017 IBM Corporation

What is a Blockchain? A chain (sequence, typically a hash chain) of blocks of transactions - Each block consists of a number of transactions Consensus protocol ensures ledger replicas are identical* #0 Genesis block #1 #234 #235 #236 Node F datastructure Node A Ledger Ledger Ledger Node E Node B Node D Ledger Ledger Ledger Node C Network of untrusted nodes 2

This talk How a set of seemingly simple functional requirements implied blockchain design overhaul? Hyperledger Fabric v1 3

https://github.com/hyperledger https://www.hyperledger.org/ 4

Hyperledger Fabric key requirements No native cryptocurrency Ability to code smart-contracts in general-purpose languages Modular/pluggable consensus 5

2016 IBM Corporation Blockchain Architecture 101

Permissionless Blockchains Step 1: Block mining (PoW Consensus) Miner of block #237 Step 2: Block #237 propagation to the network (gossip) find nonces such that hash(block#237) =SHA256(A B C D) < DIFFICULTY #234 #235 #236 Transactions (payload) A =hash of block #236 B = Root hash of Merkle tree of tx hashes C = nonce 1 D = nonce 2 Block #237 Miner of block #237 Step 3: Block Validation / Smart Contract Execution (every miner) Validating transactions in the payload (executing smart contracts) Verifying hash of Block #237 < DIFFICULTY #234 #235 #236 Transactions (payload) A =hash of block #236 B = Root hash of Merkle tree of tx hashes C = nonce 1 D = nonce 2 7 ORDER using Consensus EXECUTE (input tx) (tx against smart contracts) Block #237

Permissioned blockchains Nodes (participants) need a permission (and identity) to participate in the blockchain network Motivation: business applications of blockchain and distributed ledger technology (DLT) Participant often need ability to identify other participants Participants do not necessarily trust each other Examples: Chain, Kadena, Tendermint, Ripple, Symbiont, and Hyperledger Fabric 8

Permissioned vs permissionless blockchains Membership management Pemissioneless: none Permissioned: node identities and membership need to be managed Consensus (system) performance Permissionless (PoW consensus): high latency, low throughput Permissioned (BFT consensus protocols): low latency, high throughput Seq #24 View no Tx1 Tx2 Tx3 Tx4 ORDER using Consensus EXECUTE (input tx) (tx against smart contracts) Node A (leader) Node B Node C Node D example: PBFT [Castro/Liskov02] #21 #22 #23 Tx1 Seq #24 View no Tx2 Tx3 Tx4 9

What are the issues with ORDER EXECUTE architecture (with HLF requirements in mind)? 10

Permissioned blockchain architecture issues Sequential execution of smart contracts long execution latency blocks other smart contracts, hampers performance DoS smart contracts (e.g., `while true { }`) How permissioneless blockchains cope with it: Gas (paying for every step of computation) Tied to a cryptocurrency Non-determinism Smart-contracts must be deterministic (otherwise state forks) How permissioneless blockchains cope with it: Enforcing determinism: Solidity DSL, Ethereum VM Cannot code smart-contracts in developers favorite general-purpose language (Java, golang, etc) Confidentiality of execution: all nodes execute all smart contracts Inflexible consensus: Consensus protocols are hard-coded 11

Hyperledger Fabric key requirements No native cryptocurrency Ability to code smart-contracts in general-purpose languages Modular/pluggable consensus Satisfying these requirements required a complete overhaul of the permissioned blockchain design! end result Hyperledger Fabric v1 12

Hyperledger Fabric v1 Architecture http://github.com/hyperledger/fabric 2016 IBM Corporation

HLF v1 architecture in one slide Existing blockchains architecture ORDER using Consensus EXECUTE (input tx) (tx against smart contracts) Hyperledger Fabric v1 architecture EXECUTE ORDER using Consensus VALIDATE (tx against smart contracts) (versioned state updates) (versions, execution attestations) 14

Step #1: Execute first Goals Paralelize execution (addresses sequential execution bottleneck) Partition execution (addresses confidentiality of execution) Remove non-determinism (prevent state forks due to non-determinism) Hyperledger Fabric v1 approach A subset of nodes called endorsers executes chaincode** Endorsers produce and sign versioned state updates Client library orchestrates collection of execution results ** HLF:chaincode ~ Ethereum:smart contract 15

Hyperledger Fabric v1 Transaction flow 1 <PROPOSE, clientid, chaincodeid, txpayload, timestamp, clientsig> 2 <TX-ENDORSED, peerid, txid, chaincodeid, readset, writeset> 1 Collect sufficient no. of TX-ENDORSED Msgs into an endorsement 2 Simulate/Execute tx Sign TX-ENDORSED client (C) endorsing peer (EP1) endorsing peer (EP2) endorsing peer (EP3)

Step 2: Order using Consensus Goal Order versioned state-updates to prevent inconsistencies/double spending Enforce consensus modularity Hyperledger Fabric v1 approach Make consensus modular Introduce ordering nodes (orderers) Order after Execute prevents inconsistencies due to non-determinism 17

Hyperledger Fabric v1 Transaction flow 1 <PROPOSE, clientid, chaincodeid, txpayload, timestamp, clientsig> 2 <TX-ENDORSED, peerid, txid, chaincodeid, readset, writeset> Total order semantics (HLF v1) 3 BROADCAST(blob) 4 DELIVER(seqno,prevhash,block) Collect sufficient no. of TX-ENDORSED Msgs into an endorsement broadcast(endorsement) 2 1 4 Simulate/Execute tx Sign TX-ENDORSED 3 Ordering service (consensus) client (C) endorsing peer (EP1) endorsing peer (EP2) endorsing peer (EP3) orderers

Hyperledger Fabric v1 Transaction flow 1 <PROPOSE, clientid, chaincodeid, txpayload, timestamp, clientsig> 2 <TX-ENDORSED, peerid, txid, chaincodeid, readset, writeset> Total order semantics (HLF v1) 3 BROADCAST(blob) 4 DELIVER(seqno,prevhash,block) Collect sufficient no. of TX-ENDORSED Msgs into an endorsement broadcast(endorsement) 2 1 4 Simulate/Execute tx Sign TX-ENDORSED 3 Ordering service (consensus) 4 client (C) endorsing peer (EP1) endorsing peer (EP2) endorsing peer (EP3) orderers (committing) peer (CP4) (committing) peer (CP5)

HLF Consensus HLF v1 consensus (ordering service) implementations Byzantine FT (SimpleBFT, variant of v0.6 PBFT, development in progress) Crash FT (KAFKA, thin wrapper around Kafka/Zookeeper) Centralized! (SOLO, mostly for development and testing) Many more to come BFT-SMaRt (University of Lisbon), Honeybadger BFT (UIUC), XFT (IBM) Perhaps also your favorite blockchain consensus? 20

Step #3: Validate after Ordering Goal Efficiently validate execution results from (potentially untrusted) endorsers Validate freshness of state updates (prevents asset double-spending) Hyperledger Fabric v1 approach All peers verify versions of state updates coming out of consensus All peers validate endorsers signatures against endorsement policy 21

Hyperledger Fabric v1 Transaction flow 1 <PROPOSE, clientid, chaincodeid, txpayload, timestamp, clientsig> 2 <TX-ENDORSED, peerid, txid, chaincodeid, readset, writeset> Total order semantics (HLF v1) 3 BROADCAST(blob) 4 DELIVER(seqno,prevhash,block) Collect sufficient no. of TX-ENDORSED Msgs into an endorsement (to satisfy endorsement Policy (EP)) 2 1 4 Simulate/Execute tx Sign TX-ENDORSED 3 Validate(readset) Validate(endorsement, chaincodeid, EP) Ordering service (consensus) 4 Validate(readset) Validate(endorsement, chaincodeid, EP) client (C) endorsing peer (EP1) endorsing peer (EP2) endorsing peer (EP3) orderers (committing) peer (CP4) (committing) peer (CP5)

HLF v1 Endorsement Policies Deterministic (!) programs used for validation Executed by all peers post-consensus Examples K out of N chaincode endorsers need to endorse a tx Alice OR (Bob AND Charlie) need to endorse a tx Cannot be specified by chaincode developers Can be parametrized by chaincode developers 23

HLF v1 Endorsement Policies and Execution Flow Endorsement Policy can, in principle, implement arbitrary program Hybrid execution model EXECUTE ORDER VALIDATE approach of HLF v1 Can be used to split execution in two EXECUTE (chaincode) can be non-deterministic VALIDATE(endorsement policy) must be deterministic 24

What about DoS, resource exhaustion? HLF v1 transaction flow is resilient* to non-determinism Hence, endorsers can apply local policies (non-deterministically) to decide when to abandon the execution of chaincode No need for gas/cryptocurrency! * EXECUTE ORDER VALIDATE: non-deterministic tx are not guaranteed to be live ORDER EXECUTE non-deterministic tx are not guaranteed to be safe (forks can occur) 25

2016 IBM Corporation Thank You!