0% found this document useful (0 votes)
37 views

Transaction Flow in Hyperledger Fabric - GeeksforGeeks

Uploaded by

mayank patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Transaction Flow in Hyperledger Fabric - GeeksforGeeks

Uploaded by

mayank patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

Trending Now DSA Web Tech Foundational Courses Data Science Practice Problem Python

Transaction Flow in Hyperledger Fabric


Transaction in hyperledger fabric reflects the business activity in the
fabric network. Due ensure data immutability the transactions are kept
inside the block and the chain structure is used for protection. In
hyperledger fabric, each node maintains a ledger and the consensus
mechanism is used to keep the ledger updated and identical at every
node. The ledger at each node is composed of two parts, a blockchain,
and a world-state database. The article focuses on discussing the
transaction flow in Hyperledger Fabric.

Assumptions

There are a few assumptions to understand before beginning with the


transaction flow in Hyperledger Fabric.

This transaction flow assumes that the channel is set up and


running.
The application user has been registered and enrolled with the
organization’s Certificate Authority (CA) Certification and received
back necessary Protected cryptographic material, which will be
used to authenticate to the network.
The chaincode containing a set of key representation value pairs is
installed on the peers and deployed to its current channel.
The chaincode contains logic defining a set of active transaction
instructions and the agreed-upon price for a radish.
An endorsement policy has also been set up for this chaincode,
stating that both peer A and peer B must endorse any transaction.

https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 1/12
4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

Transaction Flow in Hyperledger Fabric


Below are the steps in the transaction flow in the hyperledger fabric:

1. Client A initiates a transaction:

Client A sends requests to Client B for purchasing radishes.


The request targets peer A and peer B, who are representatives of
Client A and Client B.
The endorsement policy states that both peers must endorse any
transaction thus the request goes to peer A and peer B.
The transaction proposal which is a request to invoke chaincode
function with the intent to read/ update the ledger is constructed
using SDK.

https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 2/12
4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

The SDK takes the user’s cryptographic credentials to produce a


unique signature for the transaction proposal.
The SDK submits the transaction proposal to the target peer and it
will first forward the transaction proposal to other peers for
execution.

2. Endorsing peers verify the signature and execute the transaction:

The endorsing peers verify that:

https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 3/12
4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

The transaction proposal is well-formed.


It has not been submitted in the past for replay-attack protection.
The signature is valid.
The submitter (Client A) satisfies the channel’s Writers’ policy and
is properly authorized to perform the proposed operation on the
channel.

The endorsing peers take the transaction proposal inputs as


arguments to invoke the chaincode function. The chaincode function
gets executed and produces transaction results, response value, write
set, and read set. Till this point, there is no update being done to the
ledger. The set of these generated values along with the endorsing
peer’s signature is sent to the target peer as the proposal response.

3. Proposal responses are inspected:

In step, the target peer verifies the proposal responses.

https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 4/12
4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

Even if checking is not performed hyperledger fabric architecture is


designed in such a way that the endorsement policy will still be
checked and enforced when each peer validated transactions prior
to committing them.

4. Target peer assembles endorsements into a transaction:

The target peer broadcasts transaction messages containing


transaction proposals and responses to the ordering service. This
includes Channel ID, read/ write sets, and a signature for each
endorsing peer.
The ordering service receives the transactions, orders them, and
creates blocks of transactions per channel. It will not inspect the
entire content of the transaction.

https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 5/12
4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

5. Transaction is validated and committed:

The blocks of transactions are delivered to all the peers on the


channel and they validate the transactions within the block.
The peers validate transactions to ensure the endorsement policy is
fulfilled and there have been no changes to the ledger state for
read set variables since the read set was generated by the
transaction execution.
They tag transactions in the block as valid or invalid.

7. Ledger updated:
https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 6/12
4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

Each peer appends the block to the channel’s chain.


For each valid transaction, the write set is committed to the current
database.
Each peer emits an event to notify the client application that the
transaction is immutably appended to the chain and also sends the
notification whether the transaction is validated or invalidated.

Get 90% Course fee refund in just 90 Days! Also get 1:1 Mock
Interview, Job assistance and more additional benefits on selected
courses. Take up the Three 90 challenge today!

