Private, AI-based ICOs with encrypted bids on Sapphire and atomic settlement on Ethereum
This project is a Cross-Chain Initial Coin Offering (ICO) system that enables private, secure, and gas-efficient token sales by combining the strengths of two blockchain environments: • Oasis Sapphire for private and confidential bidding, powered by Trusted Execution Environments (TEEs) • Ethereum for public, atomic, and auditable settlement, with batch processing to save gas
The system allows founders or token issuers to conduct token sales where users can submit sealed bids (containing not only price and quantity, but also qualitative data like a strategic pitch), which are processed and managed in private by an Agent coordinating the sale deploy in a TEE. Once the winners are selected, a single atomic settlement transaction on Ethereum distributes the tokens and collects payments in a trust-minimized and gas-efficient manner.
⸻
🧩 Why This Matters
Current ICOs often suffer from: • Front-running and public price discovery that favors bots and insiders • High gas fees for thousands of individual transactions • Lack of privacy in bidder intent and strategy
This system solves all of that: • ✅ Bids are encrypted and processed in private, so no one can front-run or spy • ✅ Batch settlement reduces gas by 60-70% • ✅ TEE guarantees fairness and signs off results cryptographically
⸻
🏗️ How It Works (Simplified) 1. Issuer creates a token sale with a deadline and scoring policy. 2. Bidders encrypt their bids (price, quantity, pitch) using the TEE’s public key and submit them to Sapphire. 3. TEE Agent monitors the network, collects bids, applies a scoring algorithm, and determines winners. 4. Results are signed by the TEE and sent to Ethereum. 5. BatchSettlement contract executes all transfers atomically: USDC from bidders to issuer, KITTY tokens from issuer to winners.
⸻
🔐 Key Features • Private bidding: Strategic bids stay confidential • Cross-chain coordination: Sapphire + Ethereum working together • TEE-verified fairness: No need to trust a human operator • Atomic settlement: Either everything succeeds, or nothing happens • Supports qualitative scoring: Not just price — bidders can include pitch, country, etc. • Gas-efficient: Save hundreds of dollars by batching settlements
⸻
🚀 Use Cases • Launching a community token while selecting strategic partners privately • Conducting a fundraise for a DAO where allocations depend on more than price • Running a whitelist sale with privacy-preserving allocation 🔭 Future Developments
We’re evolving the system to be smarter, more private, and bot-resistant: 1. 🕵️♂️ Private Delivery • Bid with a KYC wallet, receive tokens in an anonymous one. • Ensures compliance without sacrificing privacy. 2. 👤 Proof of Personhood • Integrate with BrightID, Gitcoin Passport, or World ID to block bots. • Optional requirement for fair, Sybil-resistant sales. 3. 🤖 Smarter TEE Agent (ROLF) • Dynamic policy handling (e.g. regional quotas) • Bid feedback, multi-round auctions, DAO reporting • Roadmap: governance-integrated, autonomous allocator
⸻
We started the project the way most blockchain dev stories begin: drawing arrows on a whiteboard.
We knew we wanted to fix the mess that is token sales today — either everything is public and front-runnable, or it’s private but totally trust-based. So we asked: What if bids were private, but the results were public and trustless?
That’s how we ended up combining Sapphire for encrypted bidding, Ethereum for final settlement, and a TEE agent to tie it all together.
⸻
🧱 Step 1: Smart Contracts & Research Rabbit Holes
We started with the contracts. On Ethereum, we deployed a vanilla ERC20 (KITTY) and a BatchSettlement contract to handle multi-user settlement in one go.
Then we dove into Sapphire — Oasis’s confidential EVM — which lets you keep data private even inside a smart contract. That’s where we deployed our ICO contract, which stores encrypted bids and emits a signal (SettlementRecorded) when a sale ends.
This part was smooth… until we realized we now had two chains, two types of logic, and no shared memory.
⸻
🤖 Step 2: Building the Agent (aka The Referee)
To glue the two chains together, we built a simple off-chain agent. It watches events from Sapphire, collects all the encrypted bids, and selects winners based on custom logic (price, pitch, country, etc.).
Then it signs the result and pushes it to Ethereum for settlement. Think of it like a little referee that says,
“Here’s the list of winners. I checked the rules. Let’s do this.”
We built the first version of the agent in TypeScript. Minimal, no bells and whistles — just a loop, a ruleset, and some signature logic.
⸻
💡 Step 3: ROFL to the Rescue
We ran this agent inside ROFL, a lightweight runtime that made it surprisingly easy to work with TEEs.
This was our first time working with trusted enclaves, and we expected pain. But ROFL made it dead simple to run sealed logic, hold keys, and produce cryptographically signed results. Honestly, it made us start thinking about other off-chain + verifiable apps — like private voting, reputation scoring, or even encrypted governance.
ROFL basically gave us a TEE dev environment that didn’t feel like doing DevOps in the Matrix.