Re: Implicit private data collections usage


Nikhil Gupta
 

Hi Omar,

The read write set of the transaction contains the hash of the private data. If one organization reads from his implicit collection, the hash of that data is stored in the read set of the transaction.

You can use the GetPrivateDataHash function to read the hash of the implicit data chaincode, perhaps to do a cursory check. This will allow the read write sets to match.

You can see the Marbles transfer sample in the Fabric samples for an example.

Nik



-----fabric@... wrote: -----
To: fabric@...
From: omer.glam@...
Sent by: fabric@...
Date: 06/03/2020 10:21AM
Subject: [EXTERNAL] [Hyperledger Fabric] Implicit private data collections usage

Hi,
 
I have a question regarding implicit data collection usage,
in a transaction including multiple organizations as endorsers, is it possible that each organization will read private data from his own implicit collection ?
 
For example, Org1 shares information with Org2 and Org3 by writing the data into those organizations implicit collection (Org1 is the initiator of the transaction and will send the proposal transaction to Org2,Org3 endorsers as well), Org1 manages ACL to keep track on which information was shared with which organization, the ACL is stored only on Org1 implicit collection.
in case the data is updated Org1 require to update the data on all organizations which he shared this info by consulting the stored ACL.
 
Given we want to perform a read-update-write operation on the data in an atomic (single transaction) manner across all organizations where the data is shared with, each organization should be able to read from his own implicit collection (or be able to read from the tx initiator, Org1, implicit collection) to perform read-update-write operation in the chaincode.
 
when we tried reading from different collections on each organization (each organization will try to read his own data) we encountered Transaction validations errors, i'm assuming it's related to the deterministic nature of chaincode execution and the fact that each proposal transaction will generate different read set ? 
 
Is there a way to overcome this while still retaining read-update-write operation in the chaincode when multiple organization are involved in the transaction?
 
Another option is to avoid reading from each organization implicit collection, and only read from the collection of the transaction initiator (Org1), but since this is an implicit collection the read will fail for Org2, Org3 execution, is there a way to query this information from Org1 collection in a way that also other organization participating in the transaction will be able to access the data (thus keeping the chaincode execute deterministic )?
 
 
Thank you,
Omer

Join fabric@lists.hyperledger.org to automatically receive all group messages.