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):
- Gatekeeper, on the destination grid: answers which regions may be entered, admits an agent, and verifies it with the source grid.
- User Agent Service (UAS), on the home grid:
VerifyAgent/VerifyClientfor the gatekeeper, the travelling agent record,GetHomeRegion, logout, and status notifications to friends. - HG inventory, asset, friends and instant-message services, on the home grid, called by the foreign region on the visitor's behalf.
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):
- 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.
- 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
curlfetches it from the grid's asset service. - 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.
- 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).
- No local vetting of foreign accounts: anyone can make accounts on any home grid faster than a destination can ban them.
- Archives (OAR, IAR) strip all provenance, so content laundering is a file copy away.
- 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):
- One server, one world, no partitions.
SimWorldholds every prim in aVecand every avatar in a map; one broadcast channel sends every avatar to every client every tick; the area-of-interest filter was removed with regions (docs/notes/retired/regions.md: "a real AoI filter has to be computed per connection, which means the snapshot stops being a broadcast"). Ceilings: 1,000 prims and 200 scripts per world, 64 physical prims, 4,096 sessions. Measured 2026-09-15: the full prim list in every snapshot cost 6 % of the tick and 3.2 MB/s per client, which is why prims now go out once at the handshake (docs/notes/simulator-tick-budget.md). - Avatar positions are not comparable. An avatar's sim position is
metres in its own client's map frame; only
ClientIntent.geo(the client's own report) is an absolute place. Here chat and voice compare the per-client frames (crates/simulator/src/chat.rs,within_radius). Prims, by contrast, carry an absoluteGeoAnchorsince ADR-029. - Physics already cuts the world into 0.01° zones (about 1.1 × 0.67 km
at Groningen), each a Rapier world, existing only while a physical prim is
in it (
docs/notes/physical-prims.md). - Identity is per server and already server-qualified where it had to
be.
accounts.usernameis unique per server; the wire carries bare usernames for blocks, contacts and reports, but every MLS credential and every private-chat member isname@server, and every conversation id isserver/…(protocol 37,crates/core/src/address.rs). The simulator refuses key-package claims for other servers with a 501, in words.SimConfig::server_nameis the host ofpublic_base_urland must not change. - Tokens are opaque, local and unsigned: 256 random bits, hashed in
sessionsandaccess_tokens, resolved bySessions::resolve_access, re-checked by every open connection every 5 s. There is no device key in the handshake; the only device identity is the E2EE device UUID the client minted itself. - Server-to-server already exists for the fediverse: draft-cavage HTTP
signatures with per-actor RSA keys in
fedi_keys, an inbox that verifies against cached actor keys,fetch::Clientrefusing private, loopback and link-local addresses and anything but https on 443, a daily shared block list plus operator blocks, and afedi_serverstable that remembers what software each server runs. - Roles are a closed list of permissions with a built-in Player role every account holds; a non-elevated access token is Player minus the elevated permissions. A Visitor role is one row away.
- Atlas planned the token split that federation needs: "atlas
authenticates and issues a short-lived signed token, and the simulator
verifies it with a public key" (
docs/notes/atlas.md), not built. - Links already name a server and ignore it.
https://cartopolis.org/go?place=…,?community=CODEand?contact=name~codeall carry a host, andplace_link.rsdeliberately reads none of them. - Map data is not the simulator's. Tiles, terrain, cells, Overpass and
Nominatim come from
*.cartopolis.orghosts fixed at build time, withCARTO_*overrides; the handshake'sosm_tile_url_templateis the one source a server can redirect. The simulator "holds no map data and is not going to". - Models are content-addressed (
data/assets/<blake2s>.glb), servedimmutableat/api/assets/{hash}.glbbehind a session token of that server;asset_claimsrecords each uploader's licence (own,cc0,cc-by,other), andothermay never be shared. - Calls: the simulator you are connected to is always the SFU; keys come from the chat's MLS group; signalling rides the wire.
- Earlier directions, retired: ADR-021's flat clusters with an S2
index and sim-to-sim frame handoff ("superseded direction"); ADR-012's
radius filter; ADR-028 rejected a "multi-sim peer mesh" as premature and
left
ChatHubas the seam ("a trait can wrap it when multi-sim lands").