Use Hyperledger Fabric to Streamline Your KYC Process

Image for post
Image for post

By Raghunathan Ramesh, Alibaba Cloud Community Blog author.

Know Your Customer (KYC) is an important concept to know nowadays. Generally speaking, it can be understood as the process of verifying the customer’s integrity and identity through a trusted identity proof that is authorized by some government body or a similar trusted organization or institution.

The manual process involved with KYC, or more specifically the process of verifying each and every employee, or analogously each and every customer that comes by your store, is, naturally, a difficult task for any organization, big or small. And, adding to this fact, the vulnerabilities involved in this process has lead to many financial and integrity issues.

Of course, the answer to all of these problems is to streamline this process and make it a more robust and reliable process. In my opinion, Blockchain is the answer because it is a more suitable technology for this particular use case. This technology can actually provide several different framework based on your particular use case. For this tutorial in particular, we’re going to use Hyperledger Fabric, which is a private blockchain framework. Also, we will be looking at how hypeledger fabric can be leveraged to achieve our particular use case

There are many blockchain platforms currently available in market. Fortunately, for financial use cases, Hyperledger Fabric in many ways is the best fit among all the other choices. In this tutorial, I’ll show you how you can leverage the Hyperledger Fabric platform to streamline the KYC process.

Solution Architecture

The technical architecture using Hyperledger Fabric proposed that we will go through in this article involve the following processes:

  • The original and validated identity document generated for the each individual is first encrypted. Then, the encrypted value is stored in the blockchain. A token is created and issued to the respective individual. This encrypted value cannot be tampered with once it is stored in the blockchain. In many ways, this is the biggest advantage of blockchain technology. Only if the provided token and stored value matches, then it is considered to be the original document, so where an individual needs to provide the identity they can provide the token and gets validated.

Next, it also assumes the following technical architecture:

Image for post
Image for post

In the above diagram, you can see the components involved in blockchain environment. Let’s discuss the component and the process involved in the diagram above in a bit more detail:

  • The Orderer service establishes a consensus based on the transaction and broadcasts block to the peers.
  • The Membership Service Provider (MSP) is responsible for attaching the entities to the network with a cryptographic identity.
  • Peer-to-Peer communication replicates the blocks output by ordering service to other peers, and those peers are termed as anchor peers.
  • The SmartContract (chain code) that runs within the channel and manage the events that happen in the blockchain network. They can be written in standard programming language, but they don’t have direct access to the database.
  • It supports variety of databases, such as CouchDB.
  • Endorsement and validation policies can be included based on the need of application.

Smart contract deployed in the channel developed using Go language is explained below

The Code Behind the Blockchain

1. Encrypting

The following code gets the file from the user, encrypts the file sha256 algorithm and gives the encrypted value to the respective user for validation.

2. Storing in Blockchain

This part of the code converts the encrypted value into string and stores the encrypted value into blockchain. Once it is stored the encrypted value for that particular id will be replicated to all the respective peers, Hence it cannot be tampered or altered without the permission of majority of peers connected to the blockchain network.

3. Querying

This part of the code will return the history of the particular user i.e., all the identities attached to that particular user. Id will be used to refer each individual.

This part of the code returns the query for the particular id. The above smart contract will take care of all the events that needs to be happen in blockchain network.

Note: The front end part can be developed using any appropriate language such as Nodejs, HTML.

Original Source

Written by

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store