Proof of prediction
Pact Markets
Proof of prediction: commit a call on-chain before an event, reveal it after, and build a reputation anyone can recompute.
Deployed with a contract on Monad Testnet. Testnet only — nothing moves real value. Browsable without a wallet through a labelled demo mode.
- Period
- Sep 2026
- Status
- Live
- Role
- Smart contract, Scoring model
- Context
- Built for the Monad Metropolis Hackathon (Trust, Identity & AI Infrastructure track).

Screenshot of the running product.
The problem
Why this needed to exist
There is normally no way to check whether a call existed before an event, said what its author now claims, or was quietly edited afterwards. Track records online are reconstructed from memory and screenshots.
Who it’s for
- Analysts and forecasters
- Creators who make public calls
- Communities that want a credible leaderboard
The solution
How it works
A prediction is committed on-chain as keccak256(text, criteria, salt) before the event. The real text is revealed later and checked against that hash by the contract — not by the UI. A resolver named at commit time grades the outcome, and a Pact Score is computed purely from public chain events.
Commit, reveal, resolve, score
- 01CommitHash on-chain, before the event
- 02RevealContract checks text vs hash
- 03ResolvePre-chosen resolver grades
- 04ScoreRecomputed from events
Implemented
What’s actually built
Commit–reveal in Solidity
Rewriting a prediction after the fact is rejected by the contract. That is the entire security property, and it lives on-chain rather than in JavaScript.
Open or sealed
Open predictions publish immediately (proof of when). Sealed ones hide the text until the author reveals it (proof of when and what) — and the UI states that an unrevealed sealed prediction proves nothing about content.
Resolvers chosen up front
The resolver is fixed at commit time, before the outcome is known. Self-resolution is allowed but flagged everywhere and excluded from every score.
A recomputable Pact Score
Brier-derived calibration, square-root difficulty scaling for longer horizons, and square-root volume dampening so nobody climbs the board by firing off fifty low-effort calls.
No index to trust
Discover, Leaderboard and profiles are rebuilt live from the contract’s event logs — no subgraph, no database.
An AI layer that never invents a fact
One endpoint judges whether resolution criteria are objectively checkable (never whether a prediction is true); another writes one sentence from a profile’s already-computed numbers. Both fail quietly if unconfigured.
My role
What I did
Design and implementation of the contract, the scoring engine, the event-log indexer, the Next.js app and the AI endpoints.
Responsibilities
- Smart contract
- Scoring model
- Frontend
- AI layer
Stack (verified from source)
- Solidity
- Hardhat
- Next.js 15
- viem
- wagmi
- Gemini
- node:test
Decisions
Technical and design choices
- 01
Events as the source of truth
The contract stores no list of predictions — paying gas on every commit for a feature only the frontend needs would be wasteful. The frontend reconstructs everything from events.
- 02
Why Monad
A timestamp is only trustworthy if committing is fast and cheap enough that nobody waits. Measured: commit ≈143.7k gas, reveal ≈37.0k, resolve ≈33.9k; deployment 884k gas.
Trade-offs
Challenges along the way
- 01
Salts live in the browser
Sealed predictions keep their salt in the author’s browser until reveal. Lose that storage and the prediction is permanently stranded — a real limitation the README and UI name rather than hide.
- 02
A demo that stays truthful
Demo cards are labelled everywhere and cannot click through to a fake proof page; demo commitments are computed with the same hashing function the real flow uses.
Results
What can be checked
- Monadscan (opens in a new tab)
Deployed contract
PactRegistry live on Monad Testnet (chain 10143).
- Repository (opens in a new tab)
Tests
8 Hardhat tests against the contract and 10 unit tests against the scoring engine.
Lessons
What I took away
- If a reputation number cannot be recomputed by a stranger, it is a claim, not a score.
What’s next
Planned — not built
Planned work
- Mainnet deployment
- Salt backup for sealed predictions
Current limits, stated plainly
- Testnet only.
- Sealed predictions depend on the author’s browser storage until revealed.