Gnosis Conditional Tokens
A generic, oracle-agnostic ERC-1155 framework for tokenizing outcomes of future events, enabling combinatorial prediction markets and becoming the settlement primitive under Omen and Polymarket.
▶ Run interactive simulation animated mechanism with editable parameters
How it works onchain
Summary
The Gnosis Conditional Tokens Framework (CTF) is a generic on-chain primitive for representing the outcomes of future events as fungible, tradable tokens. Rather than shipping a full prediction-market application, Gnosis distilled the core accounting logic — locking collateral against a set of mutually exclusive outcomes and redeeming it once an oracle reports a result — into a single, reusable smart contract implementing the ERC-1155 multi-token standard. Any developer can prepare a "condition" (a question, an oracle, and a number of outcome slots), split ERC-20 collateral into position tokens for each outcome, trade those tokens on any venue, and later redeem them for collateral proportional to the oracle's reported payout.
The framework's distinguishing ambition was combinatorial prediction markets: because positions can nest multiple conditions, the same collateral can express joint and conditional bets ("event N given event A occurred") while keeping deeper layers fungible in a single contract. The CTF became Gnosis's settlement layer for its own market front-end Omen, and — most consequentially — the same contract family was adopted by Polymarket, which by 2025 had reportedly cleared over $2B in election-related volume alone. It is one of the more durable pieces of prediction-market infrastructure in the ecosystem.
Design (Mechanism)
The contract centers on four verbs, all operating on ERC-1155 balances:
- Prepare a condition. An oracle address, a
questionId, and anoutcomeSlotCount(max 256) are hashed viakeccak256(abi.encodePacked(oracle, questionId, outcomeSlotCount))to a uniqueconditionId. This initializes an empty payout vector to be filled later. - Split. A user deposits ERC-20 collateral (or burns a shallower position) and receives one position token per element of a partition — a set of disjoint, non-trivial index sets over the outcome slots. Splitting
{Yes, No}from DAI yields a Yes token and a No token, each redeemable 1:1 with the deposited DAI depending on the result. - Merge. The inverse of split: burning a complete partition of position tokens recovers the shallower position or the underlying collateral.
- Redeem. After the oracle calls
reportPayouts()with a payout vector (fractions summing to one), holders callredeemPositions()to receive collateral proportional to their outcome slots' payout weights.
Two design choices make the framework unusually general. First, positions are not single outcomes but outcome collections — non-empty proper subsets of a condition's slots, encoded as 256-bit index sets. A position combines a collateral token with one or more collections across one or more conditions, and its value is the product of its constituent collections' values. This is what enables deep / combinatorial positions: nesting conditions lets a market express conditional probabilities without fragmenting liquidity across separate contracts. Second, the framework is oracle-agnostic — it never decides truth itself; it only records who is allowed to report and pays out whatever that reporter says, deferring resolution to systems like Reality.eth / Kleros in practice.
Collection IDs are derived by hashing a condition ID and index set to a point on the alt_bn128 elliptic curve and combining via point addition — an Elliptic Curve Multiset Hash chosen for commutativity and collision resistance, replacing an earlier additive hash. The audited implementation lives at mainnet 0xC59b0e4De5F1248C1140964E0fF287B192407E0C, with deployments also on xDai/Gnosis Chain (0xCeAfDD6b...) and Rinkeby. Code is LGPL-3.0; the repo was created November 2018 and released through v1.0.3 (docs dated September 2020).
Outcome
Status: major_success (as infrastructure). The CTF succeeded technically and became a widely reused primitive, even though Gnosis's own consumer market Omen never achieved dominant traction. The framework's most important outcome was second-order: it provided the settlement rails for Polymarket, the eventual market leader in prediction markets. The contract family remains actively audited into 2024 (ChainSecurity assessed a Polymarket-context deployment in April 2024), evidence of continued production use years after Gnosis itself pivoted toward Gnosis Chain and Safe. The combinatorial-market vision that motivated the design was, by contrast, largely unrealized in practice — real usage centered on simple binary and categorical markets.
Why it worked
- Right level of abstraction. By separating outcome accounting from market-making, UI, and oracle, Gnosis produced a primitive other teams could build on without adopting the whole Gnosis stack. ERC-1155 made positions natively tradable on generic venues and AMMs.
- Neutrality on truth. Refusing to hard-code an oracle meant the same contract could serve UMA-style, Reality.eth, Kleros, or centralized resolvers — a key reason a competitor (Polymarket) could adopt it wholesale.
- Fungibility preservation. Holding all conditions in one contract, keyed by hashed collection/position IDs, kept deep positions fungible and composable instead of spawning a new token contract per market.
Limitations and criticisms
- Combinatorial markets never took off. The framework's headline feature — nested, conditional markets for richer information discovery — saw little real demand; users overwhelmingly wanted simple binary markets, so much of the design's sophistication went unused.
- Omen did not win the category. Gnosis captured relatively little of the value its own primitive enabled; Polymarket, built on the same underlying design, became the commercial leader — a case where the primitive succeeded broadly even as Gnosis's own product did not.
- Real risk surfaced. An audit found two critical issues — a collection-forgery/reentrancy path that could drain collateral, and a birthday-attack collision in the original additive hash — both requiring non-trivial fixes (burn-before-mint ordering, EC multiset hash) before the contract was safe.
Lessons
- Ship the primitive, not the app. The most enduring value came from a small, neutral, well-specified contract that others could adopt — including direct competitors. Betting on being infrastructure rather than the winning front-end paid off in reach even as it under-monetized for Gnosis.
- Generality has a demand ceiling. Designing for the full combinatorial vision added surface area and complexity that the market never used; a leaner binary-market design would have served most real usage. Build for observed demand, keep the elegant generalization optional.
- Custom cryptographic accounting needs adversarial review. Encoding positions via homomorphic hashing (additive, then EC multiset) introduced collision and forgery vectors that ordinary token contracts don't have. Novel ID schemes deserve the same scrutiny as the money-movement code, because here they were the money-movement code.
- Oracle-agnosticism is a moat and a liability. Deferring truth made the framework broadly adoptable, but it also externalized the hardest problem (correct resolution) onto downstream integrators, where most prediction-market disputes actually arise.
Redesign (EDITORIAL — hypothesis, not fact)
The following is the researcher's analysis, not established fact. If rebuilt today, the strongest version of the CTF would keep the oracle-agnostic ERC-1155 core but treat combinatorial depth as an opt-in extension module rather than a first-class cost paid by every market — most deployments only need binary/categorical conditions, and the base contract could be smaller, cheaper, and easier to audit if the nesting machinery lived behind a separate periphery contract. Second, resolution — empirically the locus of prediction-market disputes — deserves first-class support: a standardized, escalation-game oracle adapter (optimistic-oracle style with a dispute window and bonded challenges) shipped alongside the core, so integrators inherit a battle-tested resolution path instead of each wiring their own. Third, the position-ID cryptography should be minimized or eliminated where possible; deriving IDs from plain keccak of canonically-ordered condition/index-set tuples avoids the homomorphic-hash collision class entirely at the cost of losing cheap on-chain set merging, a trade most markets would accept. Finally, a modern redesign would treat the AMM/CLOB market-making layer as an explicit companion standard so liquidity provisioning isn't reinvented per integrator — arguably the single biggest gap between "elegant primitive" and "product people use," and the gap Polymarket, not Gnosis, ultimately closed.
Sources
- conditional-tokens-contracts (GitHub, gnosis org) — primary (contract)
- Conditional Tokens Developer Guide (ReadTheDocs, v1.0.3) — primary (docs)
- Audit Report — Conditional Tokens (in-repo) — primary (audit)
- Ten Years of Gnosis: From Prediction Markets to a User-Owned Open Finance Revolution — primary (retrospective)
- ChainSecurity — Code Assessment of the Conditional Tokens Smart Contracts (Polymarket, Apr 2024) (audit)
- Gnosis Conditional Token Framework (CTF) — analysis (analysis)
Related experiments
Last verified: 2026-07-26 · Spot an error? Suggest a correction