Hyperledger Fabric - Copy private data from one's collection to another organization's collection

340 Views Asked by At

Is there any way to copy private data from one collection to another? For e.g. consider a case when you have private data and you are selling it to someone, so it goes into their collection. The documentation says:

"Collection members may decide to share the private data with other > parties if they get into a dispute or if they want to transfer the asset to a third party. The third party can then compute the hash of the private data and see if it matches the state on the channel ledger, proving that the state existed between the collection members at a certain point in time."

However, I can't seem to find an API to do it.

1

There are 1 best solutions below

0
On

I think the answer is in this thread link.

The private data collection can be "copied" by updating the collection policy on the chaincode. Which then allow the previously unauthorized member to access it.

After chaincode updating, the private data from your peer can now be distributed to the buyer peer via gossip protocol. Since private data are stored in the private statedb of peers rather than in the blockchain. Only the hash of that data is stored in the blockchain. Then, your buyer need to "compute the hash of the private data and see if it matches the state on the channel ledger" to make sure that you sold him a valid private data.

I hope that I understand it correctly. More detail could be found here link