Skip to content

giwaov/arcium-blind-auction

Repository files navigation

Blind Auction - Arcium RTG Submission

Author: giwaov
Bounty: Dev Bounty: Blind Auctions
Repository: https://github.com/giwaov/arcium-blind-auction


Overview

A privacy-preserving sealed-bid auction system built on Solana using Arcium's Multi-Party Computation (MPC) network. Bidders submit encrypted bids that are compared securely - no one, not even the auction operator, can see bid amounts until the auction closes.

The Problem

Traditional on-chain auctions suffer from several critical issues:

  • Front-running: MEV bots can see pending bids and outbid users
  • Bid Visibility: All bids are public, allowing strategic underbidding
  • Collusion: Bidders can coordinate based on visible bid information
  • Shill Bidding: Auction operators can artificially inflate prices

The Solution: Arcium-Powered Blind Auctions

By leveraging Arcium's confidential computing network, bids remain encrypted throughout the auction:

  1. Encrypted Bids: Bidders encrypt their bids before submission
  2. MPC Comparison: Arcium's MPC nodes compare bids without decryption
  3. Sealed Results: Only the final winner and amount are revealed
  4. MEV Protection: No visible mempool data for bots to exploit

How Arcium Provides Privacy

Multi-Party Computation (MPC)

Arcium uses threshold MPC where multiple independent nodes jointly compute results. No single node ever sees the plaintext bid values:

Bidder A (bid: 100 SOL)  ──┐
                          │    ┌─────────────────┐
Bidder B (bid: 150 SOL)  ──┼───▶│  Arcium MPC    │──▶ Winner: B
                          │    │  (encrypted     │    Amount: 150 SOL
Bidder C (bid: 80 SOL)   ──┘    │   comparison)  │
                               └─────────────────┘
                                     │
                    Individual bids NEVER revealed

Privacy Benefits

Benefit How Arcium Achieves It
Bid Confidentiality Bids encrypted with random nonces, processed by MPC
MEV Resistance No plaintext data in transactions for bots to exploit
Collusion Prevention Even colluding parties cannot see competitors' bids
Operator Blindness Auction creator cannot manipulate based on bid values
Verifiable Results MPC outputs are cryptographically signed and verified on-chain

Features

Auction Types

1. Standard Sealed-Bid Auction

  • Highest bid wins
  • Winner pays their bid amount
  • Classic first-price sealed-bid

2. Vickrey (Second-Price) Auction

  • Highest bid wins
  • Winner pays second-highest price
  • Incentive-compatible (truthful bidding is optimal)

Technical Features

  • Encrypted Bid Comparison via Arcium MPC circuits
  • On-Chain Auction Metadata for transparency
  • Time-Locked Bidding with configurable end times
  • Minimum Bid Enforcement
  • Callback Verification of MPC outputs

Architecture

┌──────────────────────────────────────────────────────────────┐
│                        USER FLOW                              │
│                                                              │
│  [Bidder] ──encrypt bid──▶ [Solana TX] ──queue──▶ [Arcium]   │
│                                                              │
└────────────────────────────────────────────────────────────────┘

┌─────────────────────┐          ┌─────────────────────┐
│   Solana Program    │◀────────▶│  Arcium MPC Network │
│   (blind_auction)   │          │  (encrypted-ixs)    │
│                     │          │                     │
│  • Create auction   │  queue   │  • init_auction     │
│  • Accept bids      │ ◀──────▶ │  • place_bid        │
│  • Close auction    │ callback │  • close_auction    │
│  • Emit events      │          │  • Vickrey variants │
└─────────────────────┘          └─────────────────────┘
         │                                │
         ▼                                ▼
┌─────────────────────┐          ┌─────────────────────┐
│  Public On-Chain    │          │  Private Encrypted  │
│                     │          │                     │
│  • auction_id       │          │  • highest_bid      │
│  • authority        │          │  • highest_bidder   │
│  • end_time         │          │  • second_bid *     │
│  • min_bid          │          │  • bid_count        │
│  • is_finalized     │          │  • is_open          │
└─────────────────────┘          └─────────────────────┘
                                  * Vickrey auction only

Technical Implementation

Encrypted Instructions (encrypted-ixs/src/lib.rs)

