A private swap spends notes of the input token, trades through a Uniswap V2 router as the pool, and credits a note of the output token to the swapper.

Flow

What the proof binds

  • selector: which router function
  • routerArgs: amountIn, amountOutMin, path[4], pathLength, deadline
  • receivingKeyCommitment: Poseidon2(rkHash, trapdoor) for the output owner
  • ciphertextSwap[6]: header and owner fields of the output note
  • UNISWAP_V2_ROUTER: supplied by the contract as public input #1
The output amount isn’t known when proving. The contract completes the output note with the measured amountOut, the output token and a zero value trapdoor.

Protections

Robinhood Chain requirement

UNISWAP_V2_ROUTER is set in the implementation constructor. Swaps go live only after a V2-compatible router, its WETH and usable liquidity are verified on Robinhood Chain.