The Realms logoRealms GOS A Governance Operating System
for the era of alignment

Click or press → to startTap to start

Think of our world as a computer

Reminder

The four ideas the rest of this deck stands on. The long version →

What the World Computer model is

citizens · users services and companies · applications institutions · operating system natural resources · hardware

Natural resources are the hardware, institutions the operating system, public services and companies the applications — and we are the users.

What an action is

E D A B C

Everything a government does is a stream of actions: A does B to C, watched by D, affecting E — the public, whose money it is.

What defection and cooperation are

the cost of defecting cheap costly capture pays cooperation pays

An action is defective when A and C gain and E pays. What decides it is the cost of defecting: cheap, and capture is the rational move; costly, and cooperation is the most profitable behaviour.

What a GOS is, and why it matters

action

A Governance Operating System puts the rules in code and runs them where everyone they affect can check. Decentralized digital checks and balances make defection expensive, so integrity no longer depends on trusted intermediaries.

Ciutat VellaBenimaclet
An example

From the European Union to a district of València

Each level has its own bodies and its own subdivisions. The rest of this presentation follows València.

European Union27 member states · a source of legislation, with no realm
Spain17 autonomous communities and 2 autonomous cities
Comunitat Valenciana542 municipalities · shaded: EMSHI's 51 member towns
València19 districts: zones of one realm
  • The EU: a sourceIts legislation applies in 27 States, but it runs no realm.
  • Spain: a realmIts 17 communities and 2 autonomous cities make legislation too, so each is a realm with Spain as its parent.
  • The Comunitat Valenciana: a realmEach of its 542 municipalities is a realm. EMSHI, a water body of 51 of them, is a source beside the line.
  • València: one realm, 19 districtsThe districts are zones inside it. Its 808,000 residents fill about 404 quarters.

Map data: Natural Earth · IGN, CC BY 4.0 · Ajuntament de València, CC BY 4.0

Legislation as code Realms GOS

Layers × domains = chapters, in one repository

Legislation is arranged along two axes. Where a layer and a domain cross there is a chapter: one Python file.

LAYER EU Spain Com. Valenciana EMSHIwater only València tax procedure register localregime water dataprotection language DOMAIN tax: Spain's chapter, then València's legislation/eu/es/tax.py → legislation/eu/es/vc/46250-valencia/tax.py realms-codices / legislation / eu/ source.json · releases.json data_protection.py es/ source.json · releases.json · calendar.json tax.py procedure.py register.py local_regime.py data_protection.py language.py vc/ source.json · releases.json · calendar.json local_regime.py language.py emshi/ source.json · releases.json water.py 46250-valencia/ source.json · calendar.json · no releases: its own layer tax.py procedure.py local_regime.py data_protection.py
  • A layer is a body that legislatesThe EU, Spain, the region, a water authority, the town. Each one works inside the limits of the one above.
  • A domain is a subject, named by GGGTax, procedure, register and so on. Every GOS that follows GGG uses the same names.
  • A chapter is one Python fileOne body's legislation in one domain. A missing file is an empty chapter: València writes no register, it runs Spain's.
  • Each domain runs top to bottomValència's tax is Spain's chapter, then its own. The EU and the region have none, so they are skipped.
  • The codex repository: realms-codicesA folder per body, nested as the bodies are. Each row of the grid is a folder, and each filled cell a file.
Legislation as code Realms GOS

A chapter overrides what the layer above allows

Spain's tax chapter marks what a town may change. València changes two settings and one method, and Spain's limits still apply.

