garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /docs/mockups/federation/research.md

raw

Research: how other worlds connect servers, and what Cartopolis already has

Read before README.md, which is the design. Everything here was checked on 2026-11-10: the OpenSimulator wiki, the Hypergrid 2.0 writing, the 2016 security review, Intel's scaling paper, the Matrix, MIMI and AT Protocol specifications, Overte's and Resonite's architecture pages, Third Room's README, Photon's write-up, and this repository's code and notes.

1. OpenSimulator's Hypergrid

What it is. OpenSim worlds are grids of 256 m regions. A grid has central services (the ROBUST suite: user accounts, inventory, assets, friends, grid map). The Hypergrid, written by Crista Lopes from 2008, removes two central assumptions: the map is no longer one grid's property (an operator links foreign regions into their own map at coordinates of their choosing), and an agent may be a foreign user, whose home services live on another grid. A "virtual world hyperlink" is a region on the map, named host:port:Region.

The services (Hypergrid Protocol, Implementation):

A teleport: the source region asks the destination gatekeeper for the region; the gatekeeper asks the home UAS to verify the agent; the destination region waits for the viewer's connection, verifies it again with the home UAS, then receives the visitor's attachments. The viewer speaks to the regions only, never to grid services. The home UAS must be reachable from the destination, or the visit is refused.

What a foreign region gets: a non-persistent user record naming the visitor's home services (user, inventory, asset). From then on inventory access is "wrapped": the foreign region fetches assets from the home asset server and copies them into its own asset service; anything the visitor takes is posted back to the home server.

Hypergrid 2.0 (OpenSim 0.7.5, 2012; towards HG 2.0): the suitcase, one inventory folder that is the only one a foreign grid may reach, plus appearance items; per-grid switches for whether foreign agents are admitted (ForeignAgentsAllowed, allow/deny lists by source grid) and whether local users at a given level may travel (ForeignTripsAllowed_Level_N); and an export permission on assets, with grid owners able to forbid rezzing what came home from elsewhere. The export permission was contested enough that it shipped later and partially.

Friends across grids take a confirmation dance: the friendship is stored on the foreign grid, forwarded to the home friends service as a request, and confirmed by the traveller when they are next home (Hypergrid Friends).

Identity is First Last @grid.example:8002: a name plus the home grid's URL. A UUID per account, meaningful only on its grid.

The 4096 bug: viewers failed to render a destination more than 4096 regions away on the global map, so hyperlinked grids had to be placed near each other. Fixed in viewers and OpenSim around 2013 (hypergridbusiness). It is a symptom of the deeper choice: one global region grid, into which every other world has to be mapped.

What broke, in the words of its critics (Heilmann and Maxwell, 2016; Hypergrid Security):

  1. The visited grid holds the visitor's session id, and that id works against the home services. A malicious host "can request your inventory items on your behalf and store copies", even wipe the inventory. The suitcase narrows what can be reached; it does not change who holds the credential.
  2. Assets are protected by nothing but an unguessable UUID, served over plain HTTP; once an asset is rendered anywhere its id is on the wire and curl fetches it from the grid's asset service.
  3. Every asset a visitor rezzes is copied into the foreign asset store and stays after they leave, so malicious scripts are injected with a worn hat.
  4. Trust is by domain allow-lists, which a script's own HTTP calls walk around (an LSL script on grid A calling grid B's services from A's host).
  5. No local vetting of foreign accounts: anyone can make accounts on any home grid faster than a destination can ban them.
  6. Archives (OAR, IAR) strip all provenance, so content laundering is a file copy away.
  7. The reviewers' conclusion: "better encryption cannot improve hypergrid, because the hypergrid design is flawed. Hypergrid has a broken trust model."

What held up, and is worth keeping: the split between a home that vouches and a destination that decides; home services staying home; the four policy switches (admit visitors, from whom; let residents travel, where to); the "gateway region" idea (a grid may admit visitors only at chosen places); and the frank observation on its own security page that malicious hosts are the new threat open worlds add, with "protecting you from yourself" (limit what travels with you) as the answer.

