LogoLogo
  • Introduction
    • Whitepaper (Preface)
    • Investors
  • Community Pre-Sale
    • Overview
  • How to create a wallet
  • How to buy $HINK
  • HINKAL WALLET
    • Features
    • Hinkal Points
    • Points Eligibility
    • Compliance
  • Developers
    • Hinkal SDK
    • SDK Integration
    • Smart Contract Addresses
  • ECOSYSTEM
    • Supported Chains
    • Media Kit
  • TECHNICAL DESCRIPTION
    • Overview
    • Setup
      • Keys and Shielded Addresses
      • Nullifiers & Commitments
    • Smart Contracts
      • Unexpected Relay Costs Accounting - Stealth Addresses
      • Extensibility with Hooks
    • Compliance & Security
      • Access Tokens and User Authentication
    • Transactions
      • Deposits & Withdrawals
      • Swaps
      • Transfers
    • Risks
  • Anonymity Staking
  • FAQ
Powered by GitBook
On this page
  1. TECHNICAL DESCRIPTION
  2. Transactions

Deposits & Withdrawals

PreviousTransactionsNextSwaps

Last updated 3 months ago

For Hinkal, depositing and withdrawing funds are two key operations. To interact with the protocol, users must first create and mint an access token. After that, they generate a Zero-Knowledge Proof (ZKP) off-chain and submit it on-chain using the Hinkal contract’s transact function. The contract then performs several checks, including verifying the proof, checking the root hashes of both the Hinkal and Access Token Merkle trees, and ensuring the protocol’s balances are accurate.

During this process, the contract nullifies any commitments tied to the provided nullifiers to prevent them from being reused. It also adds any new commitments to Hinkal's Merkle tree. For deposits, the user’s funds are transferred to the Hinkal contract. In the case of withdrawals, the contract first pays any relayer fees (if a relayer is involved) and then transfers the remaining funds to the recipient. To prevent frontrunning attacks, a calldata hash is submitted with the ZKP, ensuring that transaction details, such as the relayer, cannot be maliciously altered during the transaction.

Deposit
Withdrawal