⚙️Product Architecture

Bonknado Cash's architecture is centered around a smart contract deployed on the Solana network that acts as a mixer for SOL tokens. The core components of the protocol are the deposit and withdrawal functions, which are secured by Groth16 zk-SNARKs.

2.1. Merkle Tree

At the heart of the protocol is a Merkle tree with a height of 20 levels, allowing for a substantial number of deposits to be mixed together, thereby increasing the anonymity set for each user. When a user makes a deposit, a "commitment" is generated. This commitment, which is a cryptographic hash of a secret and a nullifier, is inserted as a leaf in the Merkle tree.

2.2. Zero-Knowledge Proofs

Bonknado Cash utilizes the Groth16 proving system, a highly efficient and widely-used zk-SNARK construction. The protocol employs the Poseidon hash function, which is optimized for zk-SNARK applications, to build the Merkle tree and generate the commitments.

  • Deposit: During a deposit, the user generates a secret and a nullifier. These are combined to create a commitment, which is sent to the Bonknado Cash smart contract and added to the Merkle tree. The user is the only one who knows the secret and nullifier corresponding to their deposit.

  • Withdrawal: To withdraw their funds, the user must provide a zk-SNARK proof that they possess the secret and nullifier for a valid, unspent commitment within the Merkle tree. The proof is generated off-chain and submitted to the smart contract for verification. A crucial part of this proof is the "nullifier hash," which prevents the same deposit from being withdrawn more than once (double-spending).

The smart contract verifies this proof without ever knowing which deposit is being claimed. This is the essence of the privacy provided by Bonknado Cash: the mathematical proof confirms the legitimacy of the withdrawal request without revealing any information that could link the withdrawal to the original deposit.

Last updated