2. Scaling one world

Intel's Distributed Scene Graph (Liu, Bowman, Adams, Hurliman, Lake, WSC 2010; DSG was folded into OpenSim core in 2011): measured on OpenSim, both CPU and bandwidth grow quadratically with users in one space, because every update reaches every client. Their diagnosis of the "simulator-centric" architecture: regions collapse past ~100 users; load balancing by moving a region's objects is prohibitive (seconds per hundred prims, "thousands of seconds to migrate 100K prims"); and physics, scripts and client managers want different partitions. Their answer: the Scene (authoritative state) separated from actors (physics, scripts, client managers), each subscribing to a part of the scene, with an eventually-consistent timestamped sync; DSG-M added microcell partitions. Thousands of avatars in one region were demonstrated.

Second Life region crossings (Region crossing): an avatar near a border has a child agent in the neighbouring region, which becomes the root agent as it crosses; objects near the edge have "ghost" representations on both sides. Crossings are the least reliable moment in the platform, twenty years on.

Photon's seamless MMO backend (2025 write-up): the world is split into nodes by load, not by a fixed grid; a gateway holds each player's connection for the whole session and does per-player interest management; neighbouring nodes keep an overlap zone where they predict entities they do not own. SpatialOS did the same with "areas of authority" per worker and an authority handover between them; its dynamic load balancer stayed experimental.

The common lesson: the client's connection and interest set belong to one stable gateway; authority over space moves behind it; and partitions are cheap only when the state they move is small and the scene lives outside the simulator process.

3. Federated protocols

ActivityPub (what Cartopolis already speaks, docs/notes/fediverse.md): an object lives on its author's server; servers push activities to inboxes with HTTP signatures; identity is name@server resolved by WebFinger; there is no shared state and no portability. Right for public posts about places, wrong for anything real-time or with shared state.

Matrix: a room's full state is replicated to every participating homeserver; events form a signed DAG; a deterministic state resolution algorithm makes every server converge. Powerful and expensive: every server in a room stores and resolves everything. Third Room (2022–23) put 3D worlds on it: a world is a room, its scene a glTF in the room, avatars networked over WebRTC data channels set up through Matrix (MSC3401), identity and friends carried between worlds by the Matrix account. Rooms as worlds is a usable idea; replicating a live world's state Matrix-style is not.

MIMI (IETF, More Instant Messaging Interoperability, architecture, protocol): one hub provider per room orders and fans out; follower providers forward their users' messages to the hub and deliver locally; MLS is the end-to-end layer and servers are external senders, never members; key material is fetched across providers (POST /keyMaterial/{user}); provider-to-provider authentication is mutual TLS with From: mimi@domain; consent is explicit. This is the model docs/notes/web-chat.md already chose for chats, and cartopolis_core::address already encodes it (a person is name@server, a conversation id starts with its hub's name).

AT Protocol (Bluesky, overview): identity is a DID whose document names the current host and keys; data lives in a signed repository the user can move between hosts; relays and app views aggregate. The one thing it does that nothing else does is account portability. Its critics (Rescorla) note the DNS handle is the weak link, access control was unspecified, and the whole is heavy for what it buys.

Overte / Vircadia (High Fidelity's descendants): a domain server hosts one world with assignment clients (avatar mixer, audio mixer, entity server); a central metaverse server holds accounts, a directory of places and connections, and users travel between domains with that identity. A grid with a central directory, in other words. Resonite likewise: identity, inventory and assets are central cloud services, sessions are hosted by users or headless servers.

Open Metaverse Interoperability Group and the Metaverse Standards Forum work on avatar and asset formats (glTF extensions); nothing there defines how a person moves between servers.

4. What Cartopolis already has, and what it does not

Facts from the code on 2026-11-10 (file paths in the design where they matter):