UNAVI Docs unavi.xyz
Build · How it works

The HSD scene model

HSD (Hyper-Space Document) is the scene format of The Wired. An HSD document describes objects along with their geometry, materials, physics, and scripts.

Each document lives in an iroh-docs namespace, which provides cryptographic signing and peer-to-peer synchronization. HSD defines the scene semantics on top of those key-value entries.

Prims and properties

A document is a tree of prims. A prim itself is just an ID; everything about it, including its parent in the tree, is stored as a property attached to that ID.

Following USD (Universal Scene Description), properties fall into two categories:

All built-in properties are defined in wired:scene.

Prim IDs

A prim keeps the same ID across edits, so moving, renaming, or swapping its mesh never breaks references pointing to it.

For authored scenes, the compiler derives each prim's ID deterministically from its source path and position in the tree, ensuring identical builds produce identical IDs on every peer. Prims created dynamically by scripts receive fresh runtime IDs.

Layers

Every property resolves across a stack of composition layers, where the strongest layer with a value wins:

LayerIn wired:sceneContentsLifetime
Session (one per peer)sharedShared state written by that peerWhile the peer is present
RuntimelocalLocal writes from this peerUntil the document unloads
OverrideEdits applied by a referencing documentWhile the referencing document is loaded
DocumentDurable entries stored in iroh-docsPersistent

Each peer in a space has its own session layer on every loaded document. The document author's session layer takes highest priority, followed by other peers ordered by your local trust level for each peer. Your peer also enforces what each layer may affect: the author's layer can set any property, while other peers are restricted to script state and portal pairing, as explained in Trust and permissions.

When a peer leaves a space, their session layers are removed. If you trust that peer at Guest or higher, your peer first copies their active shared writes into your own session layer and keeps any documents they brought loaded, allowing their changes to persist for everyone connected to you. Documents from untrusted peers unload when they depart.

By default, script writes go to the local runtime layer and are visible only to the local peer. Calling commit persists a value into the durable document layer. Commits only apply on the peer that authored the script's document; other peers running the same script ignore the commit so the durable write happens once.

References

A prim can embed another document via a reference attribute pointing to its document ID, allowing spaces to reuse shared assets such as furniture or tools.

The referencing document can customize prims inside the referenced document without modifying the original asset, such as recoloring a chair. Those edits are stored in the referenced document's override layer.

Concurrent edits

Multiple peers can edit a document at the same time. iroh-docs resolves each key by last-writer-wins timestamp order, so any peers that have received the same entries converge on the same scene tree.

Because entries can arrive out of order over the network, a prim whose parent has not yet arrived waits until it does, and parent cycles are broken deterministically in the same place on every peer.