PrivateDAO Match Settlement
hackathons/txline-world-cup-settlement.md
Boundary
This route preserves legacy markdown access inside the Next.js surface. The raw repository file remains authoritative.
Open raw filePrivateDAO Match Settlement
Track: TxODDS / TxLINE Prediction Markets and Settlement
Project Idea
PrivateDAO Match Settlement is a settlement workflow for prediction markets.
The user selects a World Cup match, resolves a market from TxLINE data, generates a Blind Settlement proof, verifies that the proof has not been tampered with, and stores receipt hashes on Solana.
Simple story:
- A user creates or selects a match market.
- The match ends.
- TxLINE provides the match result snapshot.
- PrivateDAO checks the hidden settlement policy.
- A Groth16 proof package is generated.
- Anyone can verify the package.
- Receipt hashes are anchored on Solana.
How TxLINE Is Used
The backend reads:
TXLINE_API_BASETXLINE_API_TOKENTXLINE_SERVICE_LEVEL_IDTXLINE_WALLET_PUBLIC_KEY
When TXLINE_API_TOKEN is configured, the backend tries TxLINE match endpoints from the configured base URL.
When the token is missing, the backend uses simulated-txline-provider. This mode is clearly labeled and is only intended for local demos and judging before credentials are available.
Endpoints
GET /api/v1/txline/statusGET /api/v1/txline/matchesPOST /api/v1/txline/guest/startPOST /api/v1/txline/resolvePOST /api/v1/txline/verifyPOST /api/v1/txline/onchain-receipt
Free TxLINE API Activation
The product now exposes the documented free activation first step:
POST /api/v1/txline/guest/start
This calls:
https://txline.txodds.com/auth/guest/start
It returns a guest JWT that TxLINE documents as expiring after 30 days.
The free World Cup API path still requires the wallet-signed TxLINE activation flow:
- Start a guest session and keep the JWT.
- Use the configured revenue wallet to create/sign the free World Cup subscription transaction.
- Activate the subscription with TxLINE using
txSig, the detached wallet signature, and the requested leagues. - Store the returned long-lived API token as
TXLINE_API_TOKEN. - Keep the guest JWT as
TXLINE_SESSION_JWT.
PrivateDAO must not invent the activated API token. When both TXLINE_SESSION_JWT and TXLINE_API_TOKEN are configured, match data switches to live-txline-provider.
Demo Flow
- TxLINE data verified
- Settlement policy satisfied
- Groth16 proof verified
- Public receipt generated
- Private settlement logic hidden
- Open
/txline-settlement/. - Select a final match.
- Click
Resolve Market. - Confirm the UI shows:
- Click
Simulate Tamper. - Confirm the UI shows
422 mismatch, original hash, and recomputed hash. - Click
Store receipt on Solana. - Open the returned Explorer link.
Truth Boundary
Live:
- Provider boundary for TxLINE.
- Simulated provider fallback.
- Groth16 proof package generation and verification.
- Tamper mismatch detection.
- Solana Memo receipt design.
Not claimed:
- Full on-chain Groth16 verification.
- Real TxLINE data without credentials.
- Automatic payout custody.
- Regulatory settlement certification.
Solana Receipt Design
The receipt stores hashes only:
- proofIdHash
- matchIdHash
- marketIdHash
- txlineSnapshotHash
- settlementPolicyCommitment
- outcomeCommitment
- verificationKeyHash
- originalProofHash
How To Run Locally
npm install
npm run typecheck
npm run test:unit:ts
npm run web:build:root
npm run start:read-nodeOptional environment:
TXLINE_API_BASE=https://txline.txodds.com
TXLINE_SESSION_JWT=
TXLINE_API_TOKEN=
TXLINE_SERVICE_LEVEL_ID=1
TXLINE_WALLET_PUBLIC_KEY=4Mm5YTRbJuyA8NcWM85wTnx6ZQMXNph2DSnzCCKLhsMD
SOLANA_RPC_URL=
TXLINE_SETTLEMENT_ONCHAIN_CLUSTER=mainnet-betaHow Judges Can Test
Product page:
https://privatedao.org/txline-settlement/
API status:
https://api.privatedao.org/api/v1/txline/status
API docs:
https://privatedao.org/developers/txline-settlement-api/
Architecture:
https://privatedao.org/documents/txline-settlement-architecture