UNAVI Docs unavi.xyz
Build · How it works

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.

How UNAVI's pieces fit The Wired is the HSD scene format and the wired WIT scripting API, both implemented by unavi-app. unavi-app and unavi-node are both peers and connect to each other over iroh. Every peer's iroh endpoint carries iroh-docs documents, iroh-blobs content and iroh-gossip presence. The Wired HSD scenes .hsda → .hsdz wired:* WIT the scripting API Peers unavi-app desktop and web app bevy-hsd · scenes unavi-script · wasmtime unavi-space · presence unavi-portal · portals unavi-policy · trust unavi-identity · DIDs iroh unavi-node always-on peer unavi-registry did:web over HTTP hosts documents Network iroh endpoint one per peer · bevy-iroh, unavi-store iroh-docs documents iroh-blobs content by hash iroh-gossip who is in a space

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:

ProtocolCarries
iroh-docsSigned key-value documents synchronized between peers
iroh-blobsContent-addressed assets (meshes, textures, compiled scripts)
iroh-gossipLive 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.