Skip to content

NikhilRaikwar/ShadowSend

Repository files navigation

πŸŒ‘ ShadowSend: Privacy-First DeFi on Midnight

Midnight Network License: MIT ZK Powered Hackathon

Making privacy the default standard in DeFi β€” not an optional feature.

ShadowSend is a next-generation privacy dApp built on the Midnight Network. It leverages Zero-Knowledge (ZK) proofs to enable anonymous asset transfers and atomic swaps, ensuring that your financial data remains your own business β€” forever.


πŸŽ₯ Demo & Submission

Resource Link
🎬 Demo Video ShadowSend Video
πŸ“Š Presentation (PPT) ShadowSend
πŸ™ GitHub NikhilRaikwar/ShadowSend
🌐 Live Demo https://shadowsend.vercel.app/

πŸš€ Key Features

πŸ”’ Shielded Transfers

Send tokens privately where both the recipient address AND the amount are cryptographically hidden via ZK-SNARKs. Supports:

  • Shielded β†’ Shielded (mn_shield-addr_preprod β†’ mn_shield-addr_preprod)
  • Unshielded β†’ Shielded (shield your assets)
  • Multi-recipient batching in a single transaction

βš›οΈ Atomic Private Swaps

Exchange assets privately without intermediaries using ZK intent-based atomic swaps:

  • Zero front-running risk β€” trade details inside a Snark
  • Anti-MEV by design
  • makeIntent() broadcasts encrypted swap intents
  • Atomic settlement ensures either full completion or rollback

πŸ“Š Privacy Dashboard

Real-time breakdown of your balances and activity:

  • Private Pool (shielded tNIGHT) vs Public Pool (unshielded tNIGHT)
  • Live transaction history synced from the Midnight Indexer
  • Pending tx detection with on-chain confirmation tracking
  • Auto-refresh every 10 seconds

πŸ›‘οΈ Dual Privacy Modes

Toggle per-transaction between:

  • Shielding Active β€” amounts and recipients cryptographically hidden
  • Public Mode β€” standard unshielded transaction

πŸŒ‰ Cross-Chain Bridge (Coming Soon)

Secure, private bridging from Ethereum, Polygon, Arbitrum, Optimism β†’ Midnight Network.


πŸ—οΈ Architecture

