About
## The problem it solves
In India, over **18 billion UPI transactions** happen every month ($250B+ retail volume). However, peer-to-peer (P2P) crypto trading on centralized platforms (Binance P2P, Bybit, local exchanges) has turned into a catastrophic legal and privacy minefield:
- **Mass VPA Scraping & Blanket Bank Account Freezes:** Scammers harvest public merchant UPI VPAs from open orderbooks, route tainted fiat into innocent sellers' bank accounts, and trigger cascading cybercrime police liens (Section 91 CrPC). Innocent traders wake up with frozen savings, credit cards, and bank accounts.
- **The Bank Statement Privacy Catastrophe:** Whenever a payment dispute arises, centralized platforms force users to email raw bank statement PDFs and unredacted mobile banking screenshots to offshore customer support desks—exposing lifetime account balances, residential addresses, and intimate spending habits to third parties.
- **Photoshop Fraud & Centralized Censorship:** Centralized platforms can alter matching engines, freeze user accounts without recourse, or fall victim to Photoshop-edited UPI payment receipts.
### What PhantomUPI Enables:
**PhantomUPI** is the first censorship-resistant, zero-knowledge P2P UPI-to-crypto orderbook where **Arkiv DB-Chain** manages decentralized orderbook liquidity and ephemeral escrow locks, while **client-side zkTLS** proves Indian UPI bank payments without leaking bank statements or risking cybercrime liens.
- **100% Synthetic Payee Privacy Guard:** Under no circumstances are real bank accounts, phone numbers, or genuine UPI VPAs stored on-chain. All orders strictly enforce synthetic routing handles (`[alias].synth@[bank]`), eliminating malicious bot harvesting. - **Zero-Screenshot zkTLS Payment Proofs:** Instead of uploading forged screenshots or leaking bank statements, the buyer's browser generates a client-side cryptographic proof of the bank's TLS 1.3 session. The proof mathematically attests: $$\text{BankStatus} == \text{"SUCCESS"} \land \text{Amount} == \text{Order.amountInr} \land \text{Nullifier} == H(\text{secret}, \text{syntheticUtr})$$ Account numbers, bank balances, and KYC names are permanently redacted in browser memory. - **Auto-Expiring Ephemeral Locks:** Liquidity quotes automatically expire in 30–60 minutes on Arkiv DB-Chain without needing centralized servers or cron bots.
## Challenges I ran into
Building a production-grade decentralized orderbook combining Arkiv DB-Chain, smart contract escrow on Base Sepolia, and client-side zkTLS introduced several real-world engineering hurdles:
- **ZK Payload Bloat vs. Arkiv Storage Constraints:**
- *Hurdle:* When serializing complete unminified Groth16 zero-knowledge proofs (`pi_a`, `pi_b`, `pi_c`), public signals, and simulated TLS notary certificate headers inside `jsonToPayload()`, payload size exceeded 4KB, adding serialization latency to high-frequency orderbook views.
- *Solution:* We decoupled cryptographic verification from storage. We store compact 32-byte Poseidon commitments (`nullifierHash`, `tlsTranscriptCommitment`, `groth16ProofDigest`) in the Arkiv Entity payload while keeping raw TLS transcripts ephemeral in browser memory.
- **Attribute Naming Constraints (`InvalidAttributeNameError`):**
- *Hurdle:* When defining indexed attributes in `@arkiv-network/sdk`, using hyphenated or period-separated names (like `"order-id"` or `"fiat.currency"`) caused runtime `InvalidAttributeNameError` rather than compile-time TypeScript errors.
- *Solution:* We established a strict camelCase naming schema (`appId`, `entityType`, `status`, `fiatCurrency`, `amountInr`, `rate`, `zkVerified`) across all query filters and entity creation calls.
- **High-Frequency Block Cadence vs. Orderbook Re-render Storms:**
- *Hurdle:* Arkiv Tiramisu mines a new block every 2–3 seconds. Initially, hooking WebSocket block updates directly to orderbook refetches triggered overlapping API requests and caused candlestick chart jitter.
- *Solution:* We implemented an in-flight request deduplicator (`isFetchingRef`), added deep data fingerprint comparisons (`prevOrdersHashRef`) so state only updates when an order actually changes, and wrapped `PriceChart` and `OrderBookTerminal` in `React.memo` with deterministic candle timestamps.
4. **Dynamic Collateral Escrow Synchronization:** - *Hurdle:* If a seller deposits 100 USDC into the Base Sepolia Escrow and creates an Arkiv Sell Order for 50 USDC with a 60-minute TTL, their available balance must immediately reflect the locked funds so they cannot over-allocate escrow. - *Solution:* We implemented dynamic real-time reconciliation: $$\text{Available Escrow} = \text{Gross Deposited on Base Sepolia} - \sum \text{Active Open/Locked Arkiv Orders}$$ When an order settles or expires via Arkiv's TTL, the escrow pool adjusts automatically.
Screenshots
Team
From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.