Six MPC circuits handle secure auction logic:

Circuit Purpose ACU Weight
init_auction Initialize encrypted auction state ~1 ACU
place_bid Compare bid securely, update winner if higher ~1 ACU
close_auction Reveal winner and winning amount ~1 ACU
init_vickrey_auction Initialize Vickrey auction with second-price tracking ~1 ACU
place_vickrey_bid Track both highest and second-highest bids ~1 ACU
close_vickrey_auction Reveal winner paying second-price ~1 ACU

Solana Program (programs/blind_auction/src/lib.rs)

The Anchor program:

  • Manages auction lifecycle on Solana
  • Queues computations to Arcium MPC network via queue_computation
  • Verifies callbacks with SignedComputationOutputs
  • Emits events for indexing and UX
  • Enforces access control (only authority closes auction)

Key Security Features

// Bid time validation
require!(clock.unix_timestamp < auction.end_time, ErrorCode::AuctionEnded);

// Authority check for closing
require!(ctx.accounts.authority.key() == auction.authority, ErrorCode::Unauthorized);

// MPC output verification
output.verify_output(&cluster_account, &computation_account)?;

Getting Started

Prerequisites

Tool Version Purpose
Rust 1.89+ Build encrypted-ixs
Solana CLI 2.3+ Solana tooling
Anchor 0.32.1 Solana framework
Arcium CLI 0.8.0 Build & test
Docker Latest Local MPC testing

Build

# Clone repository
git clone https://github.com/giwaov/arcium-blind-auction.git
cd arcium-blind-auction

# Install dependencies
npm install

# Build encrypted instructions and Solana program
arcium build

Test (Local MPC)

# Requires Docker for local MPC network
arcium test

Deploy

# Deploy to Solana devnet
arcium deploy --network devnet

Usage Example

1. Create Auction

// Initialize auction with 1-hour duration
await program.methods
  .initAuction(
    computationOffset,
    auctionId,
    new BN(Date.now() / 1000 + 3600), // end in 1 hour
    new BN(1_000_000_000), // min bid: 1 SOL
    encryptionPubkey,
    nonce
  )
  .accounts({ ... })
  .rpc();

2. Place Encrypted Bid

// Encrypt bid amount before submission
const encryptedBid = await arcium.encrypt(bidAmount);

await program.methods
  .placeBid(
    computationOffset,
    encryptedBidderId,
    encryptedBid,
    encryptionPubkey,
    nonce
  )
  .accounts({ auction: auctionPda, ... })
  .rpc();

3. Close Auction

// Only authority can close after end_time
await program.methods
  .closeAuction(computationOffset, encryptionPubkey, nonce)
  .accounts({ authority: authority.publicKey, auction: auctionPda, ... })
  .rpc();

// Winner revealed in AuctionFinalized event

Real-World Use Cases

Use Case Problem Solved
NFT Auctions Prevent sniper bots and front-running
Treasury Bonds Government securities with fair price discovery
Corporate Procurement Prevent bid manipulation in vendor selection
Real Estate Property auctions without price signaling
Art Market High-value art sales with sealed bidding
Carbon Credits Fair allocation without market manipulation

Security Considerations

MPC Security Model

  • Requires threshold honest nodes (e.g., 2-of-3)
  • No single point of failure for privacy
  • Cryptographic proofs verified on-chain

Smart Contract Security

  • Time-locked closures prevent indefinite auctions
  • Authority-only close prevents griefing
  • Verified MPC outputs prevent tampering

What's NOT Protected

  • Bidder identity (Solana addresses are public)
  • Auction existence (metadata is public)
  • Timing of bids (transaction ordering visible)

Project Structure

blind_auction/
├── programs/
│   └── blind_auction/
│       └── src/
│           └── lib.rs          # Solana program
├── encrypted-ixs/
│   └── src/
│       └── lib.rs              # Arcium MPC circuits
├── build/                       # Generated circuits & types
├── tests/                       # Integration tests
├── Anchor.toml
├── Cargo.toml
└── README.md

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

License

MIT License - see LICENSE


Acknowledgments


Contact

About

Blind Auction with Arcium MPC for Arcium RTG submission

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors