Smart Contracts

To make the Hinkal work, the following contract setup is required:

a) Hinkal Pool

Hinkal Pool smart contract contains crucial functions of the protocol - deposit, transfer, and withdraw. It is the backbone contract for the protocol, and Hinkal front-end directly interacts with it.

b) MerkleTree

MerkleTree smart contract stores commitments when users deposit, transfer and withdraw funds. Merkle Tree structure is optimal for checking whether a user holds funds in the protocol. Specifically, verifying whether a leaf is a part of a Merkle Tree is done in a linear time.

To optimize gas, the merkle-tree is append-only.

c) AccessToken

Before executing a transaction, Hinkal Pool checks if the user has passed verification by one of our KYC providers. It sends requests to AccessToken Smart Contracts requiring information on the KYC/AML checks. This contract has its own Merkle Tree which, unlike regular MerkleTree contracts, allows removal of access tokens.

d) RelayStore

RelayStore smart contract stores credentials and ratings of the Relayers. Ratings are used to determine the chance a given relayer will be chosen for a withdrawal operation. As of now, only Hinkal Protocol is able to add more relayers into RelayStore, but eventually, the process of adding new Relayers will be governed by Hinkal DAO. The list of all Relayers can be extracted from RelayStore through the getRelayList function call. e) ERC20TokenRegistry

ERC20TokenRegistry smart contract stores information regarding ERC20 tokens which are allowed to be used with Hinkal Pool smart contract.

f) VerifierFacade

VerifierFacade smart contract manages information regarding on-chain zero knowledge proof verifiers used in the protocol, zero knowledge proof verifiers can be added and removed using this contract.

Last updated