I want to create an application with the Hyperledger fabric network and I'm unsure what the optimal way of processing and storing the clients information is. It is important for me that the personal information get stored off-chain to not slow down the network.
Right now this is the process I thought about:
That way the UUID can be connected to the personal information because the UUID is also stored off-chain and it is still totally anonymous.
But is it necessary to register and enroll the user through the Node SDK with the enroll and register function before being able to access the chaincode, because without the registration there would be no identity for the client in the network?
And I'm also cunfused if this function from the fabcar samples is the same as the enroll and register function from the node SDK?
Thanks for your efforts and helping me understand this matter.
The enroll
code of fabcar is the enroll
of node-sdk.
In other words, they are the same.
const secret = await ca.register({
affiliation: 'org1.department1',
enrollmentID: 'appUser',
role: 'client'
}, adminUser);
const enrollment = await ca.enroll({
enrollmentID: 'appUser',
enrollmentSecret: secret
});
First, let's talk about fabric's SDK.
In general, in order to query/invoke chaincode on the fabric SDK, you need to obtain fabric client authority.
Suppose you register a specific user UUID as a Client of Fabric and call the chaincode through that Client.
In this case, the order you should perform is as follows.
Fabric-CA
Fabric-CA
Fabric-Network(peers, orderers)
step 1, when Fabric-CA
is first operated, the administrator ID and password can be specified through specified parameters. Based on the specified ID and password, a client key/certificate with admin authority is issued from Fabric-CA
and stored.
(Fabric-CA
is recommended to be operated in an organizational unit, and client authority is organization dependent.)
step 2, a new user can be registered through the admin-client key/certificate. Probably you would register
the UUID as enrollmentID
.
When the registration process is finished, the user-client's key/certificate is issued by enrolling in Fabric-CA, and it is stored.
step 3, the chaincode is query/invoke through the stored admin-client/user-client key/certificate. Of course, it can be performed only if the client is authorized, and this is defined in the genesis block of the channel in the blockchain network (that is, it must be set in the configtxgen
process)
Overall, if you look at the scenario, you can see the two processes divided.
PDC(Private Data Collection)
provided by Fabric.PDC
is an off-chain technology, and only predefined organizations share data.[NOTE]
If you are going to query/invoke the chaincode of the fabric network, fabric-client
privileges are essential.
Of course, you can do some tricks.
for example)
However, the authority on the blockchain is all dependent on external certification authorities.