## 3 Authorization Alongside Know Your Customer
### Implementation of Smart Contracts with IPFS Storage  
Both IPFS- and Quorum-permissioned blockchain were used in order to create a decentralized system that not only preserves but enhances the privacy and security of the user's personal information. As described in the previous section, IPFS is the repository in which all the user information is stored. IPFS database fragments the KYC files and produces an endpoint object in order to link all the parts of the user's KYC files (Figure 2). In order to have access to the data, a person must know the address of this endpoint object. Quorum-permissioned blockchain enables the creation of private/permissioned blocks that contain smart contracts only specific users have access to. In the rest of the blockchain only the hash of these private contracts and blocks is broadcast, in order to validate the integrity of these blocks by the whole blockchain.  
As depicted in the image above (Figure 2) the Quorum blockchain contains private and public smart contracts, both giving access to different levels of information. As far as the public KYC contract is concerned, it contains all the functions (Table 1) in order to enable the CRUD operations for the user information stored inside the smart contract'structs'.  
Figure 2: Public (user) and private (admin) Know Your Customer (KYC) smart contracts.  
Private smart contracts give access to all the KYC documents stored in the IPFS, for evaluation or update purposes. In order to have access to the user's KYC documents in IPFS, the admin users need a specific CID (Content Identifiers). This CID is assigned by the IPFS to the folder that contains all the KYC files of a specific user. IPFS links all these files together, and in this way admin users can access and modify all the KYC files using a single entry point (Figure 3).  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Function Name** & **Description** & **Input** & **Response** \\ \hline \multirow{6}{*}{GetKYCMemberApproval0} & This function is responsible for & & \\  & delivering basic KYC information & & \\  & upon request. All the data & & \\  & returned from this function do & & \\  & not contain any sensitive & & \\  & information about the user, only & address & \\  & the minimum amount of & & \\  & information in order to identify & & \\  & the User and the time period this & & \\  & Member is approved for. & & \\ \hline \multirow{6}{*}{UpdateKYCMember()} & KYC approval of an account & & \\  & needs to be updated when the & & \\  & approved period has passed, and & address & \\  & also there are cases in which an & & \\  & approved member needs to be & & \\  & banned due to malicious & & \\  & activities. This function is & & \\  & responsible for updating the KYC & & \\  & information stored in the & & private key \\  & blockchain. & & \\ \hline \multirow{6}{*}{CreateKYCMember()} & When a new member is approved & **Address:** User account & \\  & by the system, the KYC info must & address & \\  & be stored in a structure inside the & & \\  & Smart Contract. This method is & & \\  & responsible for creating a new & & \\  & record with the KYC info of a & & \\  & new member. & & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Public smart contract methods description.  
Figure 3: IPFS content-addressed file system.  
These CIDs are stored safely in the private smart contract and only the admin users, with specific authorization, can call the methods which return the CID of users in order to have access to these files. Functions described in the table below (Table 2) are accessed only by specific nodes in the blockchain with administrator privileges.