Skip to content

What is Veil Protocol?

Veil Protocol is a privacy protocol on Starknet that enables private USDC-to-BTC execution with real on-chain ZK proof verification, an AI Strategy Agent, and a Telegram bot for planning confidential accumulation strategies.

The Problem

On-chain privacy is table stakes -- the real question is can you prove it without revealing anything?

Most "privacy" protocols either:

  • Post secrets in calldata -- any indexer can link deposits to withdrawals
  • Claim ZK proofs but skip on-chain verification -- the proof exists but nobody checks it
  • Require gas payments that deanonymize the withdrawer

Veil Protocol solves all three -- and adds intelligent strategy planning on top.

What Makes This Different

FeatureVeil ProtocolTypical Privacy Pool
ZK proof verified on-chainGaraga UltraKeccakZKHonk verifier (2835 felt252 calldata)Mock verifier or off-chain only
Secrets in calldataNever -- only the ZK proofSecret + blinder posted as calldata
In-browser ZK provingbb.js WASM -- secrets never leave your browserServer-side prover sees secrets
Gasless withdrawalRelayer submits tx, user never signsUser pays gas (deanonymization vector)
Dual-chain settlementWBTC on Starknet OR native BTC via intent settlementSingle chain
AI Strategy Agent5 strategy types, natural language input, autonomous DCAManual deposits only
Telegram botPlan and execute strategies from TelegramNo off-chain interface
ComplianceOptional view keys + exportable proofsNone

Protocol Flow

User A deposits $1 USDC   ──┐
User B deposits $10 USDC  ──┼──> Shielded Pool ──> Batch Swap (Avnu) ──> WBTC
User C deposits $100 USDC ──┘       |                                     |
                                     |                                     |
                           Pedersen Commitments                     Pro-rata shares
                           + ZK Commitments                       withdrawn privately
                           stored in Merkle Tree                  via ZK proof + relayer
                                                                         |
                                                              WBTC on Starknet
                                                              OR native BTC (intent)
  1. Shield -- Pick a denomination ($1 / $10 / $100 / $1,000 USDC). Pedersen + Poseidon BN254 commitments computed client-side. Bitcoin wallet signs the commitment.

  2. Batch -- Keeper aggregates deposits into a single USDC-to-WBTC swap via Avnu DEX, using live BTC pricing from CoinGecko. Individual intent hidden in the batch.

  3. Unveil -- Generate a ZK proof (in-browser via bb.js WASM, or server-side via Barretenberg). Submit to withdraw_private. Garaga verifier validates on-chain. Receive WBTC on Starknet or native BTC via intent settlement, optionally via gasless relayer.

  4. Strategist -- Describe your goal in natural language. The AI Strategy Agent analyzes pool state, selects one of 5 strategies, and generates an execution plan with autonomous DCA and randomized delays.

AI Strategy Agent

The Strategist tab provides a deterministic AI agent that runs entirely client-side. It supports 5 strategy types:

StrategyBehavior
Privacy-FirstRoutes all deposits to the tier with the highest anonymity set
EfficiencyLargest affordable tier, single atomic multicall, zero delays
Stealth DCARandomizes across tiers with 45-180s delays for cross-pool obfuscation
Whale DistributionSpreads across ALL tiers to strengthen protocol-wide anonymity
BalancedDefault -- optimal tier by amount with moderate timing protection

The agent parses natural language input (e.g., "DCA $50 over 5 deposits, maximize privacy"), reads live pool state and BTC price, and generates a step-by-step execution plan.

Telegram Bot

The Veil Strategist Telegram bot provides a mobile-first interface for:

  • /strategy <instruction> -- Plan an accumulation strategy with streaming "thinking" output
  • /status -- Live pool state, anonymity sets, and BTC price
  • /price -- BTC price with per-tier conversion rates
  • /pool -- Detailed protocol analytics

Strategies planned in Telegram can be executed on the web app via deep links.

Tech Stack

LayerTechnology
Smart ContractsCairo 2.15, OpenZeppelin Interfaces
ZK CircuitNoir (Aztec), compiled to ACIR
ZK ProverBarretenberg -- in-browser (bb.js WASM) or server-side (bb CLI)
On-Chain VerifierGaraga UltraKeccakZKHonkVerifier
DEXAvnu Aggregator (batch swaps)
BTC SettlementNative Bitcoin via intent settlement + solver network
FrontendNext.js 15, React 19, Tailwind CSS, Framer Motion
Embedded RelayerNext.js API routes (/api/relayer/*)
AI AgentDeterministic strategy engine (client-side, no external API)
Telegram BotGrammy framework with live pool state and deep links
WalletsStarknet (Argent/Braavos) + Bitcoin (Xverse via sats-connect)
CryptographyPedersen (Stark), Poseidon BN254, AES-GCM
Testingsnforge (37 Cairo tests) + nargo (4 Noir tests) + Vitest (123 frontend tests) = 164 total
DeploymentVercel (frontend), Starknet Mainnet (contracts)
ExplorerVoyager

Re{defining} Privacy on Starknet — Re{define} Hackathon 2026