A decentralized sealed-bid auction platform built on the Stellar blockchain with Soroban smart contracts, featuring private-input encryption and real-time updates.
This is a full-stack blockchain application with three main components:
- Location:
contracts/src/lib.rs - Language: Rust
- Features:
- Commit-reveal bidding scheme
- On-chain auction management
- Secure bid encryption
- Automatic winner determination
- Location:
server.js - Features:
- Stellar RPC integration
- Real-time updates via Socket.io
- API endpoints for auction management
- Wallet connection services
- Location:
public/ - Features:
- Stellar wallet integration
- Modern responsive UI
- Real-time auction updates
- Bid commitment and revelation
-
Install Rust (for smart contracts):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install Soroban CLI:
cargo install --locked soroban-cli
-
Install Node.js (v18+):
# Download from https://nodejs.org/
-
Clone and Install:
git clone https://github.com/akordavid373/sealed-auction-platform.git cd sealed-bid-auction npm install -
Build Smart Contract:
npm run build-contract
-
Configure Environment:
cp .env.example .env # Edit .env with your Stellar keys -
Deploy Contract:
npm run deploy-contract
-
Start Application:
npm start
-
Open Browser: http://localhost:3000
// Create new auction
create_auction(title, description, starting_bid, duration)
// Commit sealed bid
commit_bid(auction_id, commitment, bid_amount)
// Reveal bid amount
reveal_bid(bid_id, bid_amount, secret)
// End auction and determine winner
end_auction(auction_id)
// Cancel auction (creator only)
cancel_auction(auction_id)- Commit-Reveal Scheme: Prevents front-running attacks
- On-Chain Storage: All auction data immutable
- Cryptographic Security: SHA256 commitment hashes
- Access Control: Only creators can cancel auctions
// Connect with secret key
const wallet = new StellarWallet();
await wallet.connectWithSecret('your_secret_key');
// Or create new wallet
const newWallet = wallet.createWallet();
console.log(newWallet.publicKey, newWallet.secretKey);- Create Auction: Call smart contract with auction parameters
- Commit Bid: Submit encrypted commitment hash
- Reveal Bid: Submit actual bid amount and secret
- End Auction: Automatically determine highest bidder
- Withdraw: Winner receives funds automatically
- Testnet: Free development and testing
- Mainnet: Production deployment
- Future: Custom networks support
# Build contract
npm run build-contract
# Test contract
npm run test-contract
# Deploy to testnet
npm run deploy-contract# Start development server
npm run dev
# Run tests
npm test
# Start with auto-reload
nodemon server.jsFrontend is served from the backend - no separate build step needed.
// GET /api/stellar/contract-info
// Returns contract address and network info
// POST /api/stellar/create-auction
// Creates auction on blockchain
// POST /api/stellar/commit-bid
// Commits bid to blockchain
// POST /api/stellar/reveal-bid
// Reveals bid on blockchain
// GET /api/stellar/auctions
// Lists all blockchain auctions// Socket.io events
socket.on('auctionCreated', (auction) => { /* ... */ });
socket.on('bidCommitted', (data) => { /* ... */ });
socket.on('bidRevealed', (data) => { /* ... */ });
socket.on('auctionEnded', (auction) => { /* ... */ });# Stellar Configuration
STELLAR_NETWORK=testnet
SECRET_KEY=your_secret_key_here
PUBLIC_KEY=your_public_key_here
CONTRACT_ID=deployed_contract_id
# RPC URLs
TESTNET_RPC_URL=https://soroban-testnet.stellar.org
MAINNET_RPC_URL=https://mainnet.stellar.org
# Application
PORT=3000
NODE_ENV=development# Testnet deployment
npm run deploy-contract -- --network testnet
# Mainnet deployment
npm run deploy-contract -- --network mainnetcd contracts
cargo testnpm test- Connect wallet with testnet account
- Create auction with test parameters
- Place bids using commit-reveal
- Verify auction end and winner selection
npm run dev
# Runs on http://localhost:3000heroku create stellar-auction
git push heroku main
heroku config:set STELLAR_NETWORK=testnetrailway login
railway init
railway updocker build -t stellar-auction .
docker run -p 3000:3000 stellar-auction- Audit: Contract should be professionally audited
- Testing: Comprehensive test coverage required
- Upgradability: Consider proxy patterns for updates
- Secret Keys: Never expose in frontend
- Environment: Use secure environment variables
- Backup: Secure key backup procedures
- HTTPS: Required for production
- Rate Limiting: API protection implemented
- Input Validation: All inputs validated
The application is fully responsive and works on:
- Desktop browsers (Chrome, Firefox, Safari)
- Mobile browsers (iOS Safari, Chrome Mobile)
- Tablets (iPad, Android tablets)
User → Frontend → Backend → Stellar Network
↓ ↓ ↓ ↓
Create Form API Smart Contract
Auction Submit Call create_auction()
↓ ↓ ↓ ↓
Commit Hash API Smart Contract
Bid Submit Call commit_bid()
↓ ↓ ↓ ↓
Reveal Amount API Smart Contract
Bid Submit Call reveal_bid()
↓ ↓ ↓ ↓
End Timer API Smart Contract
Auction Check Call end_auction()
- Fork the repository
- Create feature branch
- Make changes
- Add tests
- Submit pull request
- Issues: GitHub Issues
- Documentation: This README
- Community: Discord/Telegram (coming soon)
- Mobile App: React Native implementation
- NFT Integration: Asset-based auctions
- Multi-Currency: Support for various tokens
- Governance: DAO-based auction platform
- Analytics: Advanced auction analytics
- Gas Optimization: Reduce transaction costs
- Scalability: Handle high-volume auctions
- UI/UX: Enhanced user experience
- Testing: Expanded test coverage
Built with ❤️ for the Stellar ecosystem
🌟 Repository: https://github.com/akordavid373/sealed-auction-platform
🚀 Live Demo: (Coming soon)
📧 Contact: [Your contact information]