A privacy-preserving auction platform built on Solana using Arcium's MPC. Shadow Protocol enables truly private sealed-bid auctions, Dutch auctions with hidden reserves, and batch settlement processing.
- Bun >= 1.0.0
- Node.js >= 18.0.0
- Rust >= 1.70.0
- Solana CLI >= 1.16.0
- Anchor CLI >= 0.29.0
- Arcium CLI >= 0.1.0
- Docker (for local development)
-
Clone the repository
git clone https://github.com/shadow-protocol/shadow.git cd shadow-protocol -
Install dependencies
bun install
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Generate Solana keypair (if you don't have one)
solana-keygen new
-
Build all packages
bun run setup
-
Start local Solana validator
solana-test-validator
-
Deploy programs to localnet
bun run program:deploy
-
Build confidential instructions
bun run confidential:build
-
Start the frontend
bun run app:dev
-
Visit the application
http://localhost:3000
bun run test# Test Solana programs
bun run program:test
# Test confidential instructions
bun run confidential:test
# Test client SDK
bun run --filter='@shadow-protocol/client' test-
Configure for devnet
solana config set --url devnet -
Airdrop SOL for deployment
solana airdrop 2
-
Deploy programs
bun run program:deploy:devnet
-
Deploy confidential instructions
bun run --filter='@shadow-protocol/confidential' deploy -
Update environment variables
# Update .env with deployed program IDs NEXT_PUBLIC_SHADOW_PROTOCOL_PROGRAM_ID=<your-program-id>
-
Build and deploy frontend
bun run app:build # Deploy to your preferred hosting platform
import { ShadowProtocolClient } from '@shadow-protocol/client';
import { PublicKey } from '@solana/web3.js';
// Initialize client
const client = new ShadowProtocolClient({
rpcUrl: 'https://api.devnet.solana.com',
arciumClusterPubkey: new PublicKey('your-cluster-pubkey'),
wallet: yourWallet,
});
// Create auction
const result = await client.createSealedAuction({
assetMint: new PublicKey('asset-mint-address'),
duration: 3600, // 1 hour
minimumBid: 1000000, // 1 SOL in lamports
reservePrice: 5000000, // 5 SOL in lamports
});
console.log('Auction created:', result.auctionId);// Submit bid (amount is encrypted client-side)
const bidResult = await client.submitEncryptedBid({
auctionId: 123,
bidAmount: 7000000, // 7 SOL in lamports
});
console.log('Bid submitted:', bidResult.signature);// Settle auction (triggers MPC computation)
const settlement = await client.settleAuction(123);
console.log('Settlement:', settlement.signature);
// Wait for MPC computation to complete
const finalResult = await client.waitForComputation(settlement.signature);
console.log('Final result:', finalResult);This project is licensed under the MIT License - see the LICENSE file for details.
- Website: shadowprotocol.fun
- Documentation: shadowprotocol.fun/docs