Architecture
The Wired is the open protocol underlying UNAVI: the scene formats,
scripting interfaces, and networking conventions that connect spaces across
peers. Specifically, the
HSD (Hyper-Space Document) scene model
describes what exists in a space, and the wired:* WIT (WebAssembly Interface
Types) packages define the API scripts call. Any client that implements both can
participate in The Wired.
The diagram and sections below describe UNAVI's own implementation, built on Bevy for rendering, iroh for peer-to-peer networking, and wasmtime for scripting. Another client could choose a different engine or runtime.
Peers
Every running instance of UNAVI is a peer, and spaces do not depend on a central server.
unavi-app is the desktop and web client. It integrates the scene, scripting,
space, portal, policy, and identity crates into a single Bevy application.
unavi-node is a headless, always-on peer. It hosts static assets over
iroh-blobs, serves its did:web document
over HTTP, and optionally runs a discovery registry. Nodes only accept incoming
connections from peers rather than dialing out. Space documents themselves live
with the peers occupying that space and sync directly between them.
Networking
Each peer opens one iroh endpoint that identifies the device and connects directly to other peers, traversing NATs (Network Address Translation) when needed. Three protocols share that endpoint:
| Protocol | Carries |
|---|---|
| iroh-docs | Signed key-value documents synchronized between peers |
| iroh-blobs | Content-addressed assets (meshes, textures, compiled scripts) |
| iroh-gossip | Live space presence |
Each HSD document maps to an iroh-docs namespace whose entries reference blobs by hash, so a mesh or texture reused across many prims is stored once.
Identity
Every user and node has a DID (decentralized
identifier). Clients generate a did:key by default, while nodes use a
did:web tied to their domain. Connections cryptographically prove which DID
owns an endpoint, and every peer keys its
trust policy by DID.
Scripts
Scripts are WebAssembly components executed by unavi-script on wasmtime.
Because the host exposes the wired:* interfaces through WIT, scripts can be
written in any language that compiles to the WebAssembly Component Model. See
the Scripting API for the full package list.
The registry
A registry catalogs public spaces and tracks active occupancy. Only the DID
that created a listing can update or remove it. Registries run inside
unavi-node by default unless disabled with --no-registry, and enforce
per-identity and global caps as detailed in
Running a node.