Hyperledger Fabric Transaction Flow

From nothing to a block, what is the big picture?

Sam LAM @ OriginBit
Coinmonks
Published in
3 min readFeb 22, 2019

--

Hyperledger Fabric Image

This is a short story about Hyperledger Fabric Transaction Flow. By knowing the transaction flow, it might help us debug and design our Hyperledger Fabric application.

What is the Transaction Flow?

  • Starts with an API request from the client — I want to write some data to the Blockchain
  • Ends with an API response to the client — the block is committed in the Blockchain for your data

Then, what do happen in the middle? Let’s open the black box.

The Black Box — There is No Magic

The following is a common transaction flow in Hyperledger Fabric.

The (One Possible) Transaction Flow

Assume that there is no error:

  1. A Client, such as an iOS app, sends an API request to a Backend server with Hyperledger Fabric SDK — I want to write some data to the Blockchain
  2. The SDK sends a transaction proposal to the Peer(s) for the endorsement
  3. The Peer(s) endorses (signs) the transaction proposal and returns it to the SDK (, also, the Peer performs Chaincode / Smart Contract execution at this point, before endorsing the transaction proposal)
  4. The SDK sends a transaction to the Orderer (& Kafka) for the transaction ordering service
  5. The Orderer orders the transactions, forms block and broadcasts it to the Peers
  6. The Peer(s) notifies the SDK — the block is committed in the Blockchain for your data (, also, the Peer performs transactions validation and block commitment at this point, before notifying the SDK)
  7. The SDK (the Backend server) sends an API response to a client — the block is committed in the Blockchain for your data

It seems that SDK (the Backend server) is quite busy, in terms of the number of arrows. But don’t forget that Peer’s endorsement (signing), Chaincode execution/simulation, and transactions validation are high-load jobs as well.

So, that’s the big picture. Next, I plan to write a short story about Corda transaction flow and some stories about design practices for the Chaincode or Smart Contract development.

Corda is another Permissioned Blockchain framework like Hyperledger Fabric.

Thanks! If you like my stories, please follow me for new updates!

--

--

Sam LAM @ OriginBit
Coinmonks

OriginBit Founder | HSUHK Lecturer | Gov Advisory Committee Member(SCSDITE) | GDG Organizer | MBuddhStud(HKU) | BEng(HKUST) | MCSE | MCP | CCNP | CEH