Home / Docs / Guide

Chorus guide

Everything you need to ask, answer, adjudicate and integrate. Also see the contract API and the design & security notes.

Introduction

Chorus is an Intelligent Contract on GenLayer that turns open-ended questions into on-chain rulings. An asker poses a question and escrows a reward. Reporters stake a bond and answer in their own words — in any language. The contract pays the people whose answers mean the same thing, as long as they are a strict majority, and publishes the shared claim as a ruling.

The idea comes from Schelling points: when people cannot coordinate, they still converge on the answer that stands out as obvious. Chorus pays for that convergence and reads it semantically, which plain deterministic code cannot do.

Chorus reports agreement, not truth. A ruling is “what a strict majority of staked reporters independently said”. Pick questions whose obvious answer is also the correct one.

Quickstart

  1. Install a wallet that supports EIP-6963 (MetaMask, Rabby, Coinbase Wallet…). Chorus discovers every installed wallet and lets you choose.
  2. Connect with the button in the header. If your wallet is on another chain, Chorus shows a banner with a Switch to Studionet button. It adds the network for you (chain ID 61999) if the wallet does not know it.
  3. Get test GEN. On the Account page use “Get 10 test GEN” (Studionet only). Fees and stakes are paid in GEN.
  4. Ask on the Ask page, or answer a question from Explore.
  5. Reveal your answer once the commit window closes. Your salt is in My answers.
  6. Adjudicate after the reveal window, then withdraw your credit from the Account page.
ℹ️
Everything you do in the UI is a normal contract call signed in your wallet. Chorus has no backend: the site reads the contract directly from Studionet.

Core concepts

Question

Identified by the asker’s address plus a free-form question_id (up to 64 characters). Ids are unique per asker, so two people can reuse “capital” without colliding. A question is 10–400 characters.

Reward, stake and credit

The reward is paid by the asker. The stake is a bond every reporter locks. Both come from your ledger credit: GEN you deposited into the contract. Settlement never sends GEN; it only moves numbers on the ledger, and each person later withdraws only their own credit (pull payments).

Commit → reveal

A reporter publishes a SHA-256 commitment of their answer and a secret salt. Nobody, including validators, can read or copy it. After the commit window the reporter reveals the answer and salt; the contract recomputes the hash and rejects mismatches.

Ruling

Validators partition revealed answers into groups that assert the same claim. A group wins only with strictly more than half of all revealed answers. With a winner the contract stores a one-sentence claim, the support count and a rationale.

Life of a question

Opengate + escrow Commit windowsealed hashes Reveal windowanswer + salt Adjudicate≤ 3 days, ≤ 6 calls Resolved Undecided
  1. Open. The asker calls open_question. Before any value is locked, validators run the suitability gate: the question must be clear with confidence ≥ 70. The reward moves from credit into escrow.
  2. Commit. Up to max_reporters reporters call commit_answer with their commitment, locking the stake. They may withdraw_commit until the window ends.
  3. Reveal. Reporters call reveal_answer. Unrevealed commitments forfeit their stake.
  4. Adjudicate. With at least min_reporters revealed answers, the asker or any revealed reporter calls adjudicate_question.
  5. Settle. Winners gain credit; otherwise the question closes undecided and everybody honest is made whole. Anyone may call close_question if quorum is missing or the budget/deadline is spent.

Roles

RoleCanCannot
AskerOpen and cancel (before any commit), adjudicate, close.Answer their own question.
ReporterCommit, withdraw before the commit deadline, reveal, adjudicate if revealed.Commit twice to one question.
AnyoneClose a question that cannot be ruled, read every view, deposit/withdraw own credit.Move anyone else’s credit.

Writing a good question

  • Objective and already knowable. “What is the chemical symbol for gold?” works; “Will BTC be above $100k next week?” is not_yet_knowable.
  • One focal answer. “What is the best programming language?” is subjective and gets rejected.
  • Unambiguous. Name the entity, the date and the unit. Ambiguous questions are rejected as ambiguous.
  • Safe. Harmful or private-data questions are rejected as unsafe.

The gate also infers an answer shape (name, number, date, yes_no or phrase) that guides the referee.

Answering well

You are paid for matching the majority, so write the answer you expect most other careful people to give: short, factual, and focused on the claim. Language and phrasing do not matter — “Canberra”, “It’s Canberra, not Sydney.” and “کانبرا” are one claim. Answers are 1–240 visible characters. Do not try to instruct the referee: an answer that does is flagged, can never win and forfeits its stake.

Commitments and salts

The commitment is SHA-256 over four-byte big-endian length-prefixed UTF-8 fields: the domain chorus-answer-v1, the question key asker:question_id (lower-case address), the reporter address (lower-case), the normalised answer and your salt. Whitespace in the answer is collapsed before hashing. The site does this in your browser; here is the same logic if you need to do it yourself.

