verifiable-outcome-sdk
v0.4.0
Published
On-chain proof of who won. Commit rules before the draw, anyone verifies from a transaction signature.
Maintainers
Readme
Verifiable Outcome Engine
On-chain proof of who won.
Every competition, raffle, or airdrop on Solana announces a winner. VRE commits the rules on-chain before the draw — anyone can take the transaction signature and verify the result themselves. No backend trust required.
Quick Verify
npm install -g verifiable-outcome-sdk
vre verify --sig 5wZUU5YQ8Nu5RddNeEEigYUEM5Q45C2SJmwLgdLhQcLQi4S3vYhAUvLc6YchYnxqU5b1pvEsBSD1USZPPDEaRVd2
# -> MATCH / OKLive verifier:
https://verifiableoutcome.online/verify?sig=5wZUU5YQ8Nu5RddNeEEigYUEM5Q45C2SJmwLgdLhQcLQi4S3vYhAUvLc6YchYnxqU5b1pvEsBSD1USZPPDEaRVd2Full error code reference: VERIFICATION_ERRORS.md
Licensing
The verification SDK is open for integration — use it to build artifacts, verify outcomes, and replay results from chain data.
The Solana program (9tEramtR21bLBHvXqa4sofVBPa1ZBho4WzhCkCimFE1F) runs
on a protocol fee model: each resolveOutcome call pays a small fee to the
VRE treasury.
Partners (large platforms, GameFi, NFT marketplaces) can deploy their own instance under a commercial agreement — no per-tx fee. Contact us →
Why this exists
Every Solana app that picks a winner — competition, raffle, airdrop, loot drop — asks users to trust the backend. The more money follows, the bigger the trust gap.
VRE closes it. Rules are committed on-chain before resolution. Anyone can take the transaction signature and replay the outcome from public RPC data.
| Without VRE | With VRE |
|---|---|
| Operator picks winner, posts TX | Rules committed on-chain before draw |
| Users trust the result | Anyone replays from public RPC data |
| No way to verify | vre verify --sig <TX> → MATCH / OK |
How it works
VRE replays a Solana outcome from a transaction signature plus public RPC data:
- fetch the on-chain artifact via the signature,
- recompute the outcome locally using the committed rules,
- compare replayed result with the recorded outcome,
- expect
MATCH / OK.
Canonical devnet program id:
9tEramtR21bLBHvXqa4sofVBPa1ZBho4WzhCkCimFE1F- Upgrade authority: Squads vault PDA
8o5a6hj22sEsmpsYTN8aM4GUwKGkR1YXKsgYQdiVkbgAunder multisig7jtA1fkZNrg7ZntGQtpXtAi9JxZEzgRjGRuGvdScZQqQ(Squads). - Live operator: Swig actor wallet
E8wB17KxBi89Noz74eypjbcrAJXhmPeA7e7oYHZSbjzf; VPS delegate is scoped to the VRE program with a daily SOL spending limit.
Live Examples
Four active signatures on the canonical devnet program — click any to verify:
Raffle— weighted random, single winnerRewards Selection— multi-winner weighted randomTrading Competition—rank_desc, top by scorePrediction Market—closest_to, nearest prediction wins
All examples live at verifiableoutcome.online/play
Verify Flow
- Install the standalone verifier package.
- Pick an included devnet signature from
artifacts/outcome_devnet_blessed_signatures.json. - Replay it through the local verifier.
- Check for:
verification_result : MATCHverification_reason : OK
CLI example:
cd verifiable-outcome-engine
yarn install
ANCHOR_PROVIDER_URL=https://api.devnet.solana.com \
yarn -s replay \
--sig 5wZUU5YQ8Nu5RddNeEEigYUEM5Q45C2SJmwLgdLhQcLQi4S3vYhAUvLc6YchYnxqU5b1pvEsBSD1USZPPDEaRVd2 \
--url https://api.devnet.solana.com \
--program-id 9tEramtR21bLBHvXqa4sofVBPa1ZBho4WzhCkCimFE1FMore included signatures:
artifacts/EXPECTED_TX_EXAMPLES.mdartifacts/outcome_devnet_blessed_signatures.json
Short demo runbook:
DEMO_RUNBOOK.md
Web Reviewer Flow
The package also includes a small reviewer-facing web surface:
cd verifiable-outcome-engine
yarn install
yarn webOptional: copy .env.example to .env to override defaults (port, RPC URL, program ID). Not required — the server starts with built-in defaults.
Open:
http://127.0.0.1:8787/playhttp://127.0.0.1:8787/verifyhttp://127.0.0.1:8787/widgethttp://127.0.0.1:8787/spec
The web surface is a reviewer flow. Live browser resolve is not part of this demo path.
Embeddable Widget
The reviewer flow can also be embedded on another page with the standalone widget script.
Use <vre-verify> when the page already knows the transaction signature:
<script src="https://verifiableoutcome.online/widget.js"></script>
<vre-verify
sig="YOUR_TX_SIGNATURE"
rpc="https://api.devnet.solana.com"
program-id="YOUR_PROGRAM_ID">
</vre-verify>Use <vre-verify-form> when users should paste their own transaction signature in-page:
<script src="https://verifiableoutcome.online/widget.js"></script>
<vre-verify-form></vre-verify-form>Both widgets call the public replay endpoint with signature, rpc, and programId and show MATCH / OK when replay matches the on-chain outcome.
Included Evidence
Packaged evidence:
- included devnet signatures:
artifacts/outcome_devnet_blessed_signatures.json
- reviewer commands:
artifacts/EXPECTED_TX_EXAMPLES.md
- evidence summary:
artifacts/public_evidence_summary.json
- Metaplex Agent Registry evidence:
artifacts/metaplex_agent_registry_evidence.json
For this standalone hackathon repo, the reviewer-facing source of truth is the bundled evidence set in this repository:
artifacts/outcome_devnet_blessed_signatures.jsonartifacts/EXPECTED_TX_EXAMPLES.mdartifacts/public_evidence_summary.jsonartifacts/metaplex_agent_registry_evidence.jsonartifacts/outcome_idl.json
Metaplex Agent Registry registration:
- agent asset:
C3qM2VVxR5dyjzqEvv9qHaaUDfTDneEaJCMTKV9bxQLX
- mint transaction:
429YX7c7p7RhZM3vrypCDXXBvPBsoPfXHyiLDLmjNVWXKHX8VeboDiecmu48vRkX9cGSiVQZUnnV9Rjk1PxUowjj
- registration evidence:
artifacts/metaplex_agent_registry_evidence.json
Operator Reference: Live Resolve
For operators or reviewers who want to generate a fresh on-chain outcome and then replay it, the package includes a operator resolve script.
This path is optional. The default reviewer flow uses included devnet signatures.
What it does
resolve:operator runs a full operator cycle on-chain:
- Submits a compiled artifact (outcome rules) to the program.
- Initializes an outcome runtime.
- Resolves the outcome — the program selects a result using deterministic RNG v1.
- Returns the transaction signature.
The returned signature can be passed directly to yarn replay to verify the result.
For economic adversarial use, read SECURITY.md; RNG v1 is replay-friendly but
predictable from public state.
Requirements
- Solana wallet keypair (
~/.config/solana/id.jsonor--wallet <PATH>) - Funded account on the target cluster
- RPC access to devnet or a local validator
Run
# Against devnet (requires funded wallet)
ANCHOR_PROVIDER_URL=https://api.devnet.solana.com \
ANCHOR_WALLET=~/.config/solana/id.json \
yarn -s resolve:operator \
--url https://api.devnet.solana.com \
--program-id 9tEramtR21bLBHvXqa4sofVBPa1ZBho4WzhCkCimFE1F \
--jsonOutput includes signature. Pass it to the verifier:
yarn -s replay \
--sig <signature from above> \
--url https://api.devnet.solana.com \
--program-id 9tEramtR21bLBHvXqa4sofVBPa1ZBho4WzhCkCimFE1FExpected: verification_result : MATCH / verification_reason : OK
Result files are written to tmp/resolve-operator/ by default. Use --out-dir <DIR> to override.
Current Limitations
Participant list size
The Partner Draw API commits participants directly in one Solana transaction. Because Solana transactions have a strict size limit, large lists or long participant IDs can fail with:
Transaction too largeFor now, use short participant IDs (e.g. "A1") and keep lists small (2–10 entries for readable IDs, up to ~20 with short IDs).
For larger leaderboards, the upcoming chunked snapshot commit flow will remove this limit — see INTEGRATION.md for details.
Boundaries
This package is:
- a hackathon-facing verifier reference,
- a standalone replay-by-signature surface,
- a reviewer path for included devnet evidence,
- the standalone hackathon repo for Verifiable Outcome Engine.
This package is not:
- a runtime redesign,
- a new RNG or replay semantics change,
- an artifact binding change,
- an adapters export,
- a claim that the npm SDK deploys the Solana program,
- a fee implementation claim,
- a product rollout claim.
The ecosystem monorepo continues separately and is not required to run this repository. Historical localnet signatures are excluded from public verification examples. Verification claims here are limited to transaction signature plus public RPC data for the included devnet evidence.
