Open
Conversation
…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>
Replace AMM with a private Central Limit Order Book (CLOB) for peer-to-peer limit orders with full identity privacy. Add React webapp with embedded/extension wallet support, session persistence, order book UI, and in-browser zkTLS attestation generation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a complete private prediction market example on Aztec: binary outcome markets (e.g. "Will BTC be above $50k by July 1?") with real token collateral, provable solvency, and trustless CoinGecko price resolution via Primus zkTLS attestations.
Architecture
mint_sets(n)deposits n collateral and mints n YES + n NO shares;burn_sets(n)reverses it;redeem(n)pays out winning shares 1:1 after resolution. Invariant:total_collateral = total_yes = total_noalways holds.place_orderdeposits collateral and stores a limit order publicly with maker identity hidden in an encrypted partial note;take_orderfills the order by minting a complete set and distributing YES to one party and NO to the other;cancel_orderreclaims collateral via a secret preimage (order_id = Poseidon2(cancel_secret)).defi-wonderland/aztec-standardsToken contract with auth witness flow.Privacy properties
What's included
src/main.nr): complete sets, CLOB, token integration, zkTLS resolution (~650 lines)src/order.nr):Packableimpl packingis_buy_yesinto LSB of price field, with unit testssrc/price.nr): ASCII decimal to integer cents, with unit teststests/): deployment, mint/burn sets, place/take/cancel orders, resolution, redemption, guard railswebapp/): full trading UI with embedded + extension wallet support, CLOB order book, in-browser attestation generation via Primus SDK, session persistence via localStorageTest plan
cd prediction-market-zktls && yarn installyarn ccccompiles contract and generates TypeScript bindingsyarn test:noirpasses Noir unit tests (price parser, order pack/unpack)yarn testpasses integration tests against local Aztec network (deployment, complete sets, CLOB orders, resolution, redemption)cd webapp && yarn install && yarn devstarts the webapp locally🤖 Generated with Claude Code