project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

StarkSwirl

StarkSwirl is a privacy preserving token mixer that allow users to use the public blockchain Starknet and keep their privacy.

StarkSwirl

Created At

StarkHack

Winner of

Starkware - Best use of Starknet Grand Prize

Herodotus - Best Storage Proof Tooling

ETHGlobal - 🏆 StarkHack Finalist

Project Description

To interact with the application, you need to generate two secret numbers. You can do this on the web page, or you can use another trusted random number generator. These two random numbers will be hashed together and sent to the on-chain contract along with the tokens. The user should store the numbers in a safe place because they will be used during the withdrawal process. By submitting only the hash of these numbers, it ensures that nobody can guess the numbers or revert the hash. This property is called collision resistance. Once this is done, the deposit is complete.

When the user wants to withdraw the tokens from the contract, they can do so from another wallet, ensuring that nobody can link these two wallets. To withdraw, the user will input the secret numbers into a local script that runs on their trusted computer. These numbers remain private, but the script will generate a zero-knowledge (zk) proof that confirms the user knows two numbers which, when hashed together, match a specific hash stored on-chain in a Merkle tree within the contract. With this proof, and nothing more, the user can withdraw tokens to any address they choose, without revealing any information that could link to the initial deposit address.

How it's Made

Backend technologies used:

  • Scarb: Used for building contracts, managing dependencies, running tests, and executing the Cairo program.
  • Lambdaworks:cairo-vm: Executes the Cairo program within a virtual machine to generate a trace, which is then proven by the Stone Prover.
  • StarkWare:stone-prover: Generates a proof for the trace produced by the Cairo VM.
  • Herodotus:cairo-lib: Verifies the MMR (Merkle Mountain Range) proof within the Cairo program.

Smart Contract technologies used:

  • Foundry: Utilised for declaring and deploying smart contracts.
  • Scarb: Handles building contracts and managing dependencies.
  • Herodotus:cairo-lib: Stores the root of an MMR on-chain and appends new commitments.
  • Herodotus:integrity: Verifies the proof generated by the Stone Prover.

ZK (Zero-Knowledge) technologies used:

  • StarkWare:stone-prover: Responsible for generating a proof for the Cairo VM trace.

Frontend technologies used:

  • Next.js: Used to build the frontend.
  • TypeScript, starknet.js, starknet-react: Employed for interacting with smart contracts.
  • TailwindCSS, Shadcn, Aceternity: Used for styling the frontend.
background image mobile

Join the mailing list

Get the latest news and updates