Bet what you know, not who you are.
โ Live on Ethereum Sepolia โ the full confidential cycle (commit-private โ public-aggregate โ claim-private) proven on-chain over a byte-for-byte unmodified Gnosis CTF market. 197 tests green.
4 identical transactions. One dissenter. Unfindable.
The problem. Prediction markets price truth โ but only if informed people dare to bet. On-chain markets (Polymarket-style, on Gnosis Conditional Tokens) expose every position: direction, size, timing, wallet. Anyone with reputational, employment, or political exposure self-censors, and the market loses exactly the information it exists to collect.
The approach. NoxOracle keeps the real market untouched โ the official Gnosis CTF + FixedProductMarketMaker, deployed byte-for-byte from the npm artifacts and CI hash-checked โ and adds a confidential participation layer. A bet is committed as two encrypted amounts (YES-stake, NO-stake; one is an encrypted zero) so direction never exists in plaintext. Stakes pool in confidential cUSD; at epoch close only the aggregates are publicly decrypted and routed through the FPMM in one batch; winners are paid in confidential cUSD at a public pot/pool rate. Individual direction and size stay hidden through and after settlement.
One flow, with depth: commit-private โ batch-execute-public-aggregate โ claim-private on one
real market โ with an in-product k-anonymity meter and an independently-recomputable verify-epoch.
-
โ 197 tests green, locally โ 134 pure-logic (
@noxoracle/confidential-ctf, vitest) + 63 Solidity (Hardhat), incl. the entire confidential cycle (commit โ close โ execute โ finalize โ settle โ claim) against the real cUSD wrapper + real Gnosis CTF/FPMM on a transparent local Nox mock. -
โ Novel contract compiles (
NoxOraclePool.sol, solc 0.8.35) and passes I1โI5. -
โ CTF/FPMM deploy-of-record + bytecode hash-check proven locally AND on live Sepolia (I5: CTF MATCH, FPMM master MATCH).
-
โ Live on Ethereum Sepolia โ deployed + the FULL confidential cycle run end-to-end on-chain (4 private commits k=4 โ aggregates YES 1,700 / NO 500 โ real FPMM buys โ NO resolves โ Dana's sealed claim paid exactly the pot, 1,626.1277 cUSD = encrypted stake ร public rate).
verify-epoch 1recomputes I1โI5 GREEN from chain data;check-artifactsconfirms CTF + FPMM bytecode โก official artifacts. NoxOraclePool is source-verified on Etherscan (solc 0.8.35) โ read the actual contract, don't take our word for it.Contract Address NoxOraclePool (novel, source-verified โ) 0xfFba9520699EC4161f41F9bD220e6ce7083d4a2EConditionalTokens 1.0.3 (unmodified, hash โ) 0xCd316D0655989fBcedb818b59B7374f62eA734a5FPMM 1.8.1 instance (unmodified) 0xBf4900df1Da779836DFC03a746307fAFBEEf4cc3FPMM Factory 1.8.1 (hash โ) 0x5c496C1CD31bdfcaD8278E2Af8dE93a6f3Fa7359cUSD wrapper (reused) 0x82C281D7403e44d61968c2F49751a56877468991DemoUSD (reused) 0x486c4B8009ACf0BfE26268512F27200e48BD735CKey proof txs (Sepolia): commitร4 ยท close/reveal ยท execute ยท finalize/FPMM-buys ยท settle ยท claim โ full list in
fixtures/e2e-result.json.
Caught live, not in a mock. The first Sepolia run reverted in
executeEpoch(NotAllowed,0xb87a12a9): the internal-handleunwrapneeds the pool toallowTransientthe burn amount to the cUSD contract, because the token re-enters the TDX compute under its own identity. A deliberately-permissive local mock had hidden it. Fixed, redeployed, re-ran green โ the cycle above is the fix. Seefeedback.md#16.
"Four people just bet on this market. Tell me who bet NO."
Four identical commitBet transactions, each carrying two sealed handles. The epoch closes:
aggregates decrypt to YES 1,700 / NO 500. Someone dissented with size โ the market knows the
information, but not the informant. Dana opens her position card, signs, and her NO 500 unseals โ
for her alone. NO wins; she claims quietly in cUSD. The herd never learns who read it right.
npm install
npm run compile # solc 0.8.35 โ our contracts (CTF/FPMM are deployed, not recompiled)
npm test # 134 pure-logic tests (@noxoracle/confidential-ctf)
npm run test:contracts # 63 Hardhat tests โ full confidential cycle + I1โI5 on local Nox mock
npm run check-artifacts # protocol-purity hash baseline (I5), read-only, no gas
npm run check-readiness # offline deliverable checklistOn the funded run (adds -- gas):
CONFIRM_SPEND=yes npm run deploy # NoxOraclePool + unmodified CTF/FPMM (reuses live DemoUSD/cUSD)
CONFIRM_SPEND=yes npm run seed # 4-bettor cycle -> writes fixtures/demo-state.json
npm run verify-epoch 1 # recompute I1โI5 from chain data alone (read-only)Copy the template and fill it in (.env is gitignored โ never commit real keys; use throwaway keys, Sepolia only):
cp .env.example .env| Variable | What it is | How to obtain |
|---|---|---|
DEPLOYER_ADDRESS, DEPLOYER_PRIVATE_KEY, PRIVATE_KEY |
Throwaway EOA that deploys NoxOraclePool + the market, is the market oracle, and signs demo txs (PRIVATE_KEY mirrors the deployer key). |
Generate a key: openssl rand -hex 32 (prefix 0x). Derive its address: node -e "console.log(new (require('ethers').Wallet)('0x<hex>').address)". Fund ~0.03 Sepolia ETH from sepoliafaucet.com or the Alchemy faucet. |
SEPOLIA_RPC_URL |
Sepolia JSON-RPC endpoint. | Default public node needs no signup (rate-limited). For reliable e2e, get a free key at Alchemy or Infura โ Ethereum โ Sepolia. |
CHAIN_ID |
Fixed 11155111 (Sepolia). |
Do not change. |
NOX_PROTOCOL_ADDRESS |
iExec Nox protocol contract (NoxCompute โ TEE ACL + proof validation). | Fixed 0x24efโฆ77bf; re-verify from the Nox docs /networks page if it redeploys. No Nox account or API key is required โ the Handle Gateway is self-serve. |
DEMO_USD_ADDRESS, CONFIDENTIAL_USD_ADDRESS |
Reused DemoUSD faucet + its confidential-USD wrapper (shared with NoxSend), already live on Sepolia. | Leave as-is โ the funded run reuses them and does not redeploy. Only change if you deploy your own pair. |
DEMO_MNEMONIC |
Throwaway BIP-39 phrase the e2e derives its bettor actors (Alice/Bob/Carol/Dana) from. Not the public Hardhat mnemonic. | Generate your own: node -e "console.log(require('ethers').Wallet.createRandom().mnemonic.phrase)". |
ETHERSCAN_API_KEY |
Optional โ only to publish NoxOraclePool source (npx hardhat verify โฆ). |
Free, ~1 min at etherscan.io/myapikey โ Add โ copy the ~34-char key (no 0x). |
External services (all free, testnet-only):
- iExec Nox Handle Gateway โ seals bet direction+size inside Intel TDX; self-serve, no signup.
- Gnosis Conditional Tokens (1.0.3) + FixedProductMarketMaker (1.8.1) โ the real, unmodified prediction-market primitives the pool sits on (bytecode hash-checked vs the official npm artifacts).
- Ethereum Sepolia โ the chain everything deploys to.
- Etherscan (Sepolia) โ NoxOraclePool source verification only.
Deployed contract addresses (NoxOraclePool, CTF, FPMM + factory, cUSD, DemoUSD) are in the Status table above.
Beyond the on-chain proof, the repo ships a production-grade test + security harness so judges can tell a real product from a weekend prototype.
# โโ Contracts + SDK (repo root) โโโโโโโโโโโโโ
npm test # 134 pure-logic tests (@noxoracle/confidential-ctf, vitest)
npm run test:contracts # 63 Hardhat tests โ full confidential cycle + I1โI5
npm run test:all # both suites (197 green)
# โโ Web dApp (web/) โโโโโโโโโโโโโโโโโโโโโโโโโ
npm run lint --workspace @noxoracle/web # Next.js / ESLint
npm run typecheck --workspace @noxoracle/web # tsc --noEmit
npm run e2e --workspace @noxoracle/web # Playwright โ demo mode, NO wallet, NO env
npm run lighthouse --workspace @noxoracle/web # Lighthouse CI (perf / a11y / SEO)
make security-scan # npm audit + license check| Layer | Tool | Status |
|---|---|---|
| Contracts + SDK | vitest (134) + Hardhat (44) โ full confidential cycle + I1โI5 | โ |
| Frontend Quality | ESLint + TypeScript (strict) | โ |
| E2E Testing | Playwright โ 3 suites, desktop + mobile, demo mode | โ |
| Security (SAST) | CodeQL (javascript-typescript) |
โ |
| Security (SCA) | Dependabot (npm + actions) + npm audit |
โ |
| Secret Scanning | TruffleHog (verified-only) | โ |
| Performance | Lighthouse CI (a11y hard-gate โฅ 0.9) | โ |
| CI/CD | 7-stage GitHub Actions pipeline, concurrency-cancel | โ |
The E2E suite runs the app with no wallet and no environment variables โ every route
(/, /position, /epoch, /verify) renders confidential-market UI from bundled demo fixtures, so
the confidential-bet flow, meta tags, and mobile layout are all verified without signing a transaction.
| Primitive | Where | Without it |
|---|---|---|
aggregation-only allowPublicDecryption |
epoch sums ONLY (I2) | threshold-decryption committee |
dual encryptInput + fromExternal proofs |
direction-free (amtYes,amtNo) |
a side bit leaks in calldata |
per-user ACL (allowThis/addViewer) |
decrypt-own-position forever | a custodial account DB |
IERC7984 pooled custody + operator-pull |
nothing position-shaped in wallets | positions in wallets = the linkage |
2-step unwrapโfinalizeUnwrap |
plaintext exits ONLY at the FPMM boundary | a trust-me bridge |
Nox.mul/div (ร public scalar) |
public-rate claims, no FHE-div-by-ciphertext | leak stakes at claim |
Remove Nox and you need an FHE coprocessor, a threshold-decryption committee, a custodial batcher, and a disclosure registry โ four systems โ and still couldn't compose with the CTF market on the same chain.
k-anonymity is bounded by epoch size (meter + k<3 warning + a seeded bad epoch #0; membership is
public, only sizes/direction hidden) ยท batching trades latency for FPMM price drift (slippage guards) ยท
the demo oracle is a disclosed centralized EOA (reality.eth = the stated production path) ยท the SDK is
beta 0.1.0-beta.13 (findings in feedback.md).
| Path | What |
|---|---|
contracts/NoxOraclePool.sol |
the only novel contract (dual-handle commit, epoch batch, scalar-rate claim, k-gate) |
contracts/{ConfidentialUSD,DemoUSD}.sol |
reused cUSD wrapper + underlying (vendored from NoxSend) |
contracts/test/MockNoxCompute.sol |
transparent local TEE test-double (never deployed) |
packages/confidential-ctf |
drop-in SDK: dual-handle, k-anon, verify-epoch, client (134 tests) |
packages/cli |
noxoracle bet / position / aggregates / claim / verify-epoch |
scripts/ |
deploy ยท seed ยท e2e ยท bench ยท verify_epoch ยท check_artifacts ยท readiness |
web/ |
Next.js dApp (market ยท position ยท epoch ยท verify), synthwave-themed |
SPEC.md ยท ARCHITECTURE.md ยท DEMO.md ยท feedback.md |
invariants ยท design ยท runbook ยท findings |
Hackathon-original. The cUSD wrapper + Nox integration core are a disclosed shared skeleton with my
other WTF entries (NoxSend/NoxSafe), vendored into this repo (no cross-repo file: dependency). The
Gnosis CTF/FPMM are deployed unmodified third-party protocols (licenses intact). Nothing reused
from Vibe Coding. Built solo.
Thank you for reviewing.