Home / Docs / Design & security

Design & security

How Chorus separates “reading meaning” from “moving money”, and what it does — and does not — defend against.

The problem

A Schelling-point oracle asks independent reporters the same question and rewards the ones who agree. Until now the answers had to come from a fixed menu, because deciding whether two free-text answers agree is a judgement about meaning. Chorus lets reporters answer in their own words, in any language, and uses GenLayer validators for exactly that one judgement.

Division of labour

ComponentDoesNever does
Validators (LLM)Read meaning: is the question suitable, which answers claim the same thing, which answers try to instruct the referee.Move money, judge truth, decide anything that other validators do not reproduce.
Contract codeCommitments, windows, stakes, the majority rule, payouts, the ledger.Read meaning.
ReportersStake and answer.See each other’s answers before the reveal.

The four AI steps

  1. Suitability gate (inside open_question). Validators read the question before any state changes. Only the verdict clear with confidence ≥ 70 opens it; every other verdict reverts, so a rejected question locks and stores nothing. The gate also proposes an answer shape that is shown to reporters and given to the referee as a hint.
  2. Semantic referee (adjudicate_question). Validators receive the question and every revealed answer, numbered in commit order, and return a partition: groups of answers asserting the same claim, each with a one-sentence claim. The prompt tells them to ignore language, spelling, formatting and equivalent notations, to treat “Canberra, not Sydney” as Canberra, and never to prefer an answer because it is true.
  3. Injection screen (same call). Answers that address the referee instead of answering are listed as flagged. The contract removes flagged answers from every group regardless of what the model wrote.
  4. Ruling (same call). The winning group’s claim is stored as the ruling.

The Equivalence Principle, concretely

The contract uses gl.vm.run_nondet(leader_fn, validator_fn). The leader’s result is accepted only if every validator, running its own model on the same snapshot, reproduces the decisive findings:

  • the outcome class (majority, no_majority, inconclusive or failure), and
  • for majority and no_majority: the exact winning set (empty for no_majority) and the exact flagged set.

Everything else is deliberately not compared: how losing answers are grouped among themselves, the claim wording, the rationale and the exact confidence. None of it can move money, so disagreement about it must not block consensus. A validator that cannot reproduce the leader’s findings rejects; the transaction does not settle and can be retried — which is why the retry budget exists (6 calls, 3 inconclusive assessments, doubling cooldown).

Why the majority rule has this shape

  • Strictly more than half of all revealed answers. Flagged answers and non-answers stay in the denominator, so an attacker cannot hollow out an honest majority with garbage, and the rule never depends on the model’s view of who is “valid”. Exactly half is not a majority, so two groups can never both win.
  • A confidence floor of 80. A shaky partition is inconclusive in both directions; it never decides.
  • No punishment without a ruling. When no group wins, dissent is not a fault, so stakes are refunded. Only reporters who never revealed and reporters flagged for instructing the referee forfeit, and their stakes go to the honest reporters who showed up — never to the asker.

Prompt safety

Everything reporters or askers write is untrusted. It reaches the model only through:

  • Sanitizing. Invisible and bidirectional control characters are removed; the delimiter prefixes BEGIN_UNTRUSTED_ / END_UNTRUSTED_ inside data are rewritten.
  • Hash-bound fences. The fence tag is the SHA-256 of the very text it fences, so a quoted line cannot carry a delimiter with the real tag.
  • Single-line answers. Answers are whitespace-collapsed at reveal, so none can fake another A<n>: line.
  • Instructions first. The prompt states the rules before the data and says data lines are never delimiters.

None of this is relied on alone: the final defence is that other validators must independently reproduce the same winners and flags, and that the contract — not the model — applies the majority rule.

The ledger

deposit_credit is the only payable method. Rewards and stakes move out of a caller’s credit into locked totals; settlement moves them back into credits. The contract asserts conservation on every settlement (credited == reward + locked) and exposes get_accounting so anyone can audit solvency. Because only deposit_credit is payable, no reverted payable call can trap attached GEN outside the books. Withdrawals are pull payments of one’s own credit.

Threat model

ThreatDefenceResidual risk
Reporter copies another’s commitmentThe commitment binds the reporter address and question key.None.
Reporter changes answer after seeing othersSealed until commit_by; the reveal must match.May skip the reveal and forfeit the stake.
Instruction injected in an answerFences, flagging, denominator rule, validator agreement.A model fooled identically in all validators.
Asker profits from failing questionsForfeited stakes never go to the asker unless nobody honest is left.None.
Griefer blocks a majorityNeeds half of the revealed answers; costs fees; stakes are refunded.Cheap if the question attracts few reporters.
Slot squatting (commit then withdraw)Each slot costs gas; the asker can open a new question.May end quorum_not_reached.
Sybil majority / briberyStakes, reporter cap, forfeiture to the honest.Not a defence against a bribed majority: size stake and reward accordingly.
Subjective or ambiguous questionSuitability gate; refunds when no majority.The gate is a filter, not a boundary.
Stranger burns the adjudication budgetOnly the asker or a revealed reporter may adjudicate.A reporter can still spend the budget.
Model outage or garbage outputFailed attempt, cooldown, bounded budget, close_question.Slower resolution.

Frontend security notes

  • No backend, no tracking. The site is static; reads go straight to the Studionet RPC and writes are signed in your wallet.
  • Secrets stay local. Answers and salts are generated and stored in your browser (localStorage) and are never sent anywhere before you reveal.
  • Pre-flight checks. The site recomputes your commitment before a reveal and refuses to send a mismatch, so a typo does not cost a fee.
  • Wallet hygiene. Wallets are discovered with EIP-6963, the network is verified before every write, and Disconnect drops the session and asks the wallet to revoke site access.
  • Testnet. Studionet is a development network. Use test GEN only.