Three machines sign your balance. If two agree, you can claim. Trust is a threshold, not an emotion. This is the architecture of belief in a system where nobody trusts anyone — and that, paradoxically, is what makes it trustworthy.Documentation Index
Fetch the complete documentation index at: https://docs.generalmarket.io/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start: Check Your Balance
{ "batch_id": 1, "player": "0x...", "balance": "15000000", "stake_per_tick": "100000" }
To claim on-chain, you need BLS-signed proofs from 2/3+ oracles. See Bot Lifecycle for the full claim flow.
BLS Verification Flow
Why Off-Chain Balance Tracking?
Resolving every tick on-chain for every player in every market would be ruinously expensive. Gas costs would devour the stakes before anyone could win them. So Vision uses a hybrid architecture — the pragmatist’s compromise between idealism and reality:- On-chain: Deposits, withdrawals, bitmap commitments, and BLS-verified claims.
- Off-chain: Tick resolution, bitmap reveals, balance computation, and BLS signing.
BLS Signature Flow
The balance proof lifecycle follows 5 steps. Each step is a negotiation between a player who wants money and machines that require proof. The machines always win this negotiation.Step 1: Player Requests Balance Proof
The player queries an oracle node for their current balance:In the full implementation, each oracle returns a partial BLS signature. The player collects signatures from multiple oracles to aggregate.
Step 2: Oracles Compute Balance
Each oracle independently computes your balance. Three machines, working alone, arriving at the same number — or not. The process:- Tracks all tick results since the player’s last claim.
- Sums deposits + winnings - losses - fees.
- Arrives at the player’s
newBalance.
Step 3: Oracles BLS-Sign the Balance
Each oracle signs the following message. The signature is the oracle’s attestation: I have computed this balance and I stake my cryptographic identity on it:Step 4: Player Aggregates and Submits
The player aggregates the partial BLS signatures into a single aggregated signature and submits it on-chain. Multiple voices, fused into one proof:Step 5: Contract Verifies and Pays
The contract performs its final duty — verification followed by payment, or verification followed by silence:- Reconstructs the same message hash from the parameters.
- Verifies the aggregated BLS signature against the oracle registry’s aggregated public key.
- If valid:
- Compares
newBalancetooldBalance. - If
newBalance > oldBalance: computes winnings, deducts the 0.05% fee, and transfers the payout. - If
newBalance <= oldBalance: records the loss (balance decreased), no payout.
- Compares
- Updates
position.lastClaimedTick = toTick.
Claiming vs. Withdrawing
Two doors out. One lets you take your winnings and stay. The other lets you take everything and leave. Both require proof that the money is yours:Claiming (Partial)
claimRewards lets a player claim accumulated winnings while staying in the batch:
- Pays out the difference between old and new balance (minus fees).
- The player remains in the batch and continues playing.
lastClaimedTickis updated to prevent double-claims.
Withdrawing (Full Exit)
withdraw removes the player from the batch entirely:
"WITHDRAW" action tag:
- Fees are calculated on total profit (finalBalance - totalDeposited), not just the last claim.
- The player’s position is deleted from storage.
- All remaining USDC is transferred to the player.
Force Withdraw
Oracles can force-withdraw a player via BLS consensus. This is the protocol’s version of being asked to leave — polite, cryptographically verified, and final:"FORCE_WITHDRAW" action tag. This is an oracle-level operation that requires consensus.
Claim Guards
The contract enforces several safety checks. Every guard is a lesson learned from the history of broken protocols:| Check | Error | Description |
|---|---|---|
| Player must have joined | NotJoined | stakePerTick == 0 means not in batch |
| No double-claiming | TickAlreadyClaimed | fromTick must be after lastClaimedTick |
| Valid tick range | InvalidTickRange | toTick >= fromTick |
| BLS signature valid | InvalidBLSSignature | Aggregated signature must verify |
| Solvency | InsolventPayout | Contract must hold enough USDC |