User (Browser)
    β”‚
    β”œβ”€β†’ ShadowSend UI (React + TypeScript)
    β”‚       β”œβ”€ SendPrivatelyTab β€” multi-recipient shielded sends
    β”‚       β”œβ”€ SwapTab β€” ZK intent-based atomic swaps
    β”‚       └─ PrivacyDashboard β€” live balance + tx feed
    β”‚
    β”œβ”€β†’ Midnight Lace Wallet (DApp Connector)
    β”‚       β”œβ”€ getShieldedAddresses()
    β”‚       β”œβ”€ makeTransfer([{kind, type, value, recipient}])
    β”‚       β”œβ”€ makeIntent(inputs, outputs)
    β”‚       └─ submitTransaction(tx)  ← ZK proof generated here
    β”‚
    └─→ Midnight Network (Preprod)
            β”œβ”€ Blockchain (shielded transactions)
            β”œβ”€ Indexer API (https://indexer.preprod.midnight.network)
            └─ Explorer (https://explorer.preprod.midnight.network)

ZK Transaction Flow

1. User fills form  β†’  2. Wallet builds SNARK  β†’  3. Tx submitted  β†’  4. Confirmed on-chain
   (address + amount)     (all data encrypted)      (opaque ZK proof)   (balance updated)

πŸ› οΈ Technology Stack

Component Technology
Blockchain Midnight Network (Preprod Testnet)
Wallet Connector Midnight Lace (Official DApp Connector)
Zero-Knowledge Compact / ZK-SNARKs
Frontend Framework React 18 + TypeScript
Styling Tailwind CSS + Custom Glass UI
Animations Framer Motion
State Management React Context API
Data Fetching TanStack Query
Notifications Sonner
Icons Lucide React
Build Tool Vite

πŸ“¦ Installation & Setup

Prerequisites

  • Node.js 18+
  • Yarn
  • Midnight Lace Wallet browser extension
  • Midnight Preprod testnet configured in wallet

1. Clone the Repository

git clone https://github.com/NikhilRaikwar/ShadowSend.git
cd ShadowSend/frontend

2. Install Dependencies

yarn install

3. Environment Setup

Ensure your local environment is configured:

  • βœ… Midnight Lace Wallet extension installed
  • βœ… Wallet switched to Midnight Preprod network
  • βœ… Midnight Indexer accessible (https://indexer.preprod.midnight.network/api/v3/graphql)
  • βœ… Prover server running at http://localhost:6300 (optional, for local proving)

4. Launch Application

yarn dev --port 3001

Open http://localhost:3001 in your browser.


πŸ” How to Use

Send Privately

  1. Connect Wallet β€” Click "Connect Wallet" β†’ Midnight Lace opens β†’ Approve on Preprod
  2. Enter recipient β€” Use a valid Midnight Preprod address:
    • Shielded: mn_shield-addr_preprod1...
    • Unshielded: mn_addr_preprod1...
  3. Enter amount β€” In tNIGHT (supports decimals)
  4. Enable Shielding β€” Toggle ON for private transfer (default: ON)
  5. Click "Send Shielded" β€” Wallet generates ZK proof, tx submitted
  6. Confirm in wallet β€” Approve the shielded transaction

Swap Privately

  1. Connect wallet
  2. Enter swap amount in "You Send"
  3. Click "Swap Privately"
  4. Wallet broadcasts a ZK intent β€” atomic swap executes privately

Multi-Recipient Batch Send

  1. Click + to add recipients
  2. Enter unique address + amount per recipient
  3. Single shielded transaction covers all recipients

πŸ›‘οΈ Security Design

Property Detail
Non-Custodial Private keys never leave Midnight Lace wallet
ZK Proof Generation Happens client-side inside the wallet
No Data Storage ShadowSend stores zero user data
Address Validation Strict prefix validation (mn_addr_preprod / mn_shield-addr_preprod)
Amount Precision Converted to microunits (Γ—1,000,000) to avoid precision loss
Open Source Fully auditable codebase

πŸ§ͺ Smart Contract / Native Asset

ShadowSend uses the native tNIGHT asset on Midnight Preprod:

Native Asset ID: 0000000000000000000000000000000000000000000000000000000000000000

No custom contract deployment required for end-users. The Midnight Lace DApp Connector handles all ZK proof generation and transaction construction natively.


πŸ“ Project Structure

frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ SendPrivatelyTab.tsx    # Multi-recipient shielded send
β”‚   β”‚   β”œβ”€β”€ SwapTab.tsx             # Atomic private swap
β”‚   β”‚   β”œβ”€β”€ PrivacyDashboard.tsx    # Balance + transaction feed
β”‚   β”‚   β”œβ”€β”€ WalletConnectButton.tsx # Lace wallet integration
β”‚   β”‚   β”œβ”€β”€ TokenSelector.tsx       # tNIGHT / tDUST picker
β”‚   β”‚   β”œβ”€β”€ Navbar.tsx
β”‚   β”‚   └── Footer.tsx
β”‚   β”œβ”€β”€ contexts/
β”‚   β”‚   └── MidnightWalletContext.tsx  # Wallet state + API
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ Index.tsx               # Main dApp page
β”‚   β”‚   └── NotFound.tsx
β”‚   └── index.css                   # Glass UI design system
└── public/
    └── shadowsend.png              # Ghost logo

🀝 Hackathon Submission

Built with ❀️ for the Midnight Network Hackathon 2026.

Team: ShadowSend Team
Builder: @NikhilRaikwarr

What we built:

  • βœ… Privacy-first token transfers with ZK-SNARK shielding
  • βœ… Atomic private swaps via ZK intents
  • βœ… Real-time privacy dashboard with live blockchain sync
  • βœ… Full Midnight Lace DApp Connector integration
  • βœ… Multi-recipient batch shielded sends
  • βœ… Beautiful, production-grade UI with dark glass aesthetic

Why it matters:

DeFi today is entirely transparent β€” anyone can see your wallet balance, transactions, and trading patterns. ShadowSend proves that financial privacy is achievable on a public blockchain using zero-knowledge cryptography. Midnight Network makes this possible. We made it accessible.


πŸ“„ License

MIT License β€” see LICENSE for details.


Β© 2026 ShadowSend Team. Protected by Midnight ZK.

About

ShadowSend is a next-generation privacy dApp built on the Midnight Network. It leverages Zero-Knowledge (ZK) proofs to enable anonymous asset transfers and atomic swaps, ensuring that your financial data remains your own business.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages