Protocol
Deposits & Withdrawals
Depositing and withdrawing are the two core operations in Hinkal. Both follow the same path: an off-chain proof, a single on-chain call to transact, and a set of checks and state updates inside the contract. See Compliance for deposit eligibility.
Flow
- Generate the proof off-chain
The user's client produces a Zero-Knowledge Proof (ZKP) for the operation. - Submit on-chain
The proof is sent to the Hinkal contract'stransactfunction, together with a calldata hash (see Frontrunning protection below). - The contract verifies
It checks the proof, verifies the root hashes of both the Hinkal Merkle tree and the Access Token Merkle tree, and confirms the protocol's balances are accurate. - The contract updates state
Commitments tied to the provided nullifiers are nullified so they cannot be reused; new commitments are added to Hinkal's Merkle tree. - Funds move
- Deposit - the user's funds are transferred into the Hinkal contract.
- Withdrawal - the contract pays any relayer fee (if a relayer is involved), then transfers the remaining funds to the recipient.
Frontrunning protection
A calldata hash is submitted alongside the ZKP. It commits the proof to the exact transaction details - including the relayer - so they cannot be altered in flight.
.png?alt=media)
