Examining the Behaviour of Hyperledger Fabric when World State is Tampered


Review: Ledger in Hyperledger Fabric

Setup of Testing Environment

A three-org setup with CouchDB as world state database.
Eight containers running. Note the three CouchDB, corresponding to the peer node of three organizations
The peer of each organization joins mychannel

Baseline: A Normal Operation

Chaincode fabcar installed in three peer nodes
Chaincode fabcar instantiated on mychannel with endorsing policy
Per fabcar chaincode design, initLedger() is executed to predefined dataset.
All peer nodes have the same state in their own ledger.
The data is updated in all the three peer nodes in normal operation.

Data Tampering

Accessing CouchDB directly
“Tampering” the data: modify it directly on CouchDB

Test Scenario 1: Endorsing Policy requires endorsement from ALL peers (i.e., AND)

Transaction fails. Transaction invoker receives mismatched responses.

Test Scenario 2: Endorsing Policy requires endorsement just from ONE peer (i.e., OR)

Tampered data gets propagated to other peer nodes.


How to Fix the Data Tampering

Tampered node peer0.org1 unable to invoke transaction


Visit http://www.ledgertech.biz/kcarticles.html for all my works. Reach me on https://www.linkedin.com/in/ktam1/ or follow me @kctheservant in Twitter.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store