Skip to content

Add zkTLS prediction market example#34

Open
critesjosh wants to merge 5 commits intonextfrom
add-zktls-prediction-market
Open

Add zkTLS prediction market example#34
critesjosh wants to merge 5 commits intonextfrom
add-zktls-prediction-market

Conversation

@critesjosh
Copy link
Copy Markdown
Contributor

Summary

  • Adds a private prediction market example built on Aztec with zkTLS resolution via Primus attestations
  • Binary outcome markets (e.g., "Will BTC be above $100k by July 1?") with fully private betting, trustless CoinGecko price resolution, and private settlement
  • Includes Noir contract (CSMM pricing, partial notes, zkTLS verification), TypeScript scripts, and integration tests
  • Adds .env to root .gitignore

Test plan

  • cd prediction-market-zktls && yarn install
  • yarn ccc compiles contract and generates bindings
  • yarn test passes integration tests against local Aztec network
  • nargo test passes Noir unit tests for pricing and price parsing

🤖 Generated with Claude Code

critesjosh and others added 5 commits April 1, 2026 22:16
…rimus price attestations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ateral

Replace AMM-based pricing (CSMM) with a complete-set model where users
mint/burn YES+NO share pairs backed 1:1 by collateral tokens. Integrates
defi-wonderland/aztec-standards Token contract for real token transfers.
Adds resolution window, private ECDSA verification, and provable solvency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ss API

Scripts and tests now use TokenContract.deployWithOpts constructor_with_minter
instead of deploying with initial supply. Token distribution uses mint_to_private.
Auth witness creation updated to wallet.createAuthWit(account, { caller, action })
pattern with authWitnesses passed in send options.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Store Poseidon2 hash of the Primus attester's secp256k1 public key in
contract storage at deployment. resolve_market now rejects attestations
from unknown signers, closing the gap where any self-generated key pair
could resolve the market.

Switch attestation generation from proxy-TLS to MPC-TLS mode (mpctls),
where client and attester collaboratively compute TLS session keys so
neither party can unilaterally forge data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant