This plan outlines the pivot from a general cross-border compliance tool to a highly localized, Zero-Knowledge powered P2P exchange for the Nigerian market.
Important
The Core Mechanics Change: Instead of a simple "payment gateway", your smart contract now needs to act as an Escrow. The crypto seller will lock their USDC/XLM in the smart contract. It will only be released to the buyer once the seller confirms receipt of the Naira bank transfer. The ZK proof is used to ensure both parties are "verified" without exposing their real identities.
Yes, the SDK is absolutely necessary. Your SDK folder contains the "magic" of the project: the ZK circuits and the Soroban smart contracts. However, their logic must change:
Instead of checking global sanctions and country codes, the ZK proof will now verify "Light Nigerian KYC".
- Old Inputs:
country_eligible,sanctions_clear,age_over_18 - New Inputs:
is_human(mock liveness check),bvn_verified(mock Nigerian BVN check),account_in_good_standing(no scam reports).
compliance_registry: Remains mostly the same. It tracks the Merkle root of verified users.payment_gatewaybecomesp2p_escrow:create_offer(amount, price, nullifier): Locks crypto.accept_offer(offer_id, nullifier): Locks the deal to a specific buyer.release_crypto(offer_id): Seller calls this after receiving Naira in their bank account.
The frontend designer needs to prepare 5 core pages.
Tip
Does the Frontend Dev need Rust installed?
NO. The Rust contracts will be compiled and deployed to the Stellar Testnet by the backend/smart contract dev. The frontend developer only needs Node.js/npm to interact with the blockchain using the standard JavaScript @stellar/stellar-sdk and the backend API.
- Landing Page: Pitching "The first private, scam-free P2P for Nigeria."
- Verification (Onboarding): A mock screen where the user enters a fake BVN and does a "liveness check" to receive their ZK Pass.
- P2P Marketplace (Order Book): A list of available offers (e.g., "Selling 500 USDC at ₦1,500/USDC"). Users can filter by asset (XLM, USDC, NGNC).
- Trade Room (Active Escrow): The screen where the active trade happens. Shows the seller's bank details to the buyer. Includes a "Generate ZK Proof" button to securely enter the trade, and a "I have paid" / "Release Crypto" button.
- Dashboard: Shows the user's current crypto balances, active trades, and their "Verified" status.
To move fast in a 12-day hackathon, divide the work cleanly between Backend/Smart Contract and Frontend.
- Rust Contracts: Write the
compliance_registryandp2p_escrowcontracts in Rust. Deploy them to the Stellar Testnet. Provide the Contract IDs to the frontend dev. - ZK Circuits (Noir): Write the updated
main.nrcircuit for the BVN/Liveness check. Compile the circuit to a JSON artifact for the frontend to use. - Backend API (Node.js): Build a simple Express server that:
- Takes the "mock BVN" from the frontend.
- Adds the user to an off-chain Merkle tree and gives them their
secret_salt. - Periodically publishes the new Merkle root to the
compliance_registrycontract.
- UI/UX: Build the React/Vite interfaces listed above using Tailwind CSS.
- Wallet Integration: Integrate Freighter or Stellar Wallets Kit so users can connect their accounts.
- In-Browser Proving: Use
bb.jsto generate the Zero-Knowledge proof locally in the browser when the user clicks "Start Trade". - API & Contract Calls: Send the generated ZK proof to the backend, and use the
@stellar/stellar-sdkto read escrow balances and interact with the deployed smart contracts.
- For the P2P Escrow, do you want to implement a "Dispute" mechanism (where an admin can step in if the seller refuses to release), or keep it simple for the hackathon and assume honest sellers once the trade starts?
- Should we proceed with modifying the
Implementation.mdand the actualSDKcode to match this plan?