A stealth shield against MEV, encrypting trades and settling them fair.
GhostLock: MEV Reaper is a cutting-edge DeFi platform that protects traders from Maximal Extractable Value (MEV) attacks through advanced cryptographic techniques and fair ordering mechanisms. Built on Base Sepolia, it leverages blocklock encryption, VRF-based ordering, and AI-optimized batch auctions.
- π Blocklock Encryption: Time-locked encryption hides trading intents until execution
- π² VRF Ordering: Verifiable Random Function ensures fair transaction sequencing
- β‘ Batch Auctions: Uniform pricing eliminates front-running opportunities
- π€ Trade Intents Settlement:
- Future: Solver competition board to ensure liveness + decentralization.
- π Transparency Panel (new):
- Gas fee estimate,
- Unlock block + decryption ETA (calculated dynamically per network),
- Expected receive amount via 1inch API.
- π³ Mock ERC-20 Tokens: ETH, USDC, WETH for dev/test.
- Framework: React 18 with TypeScript
- Styling: TailwindCSS with custom design system
- Animations: Framer Motion + Three.js for 3D components
- Web3: Wagmi + RainbowKit for wallet integration
- State: Zustand for client state management
- Runtime: Node.js with Express framework
- Blockchain: Ethers.js for smart contract interaction
- APIs: RESTful API design with comprehensive endpoints
- Real-time: WebSocket support for live updates
- GhostLockIntents: Manages encrypted trading intents
- BatchSettlement: Handles uniform-price batch auctions
- EpochRNG: Provides verifiable randomness for fair ordering
- MockTokens: Test tokens for development and testing
Compared to other MEV-resistant efforts, GhostLock stands apart:
-
Flashbots / SUAVE
- Focus: private mempools + off-chain transaction sequencing.
- Limitation: requires trust in relays / builders; opaque order-flow markets.
- GhostLock advantage: no trusted relay; instead, ciphertexts are natively encrypted on-chain and decrypted only after safe block height. No privileged actors.
-
CoW Protocol
- Focus: batch auctions with solver competition.
- Limitation: intents visible before clearing β still exploitable; solvers can extract flow.
- GhostLock advantage: adds Blocklock encryption + VRF randomization, so intents remain hidden until reveal, then shuffled to remove sequencing edge. GhostLock inherits batch auction fairness but eliminates pre-reveal leakage.
-
MEV-Boost / PBS
- Focus: splitting block builders and proposers.
- Limitation: improves validator decentralization but not user-level trade protection.
- GhostLock advantage: user-first MEV protection, solving leakage at the transaction level.
-
Secret Network / TEEs
- Focus: hardware-enforced secrecy.
- Limitation: trust in hardware enclaves, supply-chain risk.
- GhostLock advantage: cryptographic, open, and verifiable; no hardware black box.
- Decryption timing mismatch: If unlock block < inclusion block, could allow premature reveal. Mitigation β safety margins + epoch alignment.
- Solver centralization: Current AI call is centralized; roadmap includes solver marketplace + bond/slashing to prevent manipulation.
- Metadata leakage: Ciphertext size/timing may leak info. Roadmap β padding + dummy intents.
- Latency vs UX tradeoff: Batch auctions add delay (~minutes). Mitigation β deploy on L2 for faster block times.
- Oracle/API dependency: Reliance on 1inch & external VRF oracles. Add fallback quoting + distributed randomness in roadmap.
- Node.js 18+ and npm
- Clone the repository
git clone https://github.com/your-org/ghostlock-mev-reaper.git
cd ghostlock-mev-reaper- Install dependencies
# Install root dependencies
npm install
# Install server dependencies
cd server && npm install && cd ..- Environment Setup
# Copy environment files
cp .env.example .env
cp server/.env.example server/.env
# Update with your configuration
# - Add your WalletConnect Project ID
# - Configure RPC URLs
# - Set contract addresses (after deployment)- Start Development Servers
# Terminal 1: Start frontend
npm run dev
# Terminal 2: Start backend API
npm run server- Access the Application locally
- Frontend:
http://localhost:3000 - Backend API:
http://localhost:4800 - Health Check: Preview
- Peak the server here π: Preview
- BaseSepolia Faucets
- GHOSTLOCK_INTENTS_ADDRESS
- BATCH_SETTLEMENT_ADDRESS
- EPOCH_RNG_ADDRESS
- MOCK_ETH_ADDRESS
GET /api/auctions- List all auctionsGET /api/auctions/:id- Get specific auctionGET /api/auctions/stats- Get auction statistics
GET /api/markets- List all marketsGET /api/markets/:id- Get specific marketGET /api/markets/stats- Get market statistics
- On-chain verified randomness Intefrations β Calling the Drand( VRF) verification baked directly into EpochRNG contracts, so ordering proofs are trustless.
- Liveness guarantees β Bond + slashing for missed reveals, fallback threshold revealers, and permissionless settlement calls so no one can grief the auction.
- Privacy hardening β Add ciphertext(intent) padding, dummy intents, and batch-only publication so metadata leakage doesnβt kill the whole βencryptedβ vibe.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Dcipher Network upholding the permissionless threshold signing network
- Blocklock Protocol for time-locked encryption
- Randomness Protocol for VRF implementation
- Base for the underlying blockchain infrastructure
- Drand for distributed randomness beacon
Happy building! ππ
