A Decentralized Fact-Adjudicated Coliseum on GenLayer
Aletheia is a decentralized dispute and debate terminal where users challenge claims (Theses) not through mere rhetoric, but through verifiable evidence. Unlike typical subjective AI forums, every argument proposed or challenged in Aletheia must be anchored to a public Evidence URL. GenLayer's validators fetch the live webpage content on-chain, and an LLM arbiter judges the claims strictly against the retrieved web facts.
Below is the architectural flow of Aletheia, showing how claims and evidence are processed and verified:
flowchart TD
subgraph Arena ["The Dragon Coliseum"]
Topic["Topic: Claim and Evidence Link"]
Contender["Challenger: Counter Claim and Evidence Link"]
end
subgraph GenLayer ["GenLayer VM Execution"]
Crawler["Web Crawler: Fetching Evidence Text"]
Arbiter["Dragon Arbiter LLM Adjudicator"]
end
subgraph Consensus ["Validator Consensus Jury"]
Leader["Leader Node: Coordinates Evaluation"]
Validators["Validators: Verify and Agree on Block"]
end
subgraph Storage ["On-Chain Registry"]
TreeMap["Storage: Rotate Proponent or Defend Thesis"]
Queue["Circular Buffer Log Queue"]
end
Topic -->|Submit Clash| Leader
Contender -->|Submit Clash| Leader
Leader -->|Fetch URLs| Crawler
Crawler -->|Adjudicate facts| Arbiter
Arbiter -->|Categorical Verdict| Leader
Leader -->|Propose block| Validators
Validators -->|Verify and reach consensus| Storage
Storage -->|If Overthrown| TreeMap
Storage -->|Prune Event Logs| Queue
Aletheia is designed to address key production constraints of LLM-native smart contracts:
- Factual Grounding (Web Crawling):
We enforce factual grounding by requiring an
evidence_urlon proposal and clash. The contract fetches the live page content usinggl.nondet.web.get(url)and truncates it to fit LLM window sizes, ensuring the judge bases its verdict strictly on verifiable public text. - Consensus Stability (Tight Margin Tolerance): By grounding evaluations on specific crawled text rather than general training data, we naturally reduce LLM variance. This allows us to tighten the validator consensus tolerance window to 12 points (down from 30 in previous builds), improving audit accuracy.
- Aligned Exception Routing:
Exception types are unified under
ERR_USERandERR_LLM. The leader node and validators raise the same tagged exceptions during parsing errors, preventing consensus failure when handling malformed LLM outputs. - O(1) Circular Event Buffer:
Instead of clearing and rebuilding the event ledger on every write, we overwrite elements at a modulo index (
total_debates % MAX_LOG_SIZE). This keeps log prunings at anO(1)gas fee on-chain, while the view function sorts it chronologically off-chain. - TreeMap Storage Partitioning:
We store state fields in independent maps (
arena_topics,arena_proponents,arena_claims, etc.) instead of serializing the entire arena object to a JSON string. This eliminates the gas cost of serialization/deserialization during writes.
propose_thesis(topic: str, opening_claim: str, evidence_url: str) -> str- Establishes a new debate arena, setting the creator as the proponent.
clash_thesis(arena_id: str, contender_claim: str, contender_evidence_url: str)- Launches an AI consensus duel. The incumbent stands unless the challenger is factually superior.
get_stats() -> dict- Returns global counters: total arenas, total debates, total overthrows.
get_arena(arena_id: str) -> dict- Returns detailed state and progression history for a specific topic.
get_arenas(start: int) -> list- Paged list of debate arenas, newest first.
get_ledger(start: int) -> list- Paged list of historical event logs sorted chronologically (newest first).
pip install genvm-linter
genvm-lint contracts/aletheia.pyMake sure the GenLayer test runner is installed, then execute:
gltest tests/integration/ -v -s --network studionetcd frontend
npm install
npm run devMIT. Owned and maintained by 9ja_maxx.