Regarding Login Registration Architect of Hyperledger Fabric

Viewed 894

I have been working in fabric ledger for some time and created some basic chain code and RestApis. Now I want to do something with login and Registration of Users. My Queries are

  1. Do I implement Registration with RegisterUser like in Fabcar
  2. Do I create objects in chaincode of users with password and email and implement all logic and User Auth with chaincode.
  3. How do I use Enroll User in all this. Do I Enroll only one Admin and User to carry out the chaincode commands? and implement all the logic in chaincode?

Basically I want to implement something like Buy and Sell with Customers having there own Registration and Login. So What is the best approach ? Use Chaincode and store email and pass all in couchdb with chaincode

3 Answers

In order to register Fabric users that can invoke the chaincode, the Certificate Authority requires a registrar, which is another existing user on the CA. The first registrar is created when you spin up the CA. After enrolling this first user with the CA, you can now act as a registrar to register other users on the CA. The new users will have to enroll with the CA, a process which issues the certificate (kind of an ID) and the private key (kind of a signature) of that user. Fabric handles authentication & authorization through these certificates and private keys.

However, I think you are looking for a more 'traditional' user management for you application, like email & password, and I am guessing your use case requires users to sign themselves up to invoke the chaincode you have designed. What you have suggested (all users transact under the same identity issued by the CA) makes using a blockchain pointless, because you are basically centralizing all identities & transactions on the same organization and CA. In this case, I believe you would have to reconsider your blockchain protocol choice, as Hyperledger Fabric might not be the right solution to your specific use case.

The traditional email and password based login systems has lots of drawbacks. You can get details information about those drawbacks on given link:

https://medium.com/@taseen.junaid/self-sovereign-identity-ssi-in-blockchain-the-future-of-internet-identity-6deb75607aa

To get rid of that situation, public key cryptography is used in Hyperledger Fabric.

To enroll a user, you can use different tools that support X.509 certificate. So far the best solution for Hyperledger Fabric is to use Fabric Ca.

You don't need any login in public-key cryptography, for access control in chaincode, you can use attribute based access control or ABAC. Currently you can use "github.com/hyperledger/fabric-chaincode-go/pkg/cid" packages for ABAC with go chaincode.

Related