A privacy-preserving sealed bid auction application built with Next.js and integrated with Shutter Network's threshold encryption API. This application allows users to submit encrypted bids that remain private until the auction ends, ensuring fair and transparent bidding.
- 🔐 Encrypted Bidding: Bids are encrypted using Shutter Network's threshold encryption
- 👛 Multi-Wallet Support: Connect with MetaMask, Coinbase Wallet, WalletConnect, and other popular wallets
- 📱 Responsive Design: Works seamlessly on desktop and mobile devices
- 🔒 Privacy-First: Bid amounts remain completely private until the auction ends
- ✍️ Message Signing: Users sign messages to prove bid ownership
- 🛡️ Form Validation: Comprehensive client-side validation with Zod
- ⚡ Real-time Status: Live feedback during the bid submission process
- Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS
- Wallet Integration: Wagmi v2, Web3Modal
- Encryption: Shutter Network SDK
- Form Handling: React Hook Form with Zod validation
- Icons: Lucide React
- State Management: TanStack Query
- Wallet Connection: Users connect their preferred wallet (MetaMask, Coinbase, etc.)
- Bid Submission: Users fill out the form with their name, email, and bid amount
- Encryption Process:
- Registers an identity with Shutter API
- Retrieves encryption keys from Shutter Network
- Encrypts bid amount using threshold encryption
- Message Signing: User signs a message to prove ownership of the bid
- Backend Submission: Encrypted bid and signature are sent to the backend
- Privacy Guarantee: Bid remains encrypted until the auction's decryption timestamp
- Node.js 18+ and npm/yarn
- A Web3 wallet (MetaMask recommended)
- Clone the repository:
git clone <repository-url>
cd paddlebattle-nextjs
- Install dependencies:
npm install
# or
yarn install
- Configure environment variables (optional):
Create a .env.local
file in the root directory:
# Optional: Add your own WalletConnect Project ID
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id_here
- Start the development server:
npm run dev
# or
yarn dev
- Open http://localhost:3000 in your browser
src/
├── app/
│ ├── components/
│ │ ├── ConnectWallet.tsx # Wallet connection component
│ │ └── SealedBidForm.tsx # Main bidding form with encryption
│ │
│ ├── api/
│ │ └── submit-bid/
│ │ └── route.ts # Backend API endpoint
│ │
│ ├── config.ts # Wagmi configuration
│ │
│ ├── layout.tsx # App layout with providers
│ │
│ ├── page.tsx # Main page component
│ │
│ └── globals.css # Global styles
- Handles wallet connection/disconnection
- Supports multiple wallet providers
- Displays connection status and wallet address
- Form validation with Zod schema
- Shutter API integration for encryption
- Message signing functionality
- Real-time submission status
- Privacy-focused UI with hidden bid amounts
- Validates form submissions
- Logs encrypted bids (ready for database integration)
- Handles errors gracefully
- Sample implementation for testing
The application integrates with Shutter Network's API to provide threshold encryption:
- API Endpoint: Uses Chiado testnet (
https://shutter-api.chiado.staging.shutter.network/api
) - Identity Registration: Registers unique identities for each bid
- Threshold Encryption: Encrypts bid data that can only be decrypted after a set time
- Decentralized: No single party can decrypt bids before the auction ends
- Register identity with decryption timestamp (1 hour in the future)
- Retrieve encryption keys from Shutter Network
- Encrypt bid data locally using Shutter SDK
- Submit encrypted data to backend
- Bids remain encrypted until decryption timestamp is reached
- Client-Side Encryption: Bid amounts are encrypted on the client before transmission
- Message Signing: Users sign messages to prove bid ownership
- Input Validation: Comprehensive validation on both client and server
- Privacy Protection: Bid amounts are hidden in the UI and encrypted in storage
- Threshold Encryption: Decentralized encryption prevents single-party manipulation
npm run dev
- Start development servernpm run build
- Build for productionnpm run start
- Start production servernpm run lint
- Run ESLint
For production deployment, consider:
- Setting up a proper database to store encrypted bids
- Implementing signature verification on the backend
- Adding email notifications for bid confirmations
- Setting up monitoring and logging
- Configuring proper CORS policies
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is open source and available under the MIT License.
For questions or support:
- Check the Shutter Network documentation
- Open an issue on GitHub
- Join the Shutter Network community
Powered by Shutter Network - Privacy-preserving threshold encryption for Web3