Deposit the fixed amount with a commitment hash

Let's dive into the deposit process. To deposit funds into GothamCash, you must send a fixed amount of BNB to the contract, along with your unique commitment hash. This commitment acts as a cryptographic placeholder for your deposit and will later be used to anonymously prove ownership when you withdraw.

It's like getting a cloakroom ticket for a jacket that you leave in a nightclub, and then get back at the end of the night with that same ticket: without it, you won't be able to get your jacket back.

What is a commitment?

A commitment is a hash generated from two secret random values:

  • A nullifier (used to prevent double spending)

  • A secret (used to add entropy)

Both values are combined and hashed (using keccak256) to produce the commitment. This commitment is what gets stored on-chain — never the secret or nullifier themselves.

Example:

iniCopierModifiercommitment = keccak256(nullifier + secret)

You’ll receive a note that encodes all of this information (e.g. gothamcash-1:0xabc...:0xdef...). Keep this note safe — you’ll need it to withdraw your funds.


Deposit process:

  1. Choose your deposit amount (e.g., 0.1 BNB, 1 BNB, or 10 BNB).

  2. Use the GothamCash dApp to generate a note and the commitment hash.

  3. Send the fixed amount along with your commitment via the deposit interface.

  4. Your deposit will be registered on-chain, and you'll see a confirmation.

If fees are enabled, the dApp will automatically calculate the correct total to send (deposit + fee). You don't need to worry about gas math — just follow the interface.


Important:

  • Only fixed amounts are accepted. If you send any other amount, the transaction will revert.

  • Make sure to save your note immediately after deposit. If you lose it, you will not be able to withdraw your funds later.

  • Deposits are anonymous: no address or identity is stored on-chain, only the commitment.

Last updated