A decentralized multi-item sealed-bid auction platform using Zero-Knowledge Proofs (ZKP) built with Noir and Solidity.
zkp.mp4
- Multi-Item Auctions: Create unlimited auction items
- Zero-Knowledge Proofs: Bid amounts remain private until reveal phase
- Sealed-Bid System: Commit-reveal scheme prevents bid manipulation
- Phase Management: Automatic COMMIT → REVEAL → FINALIZED workflow
- Winner Declaration: Transparent winner display after auction ends
- Solidity 0.8.24 - Smart contracts
- Noir - Zero-knowledge circuits
- Hardhat - Development environment
- ethers.js v5 - Ethereum library
- Vanilla JavaScript - Frontend
- Node.js 18+
- MetaMask browser extension
npm installnpx hardhat nodenpx hardhat run scripts/deploy-multi-item.js --network localhostCopy the deployed addresses from the terminal output and update them in frontend-simple/app.js:
const CONTRACT_ADDRESSES = {
auction: '0x...', // MultiItemAuction address
verifier: '0x...' // UltraVerifier address
};Open frontend-simple/index.html in your browser.
- Add Hardhat network: RPC URL
http://127.0.0.1:8545, Chain ID31337 - Import a test account using private key from Hardhat node output
-
Create Auction (Add Item tab)
- Set item name, description, beneficiary
- Configure bidding and reveal periods
-
Place Bids (Browse Items → Place Bid)
- Enter bid amount and deposit
- Bid is committed as a hash (hidden)
-
Advance to Reveal (My Items tab)
- After commit deadline, click "Start Reveal Phase"
-
Reveal Bids (Reveal Bid tab)
- Bidders reveal their committed bids
-
Finalize (My Items tab)
- After reveal deadline, click "Finalize & Declare Winner"
- Go to Add Item tab
- Fill in auction details
- Click "Use My Address" for beneficiary
- Create auction
- Monitor in My Items tab
- Advance phases when deadlines pass
- Browse items in Browse Items tab
- Click "Place Bid" on an item
- Enter bid amount and deposit
- Wait for reveal phase
- Reveal your bid in Reveal Bid tab
- Withdraw deposit if you lose
├── contracts/
│ ├── MultiItemAuction.sol # Main auction contract
│ ├── UltraVerifier.sol # ZK proof verifier (mock)
│ └── interfaces/
│ └── IUltraVerifier.sol
├── circuits/
│ └── bid_proof/ # Noir ZK circuits
├── scripts/
│ └── deploy-multi-item.js # Deployment script
├── frontend-simple/
│ ├── index.html # Main UI
│ ├── app.js # Frontend logic
│ └── styles.css # Styling
└── hardhat.config.ts # Hardhat configuration
This is an MVP for testing/demonstration:
- Uses mock verifier (always returns true)
- Not audited for production use
- Bids stored in browser localStorage
For production:
- Replace mock verifier with real Noir-generated verifier
- Audit smart contracts
- Implement proper ZK proof verification
MIT