Skip to content

Introduction

MIST.cash SDK is a TypeScript toolkit for building privacy-preserving applications on Starknet. It enables zero-knowledge proof-based private transactions using Groth16 proofs, Poseidon hashing, and Merkle trees.

Traditional blockchain transactions are fully transparent — sender, receiver, and amount are all publicly visible. MIST.cash breaks this link using zero-knowledge cryptography, allowing users to deposit, transfer, and withdraw tokens without revealing the connection between sender and receiver.

The SDK is organized as a monorepo with three packages:

@mistcash/sdk

Core cryptographic engine — WASM-powered Poseidon hashing, Groth16 proof generation, Merkle tree operations, and Chamber contract utilities.

@mistcash/config

Shared configuration — contract ABIs, addresses, supported token definitions, and TypeScript types.

@mistcash/react

React integration — the useMist hook for managing deposits, withdrawals, and proof generation from React applications.

  1. Deposit — A user deposits tokens into the Chamber contract along with a cryptographic commitment (hash of a secret).
  2. Privacy — The deposit is added to a Merkle tree. The link between depositor and the commitment is the only public information.
  3. Withdraw — A different address generates a zero-knowledge proof showing knowledge of a valid commitment in the tree, without revealing which one. Tokens are sent to the new address.

The zero-knowledge proof is generated client-side using a Go-compiled WASM module (Gnark) and verified on-chain via the Garaga verifier.