10. Final State of Sample Network
CASE-FAST
FAST-NUST
CASE
Student
NUST
Student
FAST Student
CASE/FAST
Registration
FAST/NUST
Registration
HEC
R1: CASE
R2: FAST
R3: NUST
R4: HEC
11. Hyperledger Fabric
• Organizations R1, R2, R3 and R4 contribute infrastructure to the network
• The organizations have jointly decided, that they will set up a Hyperledger Fabric
network.
• R4 has been assigned to be the network initiator
• it has been given the power to set up the initial version of the network.
• R4 has no intention to perform business transactions on the network.
• R1 and R2 have a need for a private communications within the overall network, as do R2 and R3.
• Organization R1 has a client application that can perform business transactions within channel C1.
• Organization R2 has a client application that can do similar work both in channel C1 and C2.
• Organization R3 has a client application that can do this on channel C2.
12. Setting Blockchain Network
• CASE, FAST, NUST, HEC
• HEC is the Initiator
•R1 -> CASE
•R2 -> FAST
•R3 -> NUST
•R4-> HEC
13. Hyperledger Fabric
• Organizations CASE, FAST, NUST and HEC contribute infrastructure to the network
• The organizations have jointly decided, that they will set up a Hyperledger Fabric
network.
• HEC has been assigned to be the network initiator
• it has been given the power to set up the initial version of the network.
• HEC has no intention to perform business transactions on the network.
• CASE and FAST have a need for a private communications within the overall network, as do FAST
and NUST.
• Organization CASE has a client application that can perform business transactions within channel
C1.
• Organization FAST has a client application that can do similar work both in channel C1 and C2.
• Organization NUST has a client application that can do this on channel C2.
14. Hyperledger Fabric
• Peer node P1 maintains a copy of the ledger L1 associated with C1.
• Peer node P2 maintains a copy of the ledger L1 associated with C1 and a
copy of ledger L2 associated with C2.
• Peer node P3 maintains a copy of the ledger L2 associated with C2.
• Channel C1 is governed according to the policy rules specified in channel
configuration CC1
• The channel is under the control of organizations R1 and R2.
• Channel C2 is governed according to the policy rules specified in channel
configuration CC2
• the channel is under the control of organizations R2 and R3.
15. Hyperledger Fabric
• There is an ordering service O4 that services as a network administration
point for N, and uses the system channel.
• The ordering service also supports application channels C1 and C2, for the
purposes of transaction ordering into blocks for distribution
• Each of the four organizations has a preferred Certificate Authority.
16. Who gives permission? MSP
• The members of a Hyperledger Fabric
network enroll through a trusted
Membership Service Provider (MSP)
17. Channels
• Ability to create channels, allowing a group
of participants to create a separate ledger of
transactions
18. Smart Contract
• Hyperledger Fabric smart contracts are
written in chaincode
• They are invoked by an application external
to the blockchain
•when that application needs to interact with
the ledger
22. Blockchain Nodes
• Consists of three different types of nodes
1. Peer
2. Orderer
3. Client
•All nodes are identified by a Membership
Service Provider (MSP) and owned by
different organizations
23. Nodes
•Client submits transactions
•Peer maintains the blockchain ledger in the form
of a hash chain and records the current state
with a key-value store
•Endorser is responsible for executing chaincode
to endorse transaction proposals
•Committer just updates the ledger state by
validating and committing transactions
24. Orderer
•Orderer implements the ordering service
•produces the total sequence for all the
transactions and batch them into blocks
25. Endorsement policy
•The endorsement policy specifies a set of peers
that are required to endorse transaction
proposals
•Transactions are marked as valid only if they
have been properly endorsed by specified peers
based on the endorsement policy
•It is formed by the monotone logical expression
on sets, such as “AND” and “OR”.
26. Ledger
•In Fabric, a ledger consists of two parts
•world state
•blockchain
•World state holds the latest ledger state in
the form of a versioned key-value store
•The blockchain ledger is maintained by all
peers,
27. Channel
•Channel is a logical structure formed by a collection
of specific network members
•Each channel allows a group of peers to create a
completely separate ledger
•In Fabric, a subset of organizations that want to
conduct business transactions privately can
generate a channel, thus maintaining a partition
ledger
•One organization can join multiple channels
simultaneously for a distinct purpose
28. Processing of Transaction
Hyperledger Fabric has three major stages in processing a transaction, namely, endorsing, ordering/batching
and validating/committing
33. A peer hosts instances of ledgers and instances of chaincodes
34. Key-Value Pair
•A key-value pair consists of two related data
elements
•A key, which is a constant that defines the data
set (e.g., gender, color, price)
• A value, which is a variable that belongs to the
set (e.g., male/female, green, 100)
37. World State
• An application program can invoke a smart
contract which uses simple ledger APIs
to get, put and delete states.
•Notice how a state value can be simple (Audi…)
or compound (type:BMW…)
•The world state is often queried to retrieve
objects with certain attributes, for example to
find all red BMWs
38. World State
Only transactions that are signed by the
required set of endorsing organizations will
result in an update to the world state
40. •The ledger, L, comprises a world state, W and
a blockchain, B. W contains four states with
keys: ASSET1, ASSET2, ASSET3, and ASSET4.
B contains two blocks, 0 and 1. Block 1
contains four transactions: T1, T2, T3, T4
52. A Peer with Multiple Ledgers
• A peer hosting multiple ledgers.
• Peers host one or more ledgers, and each
ledger has zero or more chaincodes that
apply to them.
Peer P1 hosts ledgers L1 and L2.
Ledger L1 is accessed using chaincode S1
Ledger L2 can be accessed using chaincodes S1 and S2.
53. A peer may have many ledger and chaincode
• Peer P1 hosts ledgers L1 and L2
• L1 is accessed by chaincodes S1 and S2,
L2 is accessed by S1 and S3.
• S1 can access both L1 and L2.
55. Peers and Channels
Channels allow a specific set of peers and applications to communicate with each other within a blockchain network.
application A can communicate directly with peers P1 and P2 using channel
56. Peers and Organizations
• Four organizations contributing eight peers to form a network.
• The channel C connects five of these peers in the network N — P1, P3, P5, P7 and P8.
• The other peers owned by these organizations have not been joined to this channel, but are typically joined to at
least one other channel.
57. Peers and Identity
• P1 and P2 have identities issued by CA1
• Channel C determines from a policy in its channel configuration that identities from CA1 should be associated with Org1
using ORG1.MSP.
• Similarly, P3 and P4 are identified by ORG2.MSP as being part of Org2.
58. Peers and Orderers
•An update transaction is quite different from a query
transaction because a single peer cannot, on its own,
update the ledger
•updating requires the consent of other peers in the
network.
•This process is called consensus, which takes much longer
to complete than a simple query.
•But when all the peers required to approve the
transaction do so, and the transaction is committed to the
ledger, peers will notify their connected applications that
the ledger has been updated.
84. •A blockchain would not replace the broad range
of transaction-processing, accounting, and
management-control functions performed by
ERP systems, such as invoicing, payment, and
reporting.
Blockchain and ERP
85. •The blockchain would interface with legacy
systems across participating firms.
•Each firm would generate blocks of transactions
from its internal ERP system and add them to the
blockchain.
•This would make it easy to integrate various flows
of transactions across firms.
Blockchain and ERP