Hyperledger
Georgios Pallikaras
1
Hyperledger Georgios Pallikaras 1 Overview History What is the - - PowerPoint PPT Presentation
Hyperledger Georgios Pallikaras 1 Overview History What is the Hyperledger? Components Transactions Comparison to Corda and Ethereum 2 02/12/2020 2 History Traditional model One business network Many transaction
1
02/12/2020 2
2
Traditional model
∙
One business network
∙
Many transaction records
New Technologies
∙
Digitalization
∙
Cloud
∙
Same old structure
3
What if instead of the old structure there is a new common, private network for businesses?
4
History In 2015 the linux foundation announced the hyperledger project Umbrella project
It is a platform that encourages a collaborative approach to developing blockchain technologies
5
What is the Hyperledger Fabric?
∙
Hyperledger is a cross-industry blockchain technology.
∙
Encourages businesses to create Private and Permissioned blockchain systems.
∙
Shared ledger
∙
Smart Contracts (GOlang, NodeJS, Java)
∙
Modularity
6
7
What actually stores? There is no specific currency in fabric
They can be anything: Real estate to contracts or just foods Represented as binary or in JSON format
8
9
How exactly it works? Key Words: 1. Organizations 2. Network 3. Ordering service 4. Policies 5. Certified authority 6. Membership Service Provider (MSP) 7. Consortium 8. Channels 9. Peers and Ledgers 10. Applications and Smart Contacts Which words do you think are the most important ones?
Did you notice?
10
In order to start an organization needs (R4) to create a network. A network is defined by the ordering service. O4 The R4 is the one who created the configuration that includes the policies applied to that network Ordering service? CA4? Later... Let’s Start...
11
What is the CA4? The network is private and permissioned. Every organization and its members that wants to join the network has to provide an digital identity. Digital identity: cryptographically validated digital certificates Provided by certificate authorities.
The mapping of certificates to member organizations is achieved by via a structure called Membership Service Provider.
Via PKI
12
Membership Service provider The MSP provides credentials to the clients. It is a structure that maps an organization to the certificate this organization holds. Because the private key (that the CA provides to an organization) can never be shared, the MSP is the mechanism that proves that the organization is the one that it claims to be. Authenticates, authorizes, and manages identities on a permissioned blockchain network
13
Continue... R1 can have administrative rights to the network as long as the NC4 configurations are updated by R4. Now both have administrative rights to the network even if O4 runs under R4 infrastructure
14
Consortium Some businesses may need to interact with each other. “A group with a shared destiny” In order to do that the administrators need to let those organizations join the network and then create a group called consortium. A consortium defines the set of organizations in the network who share a need to transact with one another But how do they interact?
15
Private Communication mechanism for consortium members
Admins allowed the creation of the channel. BUT 1. No participating in the channel unless R1 and R2 approve 2. No modification of CC1 policies What about O4?
16
Why they are important in the Hyperledger Fabric? It is a mechanism for private communication and private data amongst participants. “Free from the network” Data and infrastructure is isolated for the members.
17
18
Peer nodes are the network components where copies of the blockchain ledger are hosted. They join channels and they have identity. (P1 from CA1) Peer send join request to O4. O4 uses cc1 to determinate P1 permissions. Copy of the Ledger is physically stored in peers but in logically belongs to channels.
19
Smart contract defines the transaction logic. It is installed on peers and defined to the channel. The client application (A1) uses the channel to “interact” with the Ledger but only via the smart contract. Did you notice the word interact? Can someone interact with the Ledger?
20
Smart contracts continued After a smart contract is developed it can be installed in any peer node that belongs to the organization. No need to install in every node. In order for the other components of c1 to be able to interact with S5 the S5 should be instantiated into c1.
21
Each organization -that participates in the channel- needs to approve a chaincode definition, a set of parameters that establish how a chaincode will be used on a channel. Only then the smart contract can be used to interact with the ledger. Even if an application is connected to the channel and can access the ledger via the smart contract, it doesn’t mean that it can see the actual code written. This is private to the peer that the smart contract is installed to. The applications of the channel can see only an interface. Some important details about smart contracts and chaincode:
22
In Hyperledger Fabric, a ledger consists of two distinct parts – a world state and a blockchain.
current value of a state rather than checking the entire transaction log. The world state can change frequently, as states can be created, updated and deleted. (key-value pairs)
current the world state. It is immutable.
23
A ledger state records a set of facts about a particular business object. An application program can invoke a smart contract which uses simple ledger APIs to get, put and delete states. The world state is implemented as a database.
24
The blockchain is structured as sequential log of interlinked blocks, where each block contains a sequence of transactions, each transaction representing a query or update to the world state.
25
Endorsement policies describe which organizations (peers) must approve transactions before they will be accepted by other organizations onto their copy of the ledger. One last term before showing the transaction flow...
26
27
1. The client sends a transaction proposal to the endorsing peers(peers that need to “approve” the transaction). 2. Endorsing peers verify the identity of the client and the validity of the request and execute the transaction by invoking the chaincode. They do NOT apply changes to the ledger yet. 3. Peers get the results of the executed transaction and send a proposal response back to the
Phase 1 A1 P1 L S
Endorsement policy is used by the app to decide which peers should receive the proposal. This phase ends when the app has received enough signed responses from the peers.
28
The transaction consists of 1. Header (contains metadata such as the name of the chain code) 2. Signature (Cryptographic signatures that assures the integrity of the transaction details) 3. Proposal (input parameters from A1 to S1) 4. Response (captures the before and after values of the world state, as a Read Write set) 5. Endorsements (a list of signed transaction responses from each required organization sufficient to satisfy the endorsement policy)
29
1. The client sends a transaction proposal together with the response to the ordering service. 2. The ordering service orders the transaction in chronological order (by channel), without inspecting the transaction itself. 3. The OS arrange batches of submitted transactions into a well-defined sequence and package them into blocks. These blocks will become the blocks of the blockchain. Phase 2 A1 OS
30
1. After the block creation by the OS, the OS distributes the block to the peers in the channel. 2. The peers now verify the transactions in the block and append the block to their own ledger Phase 3 P1 OS P2
If not every peer is connected to the OS, gossip protocol is used. A peer will process each transaction in the sequence in which it appears in the block. Also note that this validation is different than the endorsement check in phase 1. In case the application violates the endorsement policy, the peer is still able to reject the transaction in phase 3.
31
Details about ordering service
channel
achieving consensus.
32
Pluggable consensus protocol In fabric we have deterministic consensus algorithms. The consensus protocol depends on the level of trust amongst the organization participating in the network. For example, if the system is operated by a trusted authority then an implementation
A better solution might be a crash fault tolerance approach. (raft, kafka)
Crash Fault Tolerant model guaranties to withstand system failures, such as crashes, network partitioning
What is the Hyperledger Fabric?
∙
Hyperledger is a cross-industry blockchain technology.
∙
Encourages businesses to create Private and Permissioned blockchain systems.
∙
Shared ledger
∙
Smart Contracts (GOlang, NodeJS, Java)
33
∙
Modularity
34
35
36
Photos:
1. https://www.hyperledger.org/projects/besu 2. https://iroha.readthedocs.io/en/latest/
Rest:
1. https://hyperledger-fabric.readthedocs.io/en/release-2.0/ 2. https://en.wikipedia.org/wiki/Hyperledger 3.
https://pdfs.semanticscholar.org/00c7/5699db7c5f2196ab0ae92be0430be4b291b4.pdf
4.
https://dl.acm.org/doi/10.1145/3190508.3190538
37