Professional Documents
Culture Documents
www.blockchaintrainingalliance.com
Who is this course for?
Some metadata:
A version number of the block format
A link to the previous block that came immediately before it
Merkle root of all the transactions in the block
Timestamp of when the block was created
Mining difficulty (more about this later)
Nonce for proof-of-work (more about this later)
All the data of the 25 transactions recorded in this block
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3 4 5
Top hash
Kafka / Proof of
BFT / PBFT
Zookeeper Elapsed Time
most efficient
Miners try to guess the “nonce”
All block data plus the current guess (nonce) are run
centralization
Blockchain is about de-centralization
The most space you ‘stake’ the better your odds of being
actors
Proof of Authority
Uses a set of “authorities” – nodes that are explicitly allowed to
ii) Decentralized
Public vs Private
Who can write data to the Blockchain?
Public – everyone can add a record
Private – only certain participants can write data
Open vs Closed
Who can read data from the Blockchain?
Open – everyone can read Blockchain data
Closed – only certain participants can read data
Hyperledger vs Ethereum
These are discussion points, NOT absolutes
Ethereum
Music and content distribution
Digital currency or asset-backed token
Blockchain-enabled mobile data service
Gambling and on-line gaming
Authoring, editing, and amending a piece of legislation
Group consensus is needed/required
Hyperledger vs Ethereum
These are discussion points, NOT absolutes
Hyperledger
Supply Chain
Supplier / Manufacturer inventory management
Managing internal business processes across
geographically distributed locations
Allowing elected officials to vote on initiatives without
being present
Public
Public & Closed Public & Open
• Voting • Currencies
• Voting records • Betting
• Whistleblowers • Video games
Closed Open
31
32
Why?
37
What?
What?
What?
complex)
What?
What?
43
What?
What?
45
R Regulator
U
B2B Blockchain
performs transactions User
A
oversight
Blockchain
Architect
designs ✓
Membership
D Blockchain accesses
security
Services
Blockchain
creates certificates
Developer
applications
access to
operates data Traditional
Data
access to logic Sources
O
Blockchain
Traditional
Network
Processing
Operator
Platforms 3
Blockchain Responsible for the architecture and design of the blockchain solution
A
Architect
The business user, operating in a business network. This role interacts with the Blockchain using an
Blockchain application. They are not aware of the Blockchain.
U
User
The overall authority in a business network. Specifically, regulators may require broad access to
Blockchain
R the ledger’s contents.
Regulator
Blockchain The developer of applications and smart contracts that interact with the Blockchain and are
D used by Blockchain users.
Developer
Blockchain Manages and monitors the Blockchain network. Each business in the network has a Blockchain
Operator
O Network operator.
Membership Manages the different types of certificates required to run a permissioned Blockchain.
✓
Services
Traditional
An existing computer system which may be used by the Blockchain to augment processing. This
Processing
system may also need to initiate requests into the Blockchain.
Platform
Traditional An existing data system which may provide data to influence the behavior of smart contracts.
Data
Sources
D
Blockchain Application Smart
Ledger
Developer Contract
f(abc); …
Traditional Systems
Traditional
Processing Events Integration
O Platforms
Data
Blockchain
Sources !
Operator
A
Blockchain Business Design
Architect concerns Tradeoffs
Application Smart
Contract
f(abc);
…and how they interact with the ledger and other systems of record:
Client
Blockchain develops
Application
developer D
SDK
develops submits
Smart emits
Contract !
event
accesses
Ledger
block
emits
txn txn
!
event
World state txn
Blockchain
Peer
• Toolsets
• Composer
• Tool for building blockchain business networks and smart contracts.
• Quilt
• Toolset for platform interoperability.
• Explorer
• Used to view or query blocks and transaction history data on the ledger.
• Caliper
• Blockchain benchmarking and performance tuning tool.
• Cello
• Toolset for deploying blockchain infrastructure as a service.
• “Public” vs “Private”
• Ethereum vs Hyperledger
• Anonymity vs Identity
• Permissionless vs Permissioned
• Native currency vs no currency
• Native ability to create coins/tokens vs. creating coins/tokens from scratch
• Currency does not provide incentive in Hyperledger solutions
‣ Developed open-source, by IBM and others (DAH, State Street, HACERA ...)
– github.com/Hyperledger/fabric
– Initially called 'openblockchain' and contributed by IBM to Hyperledger project
– Key technology for IBM's blockchain strategy
– Actively developed, IBM and IBM Zurich play key roles
‣ Technical details
– Programmable, replicated, sharded blockchain state machine; implemented in GO
– Runs smart contracts or "chaincode" within Docker containers
9– Implements consortium blockchain using traditional consensus (BFT,
Kafka/ZooKeeper)
• Permissioned Network
• Confidential Transactions
• No cryptocurrency
• Programmable
‣ "Solo orderer"
– One host only
– Used in development scenarios
External-CA Fabric-CA
Membership optional
optional
Services Admin
Peer
Client SDK
Endorser
Application (HFC)
Committer
O O Ledger
Chaincode
A
B
O O Events !
Ordering-Service
Hyperledger Fabric Network
• All Blockchains have nodes. They form the blockchain and connect to other
nodes
• In blockchain - the nodes are peer to peer (distributed)
• In permissionless networks (BTC and ETH) - ALL NODES ARE EQUAL
E0 P3 P4 Endorsement policy:
A
B
A • “E0, E1 and E2 must sign”
D
• (P3, P4 are not part of the policy)
Client
Application
S
D E1 Client application submits a transaction
proposal for Smart Contract A. It must
O O
K
A
B target the required peers {E0, E1, E2}
O O
Key:
P
E2 Endorser Ledger
A
B
Ordering-Service Committing Peer Application
Endorsers Execute
Proposals
E0 P3 P4 E0, E1 & E2 will each execute the
A A proposed transaction. None of these
B D
executions will update the ledger
O O
Key:
P
E2 Endorser Ledger
A
B
Ordering-Service Committing Peer Application
O O
Key:
P
E2 Endorser Ledger
A
B
Ordering-Service Committing Peer Application
O O
Key:
P
E2 Endorser Ledger
A
B
Ordering-Service Committing Peer Application
on
E2
P
O O thEnedolresedr ger but do not update
A state
Lwedogerrld
B
* Ordering-Service Committing Peer Application
!
E0 P3 P4 Applications can register to be notified
A A when transactions succeed or fail, and
B D
when blocks are added to the ledger
O O
Key:
P
! E2 Endorser Ledger
A
B
Ordering-Service Committing Peer Application
90
LevelDB
119
Infrastructure
Participant
E1 E3 Key:
Endorser Ledger
A Ordering-Service A
B B
Committing Peer Application
Hyperledger Fabric
Ordering Node
Client
Application
S
D
K
E O E3 Key:
Endorser Ledger
Ordering-Service
1
A Y
O
B Z
Committing Peer Application
Hyperledger Fabric
Ordering Node
E E
O O
E P E
O O O O
Ordering Service Ordering Service
E E
Blockchain Network Blockchain Network
1 2
• Peers will be able to connect to channels
served by different ordering services.
E E
O P O
E E
O O P O O
Ordering Service Ordering Service
E E
Blockchain Network Blockchain Network
1 2
Orderin
O • Peers will be able to connect to
g
Service channels served by different
ordering services.
O O
Peer
• The peer is not connecting the three
E E E blockchain networks but is
Endorser maintaining a ledger for different
channels.
Orderer
E E
E E E
E P E
E
P
P
E
P
E E
E P P E
E
Peer
E E
Endorser
E E E
Orderering E
Service
Bridges simply from Develop blockchain Well tested, efficient Higher level
business concepts to applications more design conforms to abstraction makes it
blockchain quickly and cheaply best practice easier to iterate
• Business Network
• A collection of entities or organizations working together to accomplish a
common goal.
• A Business Network is made up of Participants.
• Business Networks work with Assets.
• Assets
• Assets have Properties
• Assets can be tangible or intangible
• Intangible assets can include:
• Financial Assets (bonds)
• Intellectual Assets (patent)
• Digital Assets (music)
• Assets are mutable, most often have a finite lifespan
• Assets can be created, read, updated, and deleted
• Represented by JSON object
• Participants
• Participants have Properties
• Humans
• Organizations
• LOB Systems
• Participants are mutable, most often have a finite lifespan
• Participants can be created, read, updated, and deleted
• Transactions
• Defines how a participant can interact with an asset
• Transactions are the intersection of Assets and Participants
• Typically involves updating a property of an asset
• Logic implemented via chaincode (smart contract)
• Chaincode written in JavaScript
• Transaction data (The Ledger) is permanent
• Records can be created or read, cannot be edited or deleted
• Queries
• Defines how data in a solution will be viewed/presented
• Permissions
• Defines who can do what in a solution
• Events
• Pub/Sub model
• Events can be subscribed to by any application, not just the app that caused
the event
Ledger A ledger is a channel’s chain and current state data which is maintained by each peer on the
…
channel.
f(abc); Software running on a ledger, to encode assets and the transaction instructions (business
Smart Contract logic) for modifying the assets.
A broader term overarching the entire transactional flow, which serves to generate an
Peer
agreement on the order and to confirm the correctness of the set of transactions constituting a
Network
block.
Events ! Creates notifications of significant operations on the blockchain (e.g. a new block), as well as
notifications related to smart contracts.
Systems i Provides the ability to create, change and monitor blockchain components
Management
Systems Responsible for integrating Blockchain bi-directionally with external systems. Not part of
Integration blockchain, but used with it.
• In computing, an event is an occurrence that can trigger handlers txn txn txn
– e.g. disk full, fail transfer completed, mouse clicked, message received, !
temperature too hot… New
txn
Application
20
4
2. Blockchain
1. System
events
! events
! Existing
systems
Transform
Blockchain network
Existing
systems
20
5
E2 Endorser Ledger
A
B
Ordering-Service Committing Peer Application
Ordering-Service
Hyperledger Fabric
• An Ordering Service is configured and started for other network peers to use
E E
0 2
E Ordering-Service
P4
1
Hyperledger Fabric
• A peer is configured and started for each Endorser or Committer in the network
E E
0 A
B 2 A
B
E Ordering-Service
P4
1 A
B
Hyperledger Fabric
E E
0 A
B 2 A
B
E Ordering-Service
P4
1 A
B
Hyperledger Fabric
E E
0 A
B 2 A
B
E1 P
Ordering-Service 4
A
B
Hyperledger Fabric
• Peers that are permissioned can then join the channels they want to transact on
E E
0 A
B 2 A
B
E1 P
4 Ordering-Service
A
B
Hyperledger Fabric
• Peers finally instantiate the Chaincode on the channels they want to transact on