Here's a complete roadmap for you to become a developer: Learn DSA


-> Master Frontend/Backend/Full Stack -> Build Projects -> Keep
Applying to Jobs

And why go anywhere else when our DSA to Development: Coding


Guide helps you do this in a single program! Apply now to our DSA to
Development Program and our counsellors will connect with you for
further guidance & support.

Last Updated : 02 Jan, 2023 32

Previous Next

Blockchain - Elliptic Curve Hyperledger Architecture


Cryptography

Share your thoughts in the comments Add Your Comment

https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 7/12
4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

Similar Reads
Hyperledger Fabric and Quantum Hyperledger Fabric in Blockchain
Computing

Hyperledger Fabric Security Threats What is Chaincode in Hyperledger


Fabric?

Hyperledger Fabric “Building Your Error Handling in Hyperledger


First Network” Fabric

Hyperledger Fabric Design Goals Config Generator in Hyperledger


Impacting Security Fabric

Hyperledger Fabric SDK for Java Chaincode Lifecycle on Hyperledger


Fabric

K khurpade…

Article Tags : Hyperledger , Technical Scripter 2022 , Blockchain , Technical Scripter

https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 8/12
4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

A-143, 9th Floor, Sovereign Corporate


Tower, Sector-136, Noida, Uttar Pradesh -
201305

https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 9/12
4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

Company Explore
About Us Job-A-Thon Hiring Challenge
Legal Hack-A-Thon
Careers GfG Weekly Contest
In Media Offline Classes (Delhi/NCR)
Contact Us DSA in JAVA/C++
Advertise with us Master System Design
GFG Corporate Solution Master CP
Placement Training Program GeeksforGeeks Videos
Geeks Community

Languages DSA
Python Data Structures
Java Algorithms
C++ DSA for Beginners
PHP Basic DSA Problems
GoLang DSA Roadmap
SQL DSA Interview Questions
R Language Competitive Programming
Android Tutorial

Data Science & ML Web Technologies


Data Science With Python HTML
Data Science For Beginner CSS
Machine Learning Tutorial JavaScript
ML Maths TypeScript
Data Visualisation Tutorial ReactJS
Pandas Tutorial NextJS
NumPy Tutorial NodeJs
NLP Tutorial Bootstrap
Deep Learning Tutorial Tailwind CSS

Python Tutorial Computer Science


Python Programming Examples GATE CS Notes

https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 10/12
4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

Django Tutorial Operating Systems


Python Projects Computer Network
Python Tkinter Database Management System
Web Scraping Software Engineering
OpenCV Tutorial Digital Logic Design
Python Interview Question Engineering Maths

DevOps System Design


Git High Level Design
AWS Low Level Design
Docker UML Diagrams
Kubernetes Interview Guide
Azure Design Patterns
GCP OOAD
DevOps Roadmap System Design Bootcamp
Interview Questions

School Subjects Commerce


Mathematics Accountancy
Physics Business Studies
Chemistry Economics
Biology Management
Social Science HR Management
English Grammar Finance
Income Tax

UPSC Study Material Preparation Corner


Polity Notes Company-Wise Recruitment Process
Geography Notes Resume Templates
History Notes Aptitude Preparation
Science and Technology Notes Puzzles
Economy Notes Company-Wise Preparation
Ethics Notes Companies
Previous Year Papers Colleges

https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 11/12
4/5/24, 1:05 AM Transaction Flow in Hyperledger Fabric - GeeksforGeeks

Competitive Exams More Tutorials


JEE Advanced Software Development
UGC NET Software Testing
SSC CGL Product Management
SBI PO Project Management
SBI Clerk Linux
IBPS PO Excel
IBPS Clerk All Cheat Sheets

Free Online Tools Write & Earn


Typing Test Write an Article
Image Editor Improve an Article
Code Formatters Pick Topics to Write
Code Converters Share your Experiences
Currency Converter Internships
Random Number Generator
Random Password Generator

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

https://www.geeksforgeeks.org/transaction-flow-in-hyperledger-fabric/ 12/12

You might also like