// JavaScript
const enc = new TextEncoder();
const norm = (s) => s.split(/[\t\n\v\f\r\x1c-\x1f \x85\xa0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]+/).filter(Boolean).join(" ");
async function commitment(asker, id, reporter, answer, salt) {
  const parts = ["chorus-answer-v1", `${asker.toLowerCase()}:${id}`, reporter.toLowerCase(), norm(answer), salt].map((p) => enc.encode(p));
  const buf = new Uint8Array(parts.reduce((n, p) => n + 4 + p.length, 0)); let o = 0;
  for (const p of parts) { new DataView(buf.buffer).setUint32(o, p.length); o += 4; buf.set(p, o); o += p.length; }
  const d = new Uint8Array(await crypto.subtle.digest("SHA-256", buf));
  return "0x" + [...d].map((x) => x.toString(16).padStart(2, "0")).join("");
}
⚠️
Your salt is your key. Salts are 16–64 characters from A-Za-z0-9_.~-. The site generates 256 random bits and keeps them in this browser. Download a backup from My answers before you close the tab — without the salt you cannot reveal and your stake is forfeited.

Rules and limits

ParameterValue
Minimum reward / stake0.0001 GEN each
Question text10–400 characters
Answer text1–240 visible characters
Question id≤ 64 characters, letters, digits, _ . -
Reporters3 ≤ min ≤ max ≤ 12
Commit window≥ 2 minutes, at most 30 days from now (the UI offers 10 minutes to 3 days)
Reveal window≥ 2 minutes, ≤ 7 days
Adjudication window3 days after the reveal deadline
Adjudication budget6 calls and 3 inconclusive assessments; cooldown starts at 60 s and doubles up to 1 h
Gate confidence≥ 70 and verdict clear
Referee confidence≥ 80 for a usable assessment

Settlement and payouts

With a ruling every winner gets their stake back plus an equal share of reward + all forfeited stakes; the division remainder goes to the earliest winner. Outvoted reporters, flagged answers and no-shows forfeit their stake into that pool.

Without a ruling (no majority, quorum missed, deadline or budget exhausted) the reward returns to the asker. Honest revealed reporters get their stake back plus an equal share of the stakes forfeited by no-shows and flagged answers. Dissent is never punished.

Worked example

Reward 0.002 GEN, stake 0.0003 GEN, six reporters. Four reveal the same claim, one reveals a different city, one never reveals. Forfeited stakes: 2 × 0.0003 = 0.0006 GEN; pool = 0.002 + 0.0006 = 0.0026 GEN; each of the four winners receives 0.0003 + 0.00065 = 0.00095 GEN. Every figure is on the ledger and auditable on the Account page. A real finished example from the project’s live Studionet run — four answers in English, Persian and a longer phrase grouped as Canberra, one outvoted, one instruction attempt excluded — is question LIVE-20261202105009-AU.

Using Chorus as an oracle

Call get_ruling(asker, question_id). Treat resolved as the only signal that a ruling exists; status and settlement explain the other cases. Use support / revealed as the strength of agreement. Try it in the Oracle lookup.

Troubleshooting

The wallet says “wrong network”

Click Switch to Studionet in the banner. If the wallet does not know the network, Chorus adds it: chain ID 61999, RPC https://studio.genlayer.com/api, symbol GEN. Approve the request in the wallet.

“Insufficient funds” or fee errors

Studio requires fees on every write. Use Get 10 test GEN and make sure you also have enough credit for the reward or stake.

“Question rejected as subjective / ambiguous …”

The suitability gate declined the question. Nothing was locked. Rephrase it so it has one objective, already-knowable answer and try again.

Adjudication ended “inconclusive” or “no consensus (UNDETERMINED)”

Validators did not agree strictly enough. Nothing changed on chain. Inconclusive assessments count toward the budget of 3; a pure UNDETERMINED does not. Wait for the cooldown and try again.

“Reveal does not match the sealed commitment”

The answer or salt differs from what you sealed. Spaces are normalised but spelling and case are not. Import your backup in My answers; the site refuses to send a reveal that it can already see is wrong.

Too many requests (429)

Studionet rate-limits reads to roughly 60 per minute per IP. The site queues and caches reads and retries automatically; just wait a few seconds.

Glossary

Schelling pointThe answer people converge on without coordinating because it stands out.
Equivalence principleGenLayer’s rule that validators must reproduce a non-deterministic result closely enough; Chorus compares only the winning group and flagged set.
Intelligent ContractA GenLayer contract that can call LLMs and the web inside consensus.
StudionetGenLayer’s hosted development network (chain 61999).
CreditYour withdrawable balance on the contract’s ledger.