Skip to content

Great-2025/sealed-auction-platform

 
 

Repository files navigation

Private-Input Sealed-Bid Auction System

A secure, web-based sealed-bid auction platform with private input encryption and real-time updates.

Features

  • Private-Input Bidding: Bids are encrypted using AES-256 encryption with user-provided secret keys
  • Real-time Updates: Live auction status and bid count updates using Socket.io
  • Secure Authentication: User registration and login with bcrypt password hashing
  • Responsive Design: Modern, mobile-friendly interface using Tailwind CSS
  • Rate Limiting: Protection against brute force attacks and spam
  • Auto-Closing: Auctions automatically close when their end time is reached

Security Features

  • AES-256 Encryption: All bids are encrypted with user-provided secret keys
  • Password Hashing: User passwords are hashed using bcrypt
  • Rate Limiting: API endpoints are protected with rate limiting
  • Input Validation: All user inputs are validated and sanitized
  • Helmet.js: Security headers for web applications

Installation

  1. Install dependencies:
npm install
  1. Start the server:
npm start

For development with auto-reload:

npm run dev
  1. Open your browser and navigate to http://localhost:3000

Usage

Creating an Account

  1. Click the "Login" button in the header
  2. Switch to "Register" mode
  3. Enter a username and password
  4. Click "Register"

Creating an Auction

  1. Login to your account
  2. Switch to the "Create Auction" tab
  3. Fill in the auction details:
    • Title: Brief description of the item
    • Description: Detailed information about the item
    • Starting Bid: Minimum acceptable bid amount
    • End Time: When the auction should close
  4. Click "Create Auction"

Placing a Sealed Bid

  1. Browse active auctions in the "Auctions" tab
  2. Click "Place Bid" on an auction you're interested in
  3. Enter your bid amount
  4. Create a secret key - this is crucial for bid verification
  5. Save your secret key securely - you cannot recover it
  6. Click "Place Bid"

Auction Results

  • Auctions automatically close at their specified end time
  • The highest bid wins
  • Winners and winning amounts are displayed after auction closure

API Endpoints

Authentication

  • POST /api/users/register - Register a new user
  • POST /api/users/login - Login an existing user

Auctions

  • GET /api/auctions - Get all auctions
  • POST /api/auctions - Create a new auction
  • GET /api/auctions/:id - Get specific auction details
  • POST /api/auctions/:id/close - Close an auction manually

Bids

  • POST /api/bids - Place a sealed bid

Security Considerations

Secret Key Management

  • Secret keys are never stored on the server
  • Users must save their secret keys securely
  • Lost secret keys cannot be recovered
  • Secret keys are required for bid verification (future enhancement)

Bid Privacy

  • All bids are encrypted before storage
  • Server cannot read bid amounts without the secret key
  • Only bid counts and highest bid amounts are visible
  • Individual bid amounts remain private until auction closure

Technical Architecture

Backend

  • Node.js with Express.js
  • Socket.io for real-time communication
  • AES-256-CBC encryption for bid privacy
  • bcrypt for password hashing
  • Helmet.js for security headers
  • express-rate-limit for API protection

Frontend

  • Vanilla JavaScript (no framework dependencies)
  • Tailwind CSS for styling
  • Socket.io client for real-time updates
  • Font Awesome for icons

Data Storage

  • In-memory storage using JavaScript Maps
  • Note: For production use, replace with a proper database (MongoDB, PostgreSQL, etc.)

Future Enhancements

  • Bid Verification: Allow users to verify their bids using secret keys
  • Database Integration: Replace in-memory storage with persistent database
  • User Profiles: Enhanced user management and profiles
  • Bid History: Detailed bid history and analytics
  • Notifications: Email/SMS notifications for auction events
  • Multi-item Auctions: Support for multiple items in a single auction
  • Proxy Bidding: Automatic bidding up to a maximum amount

Development

Project Structure

sealed-bid-auction/
├── server.js              # Main server file
├── package.json           # Dependencies and scripts
├── public/
│   ├── index.html         # Main HTML file
│   └── app.js            # Frontend JavaScript
└── README.md              # This file

Testing

Run tests with:

npm test

License

MIT License - feel free to use this project for personal or commercial purposes.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Support

For issues and questions, please create an issue in the project repository.

About

A full-stack platform for private-input sealed-bid auctions. Ensures bid confidentiality until a simultaneous reveal, promoting fair and strategic bidding.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 55.7%
  • Rust 16.0%
  • TypeScript 13.4%
  • HTML 12.5%
  • Batchfile 2.4%