Spain · legislation/eu/es/tax.py (excerpt)
class Tax(above("tax")): capital = overridable(False, legislation="TRLRHL Art. 72.3") surface_public_transport = overridable(False, legislation="TRLRHL Art. 72.3") ibi_urban_cap = forbid("tax_policy_propose", (F.code == "ibi_urban") & (F.rate > pct("1.10") + when(S.capital, pct("0.07")) + when(S.surface_public_transport, pct("0.07"))), each="taxes", legislation="TRLRHL Art. 72.3") @overridable(legislation="TRLRHL Art. 74") def ibi_bonus(self, owner): return 0 # a lower layer decides who
València · legislation/eu/es/vc/46250-valencia/tax.py (excerpt)
class Tax(above("tax")): capital = True surface_public_transport = True large_family_bonus = {"general": pct("60"), "special": pct("90")} def ibi_bonus(self, owner): # the share forgiven: the owner's verified large-family title's ...
València may set a rate of up to 1.24 %. At 1.30 % the proposal is refused.
  • The layer above marks each memberoverridable: a lower layer may redefine it. fixed: it may not. A forbid is never overridden or removed.
  • València redefines threeIt is a capital with surface public transport, and it gives large families a bonus. It inherits everything else.
  • Spain's forbid runs on València's valuesThe cap becomes 1.10 % + 0.07 + 0.07 = 1.24 %. A higher rate is refused when it is proposed.
  • Checked at install, enforced at every callRedefining a fixed member fails the install. Every layer's forbids apply to every operation.
The standard GGG

What a realm keeps: nine areas, one foundation

GGG names the records a government keeps, 60 kinds in all, grouped in nine areas. Follow one decision around the wheel: a bike lane in a city.

Decisions Departments and organizations Procurement Finance Licensing Land and property Realm and federation Identity and membership Justice FOUNDATION Proposal Vote Mandate Contract Department Organization Position Appointment Tender Bid BidScore Invoice Transfer Fund Budget TaxPolicy License Land Zone Realm Quarter Registry FederalVote User Member Human Identity Delegation Dispute Case Court Verdict Penalty CodexEvent notifications private documents Identity Human User Quarter Member Realm Zone Land User Vote Proposal User Mandate Proposal Department Tender Department Bid Organization License Organization Department Tender Contract Mandate Invoice Contract Transfer Fund Department Budget Dispute Contract Case Court Verdict Penalty FOUNDATION CodexEvent notifications private documents
Nine areas of governmentFrom who the members are to how disputes end. They share one foundation: the rules every action is checked against, and the record it leaves.
Each area keeps its own recordsA proposal, a fund, a licence, a court case. These are the main ones. Any GOS that follows GGG keeps them the same way.
Someone who lives hereAlba lives in one district of the city. She joins, and proves once that she is a real person who lives there.
A street, and who owns whatMain Street runs past plots the city already keeps track of: who owns each one, and what may be built on it.
The city decidesA bike lane is put to the neighbourhood. Everyone affected can vote, and the count is public.
A yes becomes permission to actThe roads department may now go ahead, up to an amount the vote set, and no further.
Companies compete for the workThe department publishes what it needs. Builders put in offers, sealed until the day they are opened.
Only a licensed builder may do itThe city issues the licences, so it can check on the spot that the winner is allowed to lay a road.
The winner signsThe best offer becomes an agreement, inside the limits the vote set. Both sides are bound by it.
The work is paid forThe builder bills the city, and the money leaves the roads budget. Anyone can see where it went.
If something goes wrongA neighbour challenges the work. A court hears it, decides, and can order the builder to pay.
Every step leaves a recordWhatever the area, each action is checked against the city's own legislation, and written down for good.
The standard GGG

Different GOS, one interface: ggg.did

A realm on Realms GOS and a realm on another GOS answer the same methods. Tools, and other realms, work with both unchanged.

ggg.did: 196 methods, and a record for every entity València on Realms GOS Python, on Basilisk Com. Valenciana on another GOS in any language written once, for every compliant realm ggg-mcpyour own AI assistantacts for you ggg-aithe realm's assistantexplains proposals gos.eartha hosting platformlists and hosts realms conformancethe test suitepass or fail a realm link: legislation, capital to capital · being added to GGG (ggg#3)
  • One interface, any implementationRealms GOS is Python on Basilisk; GGG's test GOS is Motoko. Each lists GGG in icrc10_supported_standards and answers ggg.did.
  • Tools are written onceggg-mcp lets your own AI assistant read any compliant realm and act under the power of attorney you grant. The suite checks any GOS.
  • Realms link across GOSValència can take the region's legislation, whatever the region runs: a vote on each side, and calls only between capitals.
One action, end to end Realms GOS

València sets its tax for 2027

From the proposal to each owner's invoice, every step is a GGG operation: checked first, then recorded. The figures are a sample.

tax_policy_propose by: a council member taxes: [{ code: "tax", rate: 1.20 % }] the caller holds the permission the policy is filed as a proposal every layer's forbids EU · Spain · Com. Valenciana · València Spain: rate ≤ 1.10 % + 0.07 + 0.07 1.20 % ≤ 1.24 %: allowed 1.30 % would be refused here, on filing proposal_vote the realm votes: yes · no · abstain effective_at: 1 Jan 2027, 00:00 accepted, then scheduled it runs at that time, not when the vote closes tax_assess Spain: compute_tax_assess (fixed) València: ibi_bonus (overridden) tax, 1.20 % of 100,000.00 €1,200.00 € large-family bonus, 60 %−720.00 € to pay480.00 € Event op · user · args · result · at one for each step above the Official Journal each day's actions, signed and chained to the day before: anyone can verify
  • The council proposesA council member files the 2027 tax policy, with a rate of 1.20 %.
  • Every layer checks itSpain's cap for València is 1.24 %, so it passes. At 1.30 % it would be refused on filing.
  • The realm votes, and the date is fixedOnce accepted, it waits for 1 January 2027, the time written in the proposal.
  • Each parcel is assessedSpain's chapter computes the tax; València's takes 60 % off for a large family.
  • Everything is on the recordEach step is an event, published in the realm's Official Journal.
One realm Realms GOS

A realm: quarters, a codex, extensions, and Casals

Every canister of a realm runs the same codex and the same extensions, each from a public repository and pinned by checksum. Casals runs the canisters.

València · one realm capital quarter · · · quarter 1quarter 2quarter 404 about 2,000 members per quarter · about 404 for València realms-codices legislation as code released by checksum codex 9f3c codex 9f3ccodex 9f3ccodex 9f3c realms-extensions about 35, first-party votingbudget land registryprocurement taxjustice censusvault Casals the conductor create · upgrade · snapshot · roll back · top up each realm approves its own upgrades
  • A realm, split by peopleA capital quarter, and as many quarters as it needs, each holding about 2,000 members.
  • One codex, from realms-codicesEvery quarter runs the same codex, with the same checksum. A quarter that runs another is flagged as drifting.
  • Extensions, from realms-extensionsVotes, budgets, land, procurement, tax: each a sandboxed backend with its screens, installed by the realm's vote.
  • Casals runs the canistersIt creates, upgrades, snapshots and rolls back the realm's canisters as one unit, and keeps their cycles topped up.
The marketplace Realms GOS

A shop for governance, and who pays whom

Anyone can build something a realm can use. Anyone can browse. A realm takes nothing it has not voted for.

realmsgos.org/marketplace Search the marketplace Extensions Codices Assistants Verified only Voting EXTENSION Proposals, ballots and results Verified Journal EXTENSION A signed record of each day Verified Budget EXTENSION Funds, budgets and spending Spain · tax CODEX A country's tax legislation Verified Data protection CODEX The EU directive, as code Verified Clerk ASSISTANT Answers members' questions installs realm realm realm each one by its own vote pays to install the developer who built it a monthly licence pays for the review behind the mark Paid listings are not switched on yet: today the marketplace shows the price, and nothing changes hands.
  • Three kinds of thing to installFeatures a realm can add, ready-made legislation, and AI assistants it can put to work. Reviewed ones carry a mark.
  • Nothing arrives uninvitedNo one can push anything into a realm. Its members vote, and the realm fetches it itself.
  • Realms pay the people who buildBuild it once, and every realm that adopts it pays you. A small town pays the same way a city does.
  • Being trusted costs the builder, not the realmA licence paid by the month pays for the audit behind the mark. Browsing, and publishing without it, stay free.
The marketplace Realms GOS

The marketplace's economics

Open to anyone who builds, trusted through review, and chosen by each realm.

Developers

Build once, for every realm

  • Publish extensions, codices and assistants, with or without a licence
  • Make a listing free, or set its price. Each realm's purchase is recorded for its developer
  • A developer licence buys an audit: a Verified badge, and a place in the verified-only filters and rankings
Realms

Choose by their own vote

  • Browse for free, and install only what their members approve
  • Buy a listing once; later versions install as they are approved
  • Pay their own running costs: the cycles of their canisters, kept topped up by Casals
Reviewers

Trust, version by version

  • Approve each version before any realm can install it
  • Audit a licensed developer's listings on request
The market

What realms use rises

  • Installs and likes rank the listings
  • No lock-in: a realm can pin code by its checksum, or trust other approvers
Inside a realm Realms GOS

One program, one path for every call

Every canister of a realm, the capital and each quarter, runs the same Python program. Cedar answers the yes-or-no questions, a sandbox runs the code the realm did not write, and plain Python does the rest.

Realm frontend, CLI read and run, in JSON Other realms run, canister to canister GGG clients ggg_* methods, in Candid Timers tasks, journal, sync checks JSON run Candid main.py: read and run an operation's name and JSON arguments ggg_methods.py → ggg_api.py Candid ↔ JSON dispatch(name, args) the same call fires tasks Dispatcher · core/op.py every call, one path: find the @op → permission → laws → ranges → proposal or run → audit → hooks grant? allowed? codex effects as calls Delegation poa.py, pending.py grants, approvals Authorization auth.py gathers the facts asks Cedar engine cedar-policy decides yes or no Codex runtime legislation.py guards, hooks runs Sandbox sandbox.py codex, extensions runs the @op extension code Operations · api/ one module per subject; every operation is one @op function members · orgs · delegation · actions · proposals · tasks · setup · requests · notifications treasury · taxes · assets · licenses · justice · procurement · external · quarters · links · sweeps sync_checks · federation · codex · installs · propagation · extensions · crypto · journal · signing read, write Entities · ggg/ identity · governance · finance justice · land · system stored as rows Stable memory · ic-python-db each row is JSON in a StableBTreeMap Event rows are the audit log chain.py OUTSIDE THE CANISTER IC management canister vetKeys, HTTPS outcalls Token ledgers payments, transfers Other realms quarters, capitals: sync, sweeps File registry, marketplace the code, and who approved it Codex sources chapter files over HTTPS
Who calls in, and through which doorThe realm's frontend and CLI, other realms and GGG clients. read and run take an operation's name and JSON; the ggg_* methods of ggg.did take Candid.
One path for every callWhoever calls, even the realm's own timers, the dispatcher checks the call the same way, then runs it or files it as a proposal, and audits it.
Cedar says yes or no; the sandbox runs what the realm did not writeCedar decides the permission and the codex's laws. Codex guards and hooks, and extension code, run in subinterpreters on an instruction budget; what they do comes back as new calls.
Then the operation runsEach operation is one function. It reads and writes the realm's entities, kept as JSON rows in the canister's stable memory, and each change it makes leaves an Event in the audit log.
Everything outside goes through chain.pyOne module reaches the rest of the world: the IC's keys and HTTPS outcalls, token ledgers, other realms, the file registry and the marketplace.
In one sentence

Legislation as code, run by its community Realms GOS: open source, on the Internet Computer, following GGG