1

I am writing chaincode for Hyperledger Fabric using node. I am trying to model a network in which I have a buyer and a seller in a channel whose purpose is exchanging a Car asset.

I do have a transaction which is called sellCar and invoked by the seller and it should save as attributes in the world state who is the seller and who is the buyer. I do also have a transaction carReceived which is to be called by the buyer to confirm he has received the car.

I am struggling to determine how to link the car.buyer field of my Car asset to a valid identity in the fabric network? In that way I can make sure only the intended buyer can invoke the carReceived transaction for his car.

Should I save a copy of the buyer and seller eCerts as part of the transaction? Is this an insecure practice? For example inside the chaincode then check whether the participant invoking carReceived matches the car.buyer eCert (which was given in advance to the seller to add in the sellCar transaction)

I am unsure how to proceed. I am using Fabric CA as MSP.

Thank you very much in advanced for your help

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Marcos
  • 63
  • 5

0 Answers0