Hinkal Protocol

Off-Chain (Private)
Audited on 2023/10/31
No active critical issues

Summary

Hinkal Protocol is a privacy protocol that aims to allow users to perform deposits, withdrawals, transfers, and swaps, and otherwise interact with DeFi protocols through owner-configured integrations without on-chain traceability. To initiate transactions, users must first undergo a KYC process. Once approved, users can perform deposits under a Hinkal shielded address that is derived from their EOA. Users then initiate withdrawals, transfers, or swaps with the integrated DEXs through a commitment & nullifier scheme. Deposits are inserted as commitments into an on-chain Merkle tree. Users can then generate a Zero-Knowledge Proof that the tree contains a commitment mapping to their assets and execute a withdrawal, swap, or transfer. Nullifiers are stored to prevent the reuse of commitments. The proofs are generated off-chain, and approved relayers can be used for increased obfuscation. Several issues were uncovered over the course of the audit. The protocol could be drained through commitment duplication (HNKL-1). Errors in constructing the Merkle tree could lead to irredeemable funds for some users (HNKL-3), or even all users (HNKL-2). We also uncovered some issues listed as Undetermined severity, but may still have a high impact on the protocol (HNKL-30, HNKL-31, & HNKL-32). We were not able to run the test suite (HNKL-4). It is important to note that the audit did not cover the entirety of the protocol. The scope excluded all external integrations (Aave, Curve, Uniswap, etc) and focused on deposits, withdrawals, and transfers. Additionally, the contracts have been written to support future hooks for pre/post-transactions. We cannot comment on the correctness of these integrations or any future hooks, and advise the Hinkal team to have thoroughly audited these features before deploying. See the Scope section for the complete list of contracts included in this audit. **Fix-Review Update:** The Hinkal team has addressed all of the issues outlined in the report. We were able to run the updated test suite and found it to have high code coverage.


Issues (37)

Low
Medium
High
Critical
Total
Not fixed
32--5
Fixed
2354-32
Total2674037


Contracts (63)

#File Name
1

contracts/types/IVerifierFacade.sol

2

swapperMO5x2x1.circom

3

swapperMO4x2x1.circom

4

contracts/ERC20TokenRegistry.sol

5

contracts/AccessToken.sol

6

contracts/verifiers/Verifier5x2x1.sol

7

AccessTokenChecker.circom

8

contracts/verifiers/VerifierO3x2x1.sol

9

contracts/types/IVerifier3x2x1.sol

10

contracts/verifiers/VerifierO5x2x1.sol