Source
arkin0x/cyberspace/CYBERSPACE_V2.md at commit 9210d6dff166
Rendered
byte for byte from that commit; nothing here is paraphrased. Raw markdown · manifest
sha256
5d977319a249f47d3f66ce2e8b18cbc408b305accf8ad69ba4ca7c048fcdb8a3
Status
Normative. RFC-style MUST/SHOULD/MAY; explanatory material is labeled non-normative.

Cyberspace v2: Protocol Specification

Date: February 10, 2026 Last updated: October 8, 2026 Status: Design complete (spec); reference implementation in progress


What This Document Is

This is the canonical specification for the Cyberspace Protocol, version 2.

Cyberspace is a 256-bit coordinate system navigated by cryptographic keypairs using structured mathematical computation. It is not a game, not a platform, and not a virtual reality experience. It is a protocol: a specification for how to encode, prove, and verify spatial relationships using irreversible computational work.

The goal is simple: impose locality, the fundamental property of physical space, on a digital system. In physical space, crossing distance costs energy, and no one is exempt from that cost. Cyberspace does the same thing, but with computation instead of physics. Movement requires mathematical work. The work scales with distance. There are no shortcuts, no teleportation, no administrator who can move you or delete you. The math is the same for everyone.

This document specifies:

  • A 256-bit coordinate system with three spatial axes and a plane bit
  • How cryptographic identity maps directly into the coordinate fabric (your public key is your location)
  • Three movement primitives: spawn (identity placement), hop (Cantor pairing tree proof), and sidestep (Merkle hash tree proof for storage-infeasible boundaries)
  • A temporal work axis that prevents proof caching and replay
  • Location-based encryption and discovery derived from stable spatial regions
  • Integration with Nostr as the transmission layer
  • A deterministic mapping from GPS coordinates into the coordinate system

Normative sections use RFC-style language (MUST/SHOULD/MAY). Explanatory material is labeled non-normative.

Reference implementation: https://github.com/arkin0x/cyberspace-cli

For extended design rationale and philosophical discussion, see RATIONALE.md (non-normative).


Table of Contents


1. Overview: Why This Exists

1.1 The problem

Every digital system that calls itself a “space” (virtual worlds, social platforms, VR environments, cloud services) shares a fundamental limitation: they are owned. Every one of them has an administrator who can move you, delete you, change the rules, or shut the whole thing down. Your “presence” in any of these systems exists only because someone permits it.

This isn’t a flaw in specific products. It’s a consequence of how they’re built. They are permissioned systems. And permissioned systems are not space. They are services.

Physical space works differently. It imposes costs that nobody can cheat. Not governments, not corporations, not anyone. The cost is thermodynamic: paid in energy, irreversibly, to the universe itself. This is the deepest kind of fairness: not fairness by agreement (which can be broken), but fairness by physics (which cannot).

1.2 The approach

Cyberspace imposes the same constraint, irreversible computational work, on a 256-bit coordinate system. Movement requires computing mathematical structures called Cantor pairing trees, whose cost scales with the distance crossed. The work is not arbitrary hash grinding; it is the computation of the actual mathematical fabric between coordinates. The proof of your movement is the mathematics of the region you crossed.

Keypairs traverse Cyberspace by publishing signed Nostr events that commit to their movement history. Each event includes a proof derived from the Cantor tree computation, creating an auditable chain of verified movement.

1.3 Key properties

  • Public key = spawn coordinate: your cryptographic identity maps directly into the coordinate fabric. Where you start is determined by who you are.
  • Three movement primitives: spawn (identity placement), hop (Cantor pairing tree proof), and sidestep (Merkle hash tree proof for storage-infeasible boundaries).
  • Hash chain continuity: each movement event references the previous one by its cryptographic hash, forming a linear chain of signed proofs. This chain is the keypair’s verifiable movement history and ensures every hop costs fresh work that cannot be cached or replayed.
  • Axis symmetry: equal distances cost equal work regardless of direction.
  • Location-based encryption: keys derive from stable spatial region preimages, enabling content that can only be decrypted by those who do the work to be “there.”
  • Compact and deterministic: proofs fit in Nostr events and verify efficiently.

This v2 design replaces earlier drift/quaternion/velocity approaches (deprecated).


2. The Coordinate System

2.1 A 256-bit universe

Cyberspace exists in a 256-bit integer space. This number was not chosen arbitrarily. 256-bit numbers are the standard unit of work in cryptographic systems like SHA-256, Nostr, and Bitcoin. Working in 256 bits means the coordinate system is natively compatible with the tools that power the rest of the protocol.

Those 256 bits are divided into:

  • Three spatial axes: X, Y, and Z, each 85 bits wide (an unsigned integer from 0 to 2^85 - 1)
  • One plane bit: the least significant bit, which selects between dataspace (0) and ideaspace (1)

That accounts for 85 × 3 + 1 = 256 bits exactly.

Core terms:

  • Coordinate (coord256): A 256-bit integer encoding X/Y/Z plus the plane bit.
  • Axes (u85): X, Y, Z are 85-bit unsigned integers.
  • Plane: 1 bit. 0 = dataspace (physical mapping), 1 = ideaspace (non-physical).
  • Gibson (G): The fundamental unit of distance, equal to one axis step in u85 space.

2.2 Bit layout (normative)

The three axes are interleaved into the 256-bit integer, not packed sequentially. This means the bits alternate: an X bit, then a Y bit, then a Z bit, repeating 85 times.

Specifically:

  • Bit 0 (LSB): plane bit P
  • Bits 3, 6, 9, ... (every 3rd bit starting at 3): X bits (85 bits)
  • Bits 2, 5, 8, ... (every 3rd bit starting at 2): Y bits (85 bits)
  • Bits 1, 4, 7, ... (every 3rd bit starting at 1): Z bits (85 bits)

The result looks like: XYZXYZXYZ...P

The interleaving has an important consequence: coordinates that are spatially close share similar bit prefixes. This is what makes the Cantor pairing tree work efficiently, because nearby coordinates fall into the same aligned subtrees.

2.3 Reference pseudocode

AXIS_BITS = 85

def xyz_to_coord(x: int, y: int, z: int, plane: int = 0) -> int:
    coord = plane & 1
    for i in range(AXIS_BITS):
        coord |= ((z >> i) & 1) << (1 + i * 3)
        coord |= ((y >> i) & 1) << (2 + i * 3)
        coord |= ((x >> i) & 1) << (3 + i * 3)
    return coord

def coord_to_xyz(coord: int) -> tuple[int,int,int,int]:
    plane = coord & 1
    x = y = z = 0
    for i in range(AXIS_BITS):
        z |= ((coord >> (1 + i * 3)) & 1) << i
        y |= ((coord >> (2 + i * 3)) & 1) << i
        x |= ((coord >> (3 + i * 3)) & 1) << i
    return (x, y, z, plane)

2.4 Two planes: dataspace and ideaspace

The plane bit creates two overlapping coordinate spaces:

  • Dataspace (plane = 0): Maps to physical reality via GPS coordinates (see §9). The same X/Y/Z values in dataspace correspond to specific physical locations on and around Earth.
  • Ideaspace (plane = 1): Has no physical mapping. The same X/Y/Z values are purely abstract positions. Ideaspace is where things exist that have no physical counterpart.

Both planes share the same mathematical properties. Movement costs, encryption, and discovery all work identically. They differ only in whether the coordinates have a physical-world interpretation.


3. Identity Is Location

3.1 Your key is your coordinate

One of the most distinctive properties of Cyberspace is that your cryptographic identity determines your spawn location. Your Nostr public key, the 256-bit number that is your identity, is also your coordinate. When you first enter Cyberspace, you appear at the point defined by your key.

You don’t choose where to spawn. Your identity chooses for you.

This means identity and location are the same thing. Not metaphorically, but mathematically. Your key encodes a specific X, Y, Z position. If someone knows your public key, they know where you spawn. If you want a different spawn point, you need a different identity.

Implication: In every other digital system, identity and location are separate concerns managed by separate authorities. In Cyberspace, the mapping from identity to space is deterministic, public, and permanent. No authority assigns locations. No registry tracks who is where. The math does it.

3.2 The spawn event

A spawn event is a signed Nostr event that declares “I exist at this coordinate.” It is the first event in a keypair’s movement chain. The coordinate in a spawn event MUST equal the event’s public key (see §8.3 for the full event format).

After spawning, a keypair can begin moving through Cyberspace by publishing hop or sidestep events that extend the chain.

Entering a game does not respawn. An identity that wants to play a game opens a virtual bracket on the chain it already has (§8.11): its position in cyberspace is held where it entered, the game’s actions are recorded inside the bracket, and leaving the bracket puts the identity back where it was.

A keypair may also respawn at any time by simply publishing a new spawn event. The newest spawn event always starts the active chain (§8.7.3), so a respawn ends the old chain: the keypair returns to its original spawn coordinate and starts fresh. Prior movement history remains on relays but is no longer part of the active chain.

The newest spawn wins, valid or not (normative): The newest spawn starts the active chain even when it is invalid, for example when its C does not equal its pubkey (§8.3), or when it carries a second A tag beside ["A", "spawn"] (§8.7.3, rule 1). A chain whose spawn is invalid is invalid from the spawn, and the identity stands at its spawn coordinate, the coordinate of its pubkey, until it publishes another spawn (§8.7.3). A reader MUST NOT fall back to an older spawn.

An invalid chain is frozen (normative): When an event on the active chain is invalid, the chain is invalid from that event, and the identity stands at its last valid position: the position the chain gave it at the last valid event before the first invalid one (§8.7.3). The chain is then frozen. Nothing published later on that chain can move the identity, however valid it is on its own. Only a respawn starts a chain that can be valid again. A fork anywhere on the walk of §8.7.3 overrides freezing: a chain that has forked is dead (below), even when an invalid event comes before the fork. For example, on a chain S, a, x, b, where x is invalid and two distinct events c and d both name b as their e previous, the identity stands at its spawn coordinate, not frozen at a.

A forked chain is dead (normative): When, during the walk of §8.7.3 rule 3, more than one distinct event (distinct by id) whose e genesis names the newest spawn names the current event as its e previous, the chain has forked, and it is dead: it is invalid from the spawn, and the identity stands at its spawn coordinate, the coordinate of its pubkey, exactly as when its newest spawn is invalid (§8.7.3, rule 4). This holds however valid the events before the fork are. Only a respawn starts a chain that can be valid again.

A chain therefore ends in one of three ways. A respawn ends it, and the identity is back at its spawn coordinate on a new chain. An invalid event freezes it, and the identity stands at its last valid position. An invalid newest spawn or a fork kills it, and the identity stands at its spawn coordinate. In the second and third cases the identity can do nothing on that chain until it respawns.

Derezz is the common name for a respawn: an identity whose chain has ended because it published a new spawn event, and which is back at its spawn coordinate, is said to have derezzed. An identity whose chain has gone invalid has not derezzed. It stands frozen at its last valid position, or at its spawn coordinate when its chain is dead, and it derezzes when it respawns. The word is a description of a state, not a mechanism. No event, action or tag in this specification performs a derezz, nothing any other identity publishes can cause one or can freeze or kill a chain (an event the identity did not sign is discarded before its chain is resolved, §8.7.3), and §1.1’s promise that there is no administrator who can move you or delete you means there never can be at this layer. A game may define anything it likes about liveness inside its own box (decks/README.md, Game mechanics), and the protocol will not consult it.


4. Movement: Cantor Pairing Trees

This is the heart of the protocol. Everything else (encryption, discovery, territory, transit) builds on top of the movement system. So it’s worth understanding not just how it works, but why it works this way.

4.1 Why structured work, not hash grinding

Standard proof-of-work (like Bitcoin mining) works by grinding random numbers until you find a hash that meets a difficulty target. The work is real. You burn energy. But the work is arbitrary. You’re searching a hash space, not traversing a space. Finding nonce #4,821,337 doesn’t tell you anything about where you are or where you went.

Cyberspace needs work that is structural: work where the computation itself encodes spatial information. The proof of movement should not be “I burned energy” but “I computed the mathematical fabric between these two coordinates.”

Cantor pairing trees achieve this. They create actual mathematical structure: each root uniquely represents a specific region of coordinate space. Computing it means building a tree from leaves to root. The number you produce is mathematically meaningful, not arbitrary. This is the difference between “digging a hole” and “following a path.” Both cost energy, but only one has spatial semantics.

4.2 The Cantor pairing function

The Cantor pairing function takes two natural numbers and produces exactly one:

π(a, b) = (a + b) × (a + b + 1) / 2 + b

This function is a bijection: every input maps to exactly one output, and every output maps back to exactly one input. No two different pairs of numbers ever produce the same result, and every natural number is the result of some pair. Compare this to a hash function like SHA-256, where many different inputs can produce the same output and you cannot reverse it. The Cantor pairing function loses nothing. It is a perfectly reversible, lossless mathematical encoding. Crucially, the function can be reversed. Given any Cantor number, you can unpair it to recover the two numbers that produced it. Applied recursively, this means a single Cantor root encodes an entire tree and that tree can be fully reconstructed from the root alone.

When applied recursively (pairing leaves into parents, parents into grandparents, all the way up) it builds a binary tree whose root is a single number that uniquely encodes every leaf in the tree.

4.3 Per-axis trees

An earlier version of Cyberspace used the full interleaved 256-bit coordinate in a single Cantor tree. This was elegant in theory but failed in practice:

  • Axis asymmetry: Due to bit interleaving, X movements cost ~4× more than Z movements for the same distance. The protocol would privilege certain directions.
  • Impractical scaling: Moving 64 Gibsons took ~115 seconds. Sector traversal would take months.
  • Memory explosion: Large movements produced multi-gigabyte Cantor numbers.

The v2 solution: each axis (X, Y, Z) gets its own independent 85-bit Cantor tree. Movement proofs are computed separately per axis, then combined. This gives:

  • Axis symmetry: Equal distances cost equal work regardless of direction.
  • Practical performance: 1,024 Gibsons in ~1ms instead of ~33 seconds.
  • Bounded computation: 85-bit trees are manageable.
  • Parallelizable: Three independent computations can run in parallel.

4.4 Lowest common ancestor (LCA) height

When you move from one position to another along a single axis, the cost of that movement depends on which binary boundary you cross. The Lowest Common Ancestor (LCA) height captures this: it is the level in a binary tree where the paths from the two positions first diverge.

For a 1D axis movement between v1 and v2:

def find_lca_height(v1: int, v2: int) -> int:
    if v1 == v2:
        return 0
    return (v1 ^ v2).bit_length()

The LCA height determines how much work is required: the Cantor tree you need to compute has 2^h leaves, where h is the LCA height.

An important subtlety: the LCA height is not simply a measure of distance in Gibsons. It depends on which boundary you cross, not just how far you move. A move of 1,024 Gibsons within a single aligned region might have the same LCA height as a move of 1 Gibson that happens to cross a large power-of-two boundary.

Consider two single-Gibson moves that have very different costs:

  • Moving from position 4 to position 5: 4 ^ 5 = 1, bit_length = 1, so h = 1. This is cheap. You are staying within a small aligned block.
  • Moving from position 7 to position 8: 7 ^ 8 = 15, bit_length = 4, so h = 4. This costs 16 times as many Cantor pairs, even though you only moved 1 Gibson. The reason is that position 8 sits on the boundary of a height-4 aligned subtree, and crossing that boundary requires computing the entire subtree.

At the extreme: moving from position 2^34 - 1 to position 2^34 is a single-Gibson step, but the LCA height is 35: the two positions differ in every one of their lowest 35 bits, so bit_length(v1 ^ v2) = 35. That one step requires computing a Cantor tree with over 34 billion leaves, because you are crossing the largest binary boundary in that region of the axis. (The step from 2^33 - 1 to 2^33 is the height-34 case, with over 17 billion leaves.)

This is not a quirk. It is the core mechanism by which Cyberspace imposes locality. Boundaries in the binary structure of the coordinate space act as natural walls, and crossing them costs real work regardless of how small the step is. This property is formalized as decomposition invariance in §4.8.

4.5 Aligned subtrees

Before defining aligned subtrees formally, it is worth understanding why they exist and what problem they solve.

When two coordinates are paired into a Cantor tree, the tree must cover a specific range of leaf values. If we allowed the tree to start at any arbitrary position, then two different movements through the same neighborhood could produce different trees with different roots. There would be no stable “regions.” Every pair of coordinates would generate its own unique tree, and no two people would agree on what a region looks like or what its identifier is.

Alignment solves this by snapping tree boundaries to power-of-two positions in the coordinate space. An aligned subtree of height h always starts at a position that is a multiple of 2^h and always covers exactly 2^h consecutive leaves. This means the boundaries are fixed and universal. Everyone agrees on where the blocks are, because the blocks are determined by the math, not by anyone’s specific movement. Two people standing in the same neighborhood will compute the same Cantor root without ever communicating, because they are both computing the root of the same aligned subtree.

This property is what makes location-based encryption work (§7). It is what makes spatial consensus happen automatically. Without alignment, there is no consensus about what a region is, and the entire discovery and encryption system falls apart.

Formal definition: An aligned subtree of height h is a binary subtree whose base is a multiple of 2^h. Think of it like a base address: the subtree “owns” a block of 2^h leaves, and the base tells you where that block starts.

For any value v and height h:

  • base = (v >> h) << h (the aligned base)
  • The subtree spans 2^h consecutive leaves: [base, base+1, ..., base + 2^h - 1]

For movement between v1 and v2, the covering aligned subtree is the smallest aligned subtree that contains both endpoints:

  • h = find_lca_height(v1, v2)
  • base = (v1 >> h) << h (equivalently (v2 >> h) << h)

Example: Moving from 0 to 5:

  • h = find_lca_height(0, 5) = 3 (because 0 ^ 5 = 5, bit_length = 3)
  • base = (0 >> 3) << 3 = 0
  • Aligned subtree covers leaves [0, 1, 2, 3, 4, 5, 6, 7] (8 leaves = 2^3)

Example: Moving from 4 to 7:

  • h = find_lca_height(4, 7) = 2 (because 4 ^ 7 = 3, bit_length = 2)
  • base = (4 >> 2) << 2 = 4
  • Aligned subtree covers leaves [4, 5, 6, 7] (4 leaves = 2^2)

The alignment property is what makes region-based discovery work: coordinates within the same subtree share the same root. Two people standing in the same region will compute the same Cantor number without ever communicating. The math determines the answer, and the math is the same for everyone.

4.6 Computing the axis root

Given a movement from v1 to v2 on one axis, the axis Cantor root is computed by building a Cantor pairing tree over the aligned subtree’s leaves, pairing adjacent nodes bottom-up until one value remains:

def cantor_pair(a: int, b: int) -> int:
    s = a + b
    return (s * (s + 1)) // 2 + b

def compute_subtree_cantor(base: int, height: int) -> int:
    if height < 0:
        raise ValueError("height must be >= 0")
    if height == 0:
        return base

    values = list(range(base, base + (1 << height)))
    for _ in range(height):
        values = [cantor_pair(values[i], values[i + 1]) for i in range(0, len(values), 2)]
    return values[0]

The axis root for movement (v1 → v2) is:

  • h = find_lca_height(v1, v2)
  • base = (v1 >> h) << h
  • axis_root(v1, v2) = compute_subtree_cantor(base, h)

(Implementations MAY compute this with any equivalent algorithm; the result MUST match this definition.)

A root names a region at a height. The same region always produces the same root, and at one height different regions always produce different roots, because every pairing step is a bijection. Across heights the root alone is not always enough: at height 0 there is nothing to pair, so a position’s root is the position itself, and a small region at a positive height can share its root with a single position. compute_subtree_cantor(2, 1) is π(2, 3) = 18, and so is compute_subtree_cantor(18, 0). For every height of 1 and above, roots are distinct across heights as well as within them, so the identifier of a region is the pair (root, height) in general, and the root alone identifies both the region and its height whenever the height is at least 1.

Why roots at heights 1 and above never collide (non-normative). Suppose two regions of different heights h1 < h2, both at least 1, had the same root. Every pairing step is a bijection, so peeling one level off both trees gives equal left-child roots and equal right-child roots, and peeling h1 levels gives that the 2^h1 consecutive positions of the lower region equal the roots of 2^h1 adjacent aligned regions of height d = h2 - h1, which is at least 1. Adjacent aligned regions at any height of 1 or more have roots that differ by at least 16 (compute_subtree_cantor(2, 1) - compute_subtree_cantor(0, 1) = 18 - 2 = 16, the smallest case), so two consecutive integers cannot both be such roots. The lower region therefore has a single position, which is height 0. The height-0 case never reaches a bag: a bag’s height is at least 1 (§7.6) and discovery scans heights from 1 (§7.4).

4.7 Combining into 3D (region_n)

Each axis computes its root independently:

  • cantor_x = axis_root(x1, x2)
  • cantor_y = axis_root(y1, y2)
  • cantor_z = axis_root(z1, z2)

Then they are combined using nested Cantor pairing:

  • region_n = π(π(cantor_x, cantor_y), cantor_z)

The resulting region_n is the stable spatial region integer, a single number that uniquely identifies the 3D region implied by the movement. This number is used for location-based encryption and discovery (§7).

Region uniqueness (non-normative): Each aligned subtree root corresponds to a unique region at its height, and for heights of 1 and above to a unique region across heights as well (§4.6). Many coordinate pairs inside the same aligned subtree share the same root; this is intentional. The Cantor root is a region identifier, not a unique coordinate-pair identifier.

Example (1D):

LCA(0, 3) => subtree [0..3] => root = 228
LCA(1, 2) => subtree [0..3] => root = 228
LCA(0, 2) => subtree [0..3] => root = 228

This means all these movements “see” the same region, which is exactly what enables location-based discovery.

Heights need not match across axes (non-normative). A movement’s three axis heights are computed independently (§4.4), and an axis along which the position did not change has height 0, so its root is the position itself. That is ordinary: a move along X alone has heights (h, 0, 0). A movement’s region_n is verified by recomputing it from the two coordinates, so it does not rely on a root identifying its height. A bag’s region is one aligned cube, one height for all three axes and at least 1 (§7.6), so its region_n, its key and its lookup_id (§7.2) are distinct from those of every other region at every height.

4.8 Why you can’t cheat distance (decomposition invariance)

A natural question: can you cheat the cost of a large movement by breaking it into many small steps? If moving from 0 to 1000 costs a lot of work, can you instead take 1000 one-Gibson steps and pay less?

No. This is provable.

Theorem (follows from the alignment properties of complete binary trees and the 2-adic valuation): For any two leaf positions v1 and v2 with v1 < v2:

find_lca_height(v1, v2) == max(find_lca_height(i, i+1) for i in range(v1, v2))

The LCA height of the direct pair is always equal to the maximum LCA height among all unit-step pairs in the sequence.

What this means in plain terms: If you decompose a movement (v1 → v2) into sequential adjacent steps, at least one step in the sequence will require the same covering subtree height as the direct movement. You can’t avoid the expensive boundary crossing, because any path from v1 to v2 must cross it.

Proof sketch: The LCA height h of (v1, v2) is determined by the highest bit position where v1 and v2 differ. Any sequential walk from v1 to v2 must cross the largest power-of-2 boundary between them. The step at which this crossing occurs produces an XOR with a bit set at the same highest position, yielding identical height h.

In simple terms: the computational cost of movement is the same whether you take small steps or large steps. You can’t avoid, decompose, or sidestep the computational burden of power-of-two boundaries along each axis. This is the digital equivalent of the triangle inequality: you can’t cheat geometry.

4.9 Five properties unique to this design (non-normative)

The Cantor pairing tree produces five properties that, to our knowledge, no other digital spatial system possesses:

1. Locality without trusted parties. The cost of computation scales with the height of the Cantor tree, which scales with distance. This is locality — the fundamental property of space — and it emerges from the math without any authority enforcing it. Nobody decides how much it costs to move. The mathematics decides.

2. Hierarchical spatial encryption. Because each region has a unique Cantor root, that root can serve as a cryptographic key. Content encrypted with a region’s root can only be decrypted by someone who computes that root (see §7). This is the digital equivalent of writing a message in chalk on a sidewalk: you can only read it by being there.

3. Work equivalence. In most digital systems, observing is free and doing costs. In Cyberspace, observation and action cost nearly the same. To discover what’s in a region, you must compute the region’s root, the same work a traveler would do to cross it. There is no free surveillance.

Where the equivalence is not exact, and it favors the observer (non-normative). Two differences, neither of which the earlier wording admitted. First, a traveler additionally pays the temporal axis, which §7.2 deliberately excludes from key derivation, so observing one region is strictly cheaper than crossing into it by that term. Second, and without bound at scale, a traveler’s work is sequential and an observer’s is not: each chain event commits to the previous one, so a thousand moves are a thousand moves in order, while a thousand regions to observe is an embarrassingly parallel job for a cluster. The equivalence is therefore a good description of one region and a poor one of a million. §7.2’s key derivation is where that gap would be closed if it is to be closed.

4. Deterministic regions. Any two people computing the Cantor root of the same aligned subtree will get the same answer. Regions don’t need to be assigned, registered, or coordinated. They exist as mathematical facts. Spatial consensus happens automatically, without communication.

5. Decomposition invariance. As proven in §4.8, sequential decomposition doesn’t reduce cost. There are no shortcuts through space.

Checking a root is cheap; producing one is not (non-normative). These are different operations and only the second is protected. The low bits of a Cantor pairing depend only on the low bits of its operands, because carries propagate upward, and the one right shift in (s(s+1))/2 pulls down exactly one bit per level. So carrying a window of k + h low bits through the same 2^h pairings reproduces the true root’s low k bits exactly, in a few machine words instead of the root’s full width. Measured against real roots, a 64-bit answer is exact at every height tested, and the saving is 116 times at h18 and grows with height.

This does not weaken anything above. The operation count is unchanged, so §4.8 is untouched: the window performs the same 2^h pairings in the same order and merely carries fewer bits through each. And the window never yields the root. At h34 it returns 64 bits of a number 1.46 trillion bits wide, so it cannot produce region_bytes, cannot derive a key under §7.2, and cannot forge a proof.

It detects error, not fraud, and the difference matters. The window is cheap for everyone symmetrically, so an adversary runs it too, learns the same low bits, and appends whatever they like above them. A prefix that matches is therefore evidence of an honest mistake not having happened, and no evidence at all against somebody trying. Use it to confirm that a transfer arrived intact, that a disclosed root is for the region you asked for rather than a neighbouring one, or that a long computation on your own hardware did not corrupt. Do not use it as a proof of anything.

The same holds for one residue of a root, its remainder modulo an odd number (§5.9): anyone can compute it cheaply, so on its own it proves nothing. Residue openings, the hop proof of §5.9 to §5.13, turn many residues into evidence of work by making the prover seal a list of them a quarter as wide as the root before it learns which ones it will be asked to show (§5.10).

The load-bearing consequence is the negative one: a root prefix is not evidence of possession. Anyone can compute one in seconds without holding the region, so no protocol, market or game may treat a prefix as attestation. Possession is demonstrated by using the root, which is to say by deriving a key that actually decrypts, and a wrong root simply fails to open anything.

These five properties together create something unprecedented: digital space with the structural integrity of physical space, enforced by mathematics rather than by any authority.


5. The Temporal Axis: Every Hop Costs Fresh Work

5.1 The problem: cacheable spatial roots

The per-axis Cantor roots described in §4 are region identifiers: the same region always produces the same root. This is desirable for discovery and encryption (you want the “address” of a region to be stable). But it creates a movement loophole: once a mover has computed the Cantor root for a region, they could reuse that cached result to generate arbitrarily many hop events through the same region at near-zero marginal cost.

They would only be able to return to places they had already been, but instant teleportation over previously-trod terrain breaks the proof-of-work continuity of Cyberspace as a thermodynamic system.

The solution: extend movement proofs into a fourth dimension, a temporal work axis derived from the Nostr movement chain. Each hop includes an additional Cantor tree computation whose inputs are derived from chain context. Because each Nostr event id commits to the previous event (including its proof), the temporal seed for hop N is not known until hop N-1 is complete. The work cannot be precomputed or amortized.

What this does NOT change: Stable spatial region identifiers (used for location-based encryption and discovery in §7) remain a pure function of coordinates, independent of time or identity. The temporal axis exists only to make advancing the movement chain cost work.

What this is NOT: This is not a continuous “heartbeat” cost. An avatar’s last hop event remains its state indefinitely. The temporal axis work is paid only when moving.

5.2 Terrain-derived temporal height K (normative)

The temporal axis has a height K that varies by destination: a deterministic “terrain” function that makes some regions of Cyberspace intrinsically easier or harder to traverse. Think of it as hills and valleys in the computational landscape.

Constants:

  • TERRAIN_DOMAIN_V2 = b"CYBERSPACE_TERRAIN_K_V2" (ASCII bytes)
  • TERRAIN_CELL_BITS = [3, 7, 9, 11] (exactly four integers)

If any part of this terrain function changes (constants, hashing preimage format, byte selection, etc.), the domain string MUST be bumped to a new value to avoid ambiguity.

Algorithm: Given the hop destination coordinate (x2, y2, z2, plane):

  1. For each bits in TERRAIN_CELL_BITS (in order):

    1. Align the destination to the cell of width 2^bits along each axis:
      • bx = (x2 >> bits) << bits
      • by = (y2 >> bits) << bits
      • bz = (z2 >> bits) << bits
    2. Compute cell_coord = xyz_to_coord(bx, by, bz, plane).
    3. Encode cell_coord as exactly 32 big-endian bytes: cell_coord_bytes.
    4. Compute digest = sha256(TERRAIN_DOMAIN_V2 || byte(bits) || cell_coord_bytes).
      • byte(bits) is a single unsigned byte with value bits.
    5. Record nibble_i = digest[0] & 0x0F (the low 4 bits of the first byte of the digest).
  2. Concatenate the four nibbles into a 16-bit word:

    • word16 = (nibble_0 << 12) | (nibble_1 << 8) | (nibble_2 << 4) | nibble_3
  3. Define K as the popcount of word16 (the number of 1 bits in its 16-bit binary representation).

    • Therefore K MUST be an integer in [0, 16].

Why this works (non-normative): Because K is the popcount of 16 pseudorandom bits, it follows approximately a binomial distribution with mean 8. The worst-case temporal computation is 2^16 = 65,536 Cantor pairs (~100 ms on modern hardware). The aligned cells at different scales introduce spatial correlation, so nearby coordinates tend to share the same K value, creating “hills” in the temporal landscape.

5.3 Temporal axis seed and root (normative)

For hop events, let previous_event_id be the 32-byte NIP-01 event id referenced by the e tag with marker previous (see §8.4).

  1. Parse previous_event_id from lowercase hex into 32 bytes.
  2. Interpret it as a big-endian integer and reduce into the u85 axis:
    • prev_id_int = int.from_bytes(previous_event_id_bytes, "big")
    • t = prev_id_int % (1 << 85)
  3. Compute an aligned temporal subtree and its Cantor root at the terrain-derived height K:
    • t_base = (t >> K) << K
    • cantor_t = compute_subtree_cantor(t_base, K)

Key insight (non-normative): The temporal axis is derived from chain context and destination coordinates, not wall-clock time. There is no continuous “alive” cost; you pay this work only when you publish a hop.

5.4 The 4D hop preimage

The hop preimage combines spatial and temporal work:

  • hop_n = π(region_n, cantor_t)

This is the single number that encodes both where you moved (spatial) and when in the chain you moved (temporal).

5.5 Integer→bytes encoding (normative)

Many operations in this protocol hash large integers. This spec defines the canonical encoding:

def int_to_bytes_be_min(n: int) -> bytes:
    if n < 0:
        raise ValueError("expected non-negative")
    if n == 0:
        return b"\x00"
    # minimal big-endian bytes
    return n.to_bytes((n.bit_length() + 7) // 8, "big")

5.6 Movement proof hash (normative)

The movement proof hash is derived from the 4D hop preimage hop_n. This intentionally differs from the stable spatial region identifiers used for location-based encryption and discovery (§7).

  • hop_bytes = int_to_bytes_be_min(hop_n)
  • movement_proof_key = sha256(hop_bytes) (32 bytes)
  • proof_hash = sha256(movement_proof_key) (32 bytes)

When used in Nostr tags, proof_hash MUST be encoded as lowercase hex in the proof tag.

Version 1 of the hop proof. This proof_hash is version 1 of the hop proof. Under chain rules revision 2026-10-08-residue-openings (§8.12), a hop’s proof tag carries the seal of version 2, residue openings (§5.9, §5.10), instead. The definition of proof_hash stays, for three reasons: it is the proof carried by the version 1 hops listed in grandfathered-v1-hops.txt (§5.13), the worked example of §5.7 locks the derivation of K, cantor_t and hop_n with it, and the sidestep proof hash of §6.8 is built the same way.

5.7 Worked example (non-normative)

Movement: (0, 0, 0) → (4104, 0, 0)

Per-axis roots:

  • X: 0 → 4104 => height 13 => root = compute_subtree_cantor(0, 13)
  • Y: 0 → 0 => height 0 => root 0
  • Z: 0 → 0 => height 0 => root 0

3D combine (stable spatial region integer):

  • region_n = π(π(cantor_x, 0), 0)

Stable lookup id (used for location-based encryption/discovery, §7.2):

  • lookup_id = sha256(sha256(int_to_bytes_be_min(region_n)))
  • 8d2463eb22301d97a1f7e33b90e473ba2eec69079f418a72609c3e4d2981669b

Terrain-derived temporal height at destination (x2=4104, y2=0, z2=0, plane=0) using TERRAIN_CELL_BITS = [3, 7, 9, 11]:

For each cell size, align the destination coordinate and extract a nibble:

  • bits=3: cell = (4104, 0, 0) → nibble = 0b0000 (0 ones)
  • bits=7: cell = (4096, 0, 0) → nibble = 0b1111 (4 ones)
  • bits=9: cell = (4096, 0, 0) → nibble = 0b1111 (4 ones)
  • bits=11: cell = (4096, 0, 0) → nibble = 0b1101 (3 ones)

Combine into 16-bit word and compute popcount:

  • word16 = (0 << 12) | (15 << 8) | (15 << 4) | 13 = 0b0000111111111101
  • K = popcount(word16) = 0 + 4 + 4 + 3 = 11

Temporal axis example using previous_event_id = 64 hex zeros:

  • previous_event_id = "0000000000000000000000000000000000000000000000000000000000000000"
  • t = 0
  • t_base = 0
  • cantor_t = compute_subtree_cantor(0, 11)

4D hop preimage and movement proof hash:

  • hop_n = π(region_n, cantor_t)
  • proof_hash = sha256(sha256(int_to_bytes_be_min(hop_n)))
  • ed9d09ca697b2da29c9d042207ac8ef7aab40f6dde550e6467452aa0e2e8cac6

Different previous_event_id values produce different proof_hash values, even for identical spatial moves. This is the temporal axis at work.

The residue openings of this same movement, with the same previous_event_id, are the golden vector of §5.10.

5.8 Performance expectations (non-normative)

Reference implementations observe that cost grows with the per-axis LCA height (because the aligned subtree contains 2^h leaves). In addition, each hop includes the temporal axis traversal at terrain-derived height K, imposing non-cacheable work per hop even when spatial region_n is reused. Because K depends on the destination coordinate, some regions of Cyberspace are intrinsically easier or harder to traverse.

Approximate per-axis expectations from early benchmarks (illustrative only):

DistanceHeightCantor sizeTime (approx)
1 G11 B< 0.01 ms
16 G590 B< 0.01 ms
256 G92.5 KB~ 0.1 ms
1,024 G1112 KB~ 1 ms
4,096 G1357 KB~ 10 ms
65,536 G171.2 MB~ 1 sec

Implementations should cap per-hop distance for UX and may rely on multiple hops for long travel.

These figures are the cost of producing a hop. Under version 2 of the hop proof, verifying a hop no longer repeats them; §5.12 gives the measured cost of both.

5.9 Residue openings (normative)

Under chain rules revision 2026-10-08-residue-openings (§8.12), a hop proves its work with residue openings, version 2 of the hop proof. The Cantor work is exactly what §4 and §5.1 to §5.4 define: the same three axis trees, the same temporal tree at the same terrain height K, and the same hop_n. Only the commitment at the end changes. Instead of hashing hop_n (§5.6), the prover computes hop_n modulo many primes, seals that list of remainders in a Merkle tree, pays a re-roll price, and publishes 16 entries of the list with their inclusion paths (§5.10). A verifier recomputes those 16 entries itself, each in word-sized arithmetic, without building hop_n or any root (§5.11).

What does not change. The aligned subtrees and their roots (§4.5, §4.6), region_n (§4.7), every location-based key and lookup id (§7.2), the terrain function (§5.2), the temporal axis (§5.3) and hop_n itself (§5.4) are exactly as before. A prover that also wants region_n, for a key, combines its axis roots as before; residue openings never need it.

Why the hop needs a new proof (non-normative). Version 1 of the hop proof is a fingerprint, SHA256(SHA256(hop_n)), and a fingerprint is all-or-nothing. Nobody can work backwards from it, and nobody can check it a little bit. The only way to check it is to rebuild every tree from the bottom row up, combine the roots into hop_n, hash it twice and compare, so the verifier does exactly the work the mover did. At height 20 that is about 4 seconds for the mover and another 4 seconds for anyone who checks, for every hop in the chain, and checking a long chain means replaying the whole journey. Residue openings let a verifier check a hop at height 20 in about 4 milliseconds, while the mover’s work grows by about a fifth (§5.12).

Terms:

  • Residue: what is left over when a number is divided by a modulus, written x mod p. It is where the number lands on a clock with p positions.
  • Hop prime: one of the m primes p_0, ..., p_(m-1) of a hop, each derived on its own from previous_event_id and its index j.
  • h_max: the largest of the hop’s three axis heights (§4.4) and its temporal height K (§5.2).
  • Seal: the Merkle root over the hop’s residues, carried in the hop’s proof tag (§5.10, §8.4).
  • Opening: one block of 8 residues and its inclusion path to the seal (§5.10).
  • Re-roll price: the work a prover must spend to obtain one set of sample positions: on average one sixteenth of an honest hop at the hop’s heights (§5.10).

Constants (normative):

HOP_RESIDUE_PRIME_DOMAIN  = b"CYBERSPACE_HOP_RESIDUE_PRIME_V1"    # 31 bytes
HOP_RESIDUE_LEAF_DOMAIN   = b"CYBERSPACE_HOP_RESIDUE_LEAF_V1"     # 30 bytes
HOP_RESIDUE_GRIND_DOMAIN  = b"CYBERSPACE_HOP_RESIDUE_GRIND_V1"    # 31 bytes
HOP_RESIDUE_SAMPLE_DOMAIN = b"CYBERSPACE_HOP_RESIDUE_SAMPLE_V1"   # 32 bytes
HOP_SAMPLES               = 16      # residues a verifier recomputes
RESIDUE_BLOCK             = 8       # residues per Merkle leaf
PRIME_BITS                = 61      # every hop prime is at least 2^61
WIDTH_DIVISOR             = 4       # the primes' product spans a quarter of the widest root
HOP_GRIND_HEIGHT          = 12      # one re-roll attempt is one aligned height-12 tree modulo p_0
SMALL_ODD_PRIMES          = (3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47,
                             53, 59, 61, 67, 71, 73, 79, 83, 89, 97)
HOP_REROLL_BUDGET         = (0, 0, 0, 0, 0, 0, 1, 2, 4, 7, 14, 30, 65, 149, 355, 782,
                             1753, 4016, 8959, 20028, 44826, 99974, 223681)   # heights 0 to 22
PAD_LEAF                  = 32 zero bytes

be32(n) and be64(n) are n as 4 and 8 big-endian bytes. If any part of this construction changes (a constant, a preimage format, an encoding), every domain string the change touches MUST be bumped to a new value.

Residues of a root. For an odd modulus p, pairing modulo p is

pi_p(a, b) = ((a + b) × (a + b + 1) × inv2 + b) mod p,    where inv2 = (p + 1) / 2

For all natural numbers a and b, π(a, b) mod p = pi_p(a mod p, b mod p). Applied level by level, compute_subtree_cantor(base, h) mod p is the same 2^h - 1 pairings carried out with pi_p, starting from the leaves (base + i) mod p, and every value along the way is below p. For a hop with axis roots cantor_x, cantor_y, cantor_z and temporal root cantor_t:

hop_n mod p = pi_p(pi_p(pi_p(cantor_x mod p, cantor_y mod p), cantor_z mod p), cantor_t mod p)

Implementations MAY compute a root modulo p with any equivalent algorithm, such as Babbage’s method of differences or a square-root-time method; the result MUST equal compute_subtree_cantor(base, h) mod p.

Why a root has a cheap shadow (non-normative). A Cantor pairing does only three things: it adds, it multiplies and it halves. On a clock with p positions, adding and multiplying do not care about full laps, only about where you land. Halving is the one odd step, but on a clock of odd size “half of x” is the same as “(p + 1) / 2 times x”, because twice (p + 1) / 2 is one full lap plus 1. With s = a + b, the identity 2 × π(a, b) = s(s + 1) + 2b holds over the integers, so it holds on the clock too, and a tree built on the clock lands exactly where the real root lands. In the real tree the numbers double in length at every level, until the top pairings multiply numbers that are megabytes long. On the clock nothing ever grows past the clock’s size, and a 61-bit prime fits in one machine word. At height 20, one residue of a root costs about 2.2 milliseconds as a plain tree on the clock and 0.23 milliseconds by the method of differences, against 3.86 seconds to make the hop (§5.12). Halving works only on a clock of odd size, which is the first rule every hop prime follows. Anybody can compute such a residue, because it needs only the tree’s base and height, which come from the event. That is why one residue proves nothing (§4.9), and why the rest of this section exists.

The hop primes. For each index j from 0 to m - 1, the hop prime p_j is derived from previous_event_id, the 32 raw bytes of the id in the hop’s e previous tag (§5.3), and from j, and from nothing else:

  1. digest = SHA256(HOP_RESIDUE_PRIME_DOMAIN || previous_event_id || be64(j)).
  2. x is the first 8 bytes of digest read as a big-endian integer and shifted right by 4 bits, which leaves 60 bits.
  3. n = (2^61 + x) | 1, the starting point made odd.
  4. While n is divisible by any number in SMALL_ODD_PRIMES, or n is not a base-2 strong probable prime, set n = n + 2.
  5. p_j = n.

n is a base-2 strong probable prime when, writing n - 1 = d × 2^r with d odd, either 2^d mod n is 1 or n - 1, or 2^(d × 2^i) mod n is n - 1 for some i from 1 to r - 1.

Every p_j is odd and lies in [2^61, 2^62), so a residue modulo it fits in 8 bytes. The test is a probable-prime test, and no step requires a proof of primality: p_j is, by definition, the number this procedure returns. The same prime MAY appear at two indices; implementations MUST NOT deduplicate.

The residue count. A hop has m primes:

m_raw = ceil(85 × 2^h_max / (WIDTH_DIVISOR × PRIME_BITS))
m     = max(RESIDUE_BLOCK, RESIDUE_BLOCK × ceil(m_raw / RESIDUE_BLOCK))

Every prime is at least 2^61, so Q = p_0 × p_1 × ... × p_(m-1) has at least 85 × 2^h_max / 4 bits, a quarter of the widest root of the hop. At h20, m = 365,288; at h30, m = 374,049,408.

The residues of the hop are r_j = hop_n mod p_j, for j from 0 to m - 1.

Why many prime clocks act as one giant clock (non-normative). One residue narrows a number down only a little, because every p-th number lands on the same spot of a p-clock. Add a second clock whose size shares no factor with the first, and the pair of spots repeats only at the product of the two sizes, so two residues behave exactly like one residue on a clock that large. Each further clock multiplies the combined clock’s size again. This is the Chinese Remainder Theorem, named after a puzzle in the Sunzi Suanjing (“count some things by threes and two are left over”), and it is the reason a list of small residues is worth as much as one residue on a gigantic clock. The clocks are primes because two different primes never share a factor, so every new clock adds its full size and none partly repeats another.

Why a quarter, and not all of hop_n (non-normative). Q is deliberately not as large as hop_n. It spans a quarter of the widest axis root, and hop_n is about eight times as wide as that root, so the residues pin down hop_n mod Q, a number millions of digits long at height 20, and never hop_n itself. That is enough, and going further would only cost more. What the count has to achieve is that getting the true list any way other than building the trees costs more than building them. There are two other ways:

  • One residue at a time. Each residue is cheap, but all of them together are not: at height 20, 365,288 residues at 0.23 milliseconds each come to about 84 seconds, against about 4.7 seconds for the honest hop (§5.12). The honest prover is faster at the whole list because it builds each root once and then divides it by every prime in one batch.
  • The whole hop on the combined clock. Any tree can be carried out modulo Q, and every residue then falls out at the end. That saves work only on levels where the real numbers are wider than Q, because on the clock a number never grows past Q. With Q at a quarter of the widest root, that is only the top two levels, and wrapping them costs about what it saves: measured, it is no cheaper than the exact trees. The shortcut starts to win only when the clock is between 1/32 and 1/64 of the root (at 1/64 it costs 79 to 96 percent of the exact trees), so a quarter sits at least eight times above that point. A prover that shrinks its clock to 1/64 of the root also holds only one sixteenth of the true residues, and passes 16 checks with odds of 1 in 2^64.

Covering all of hop_n would take up to 32 times as many primes and add no safety. The list grows with the work, always about a quarter of the widest root, but it stays with the prover; the event carries only openings, which grow by one sibling hash each time the list doubles (§5.12).

Why every index gets its own prime (non-normative). hop_n = π(region_n, cantor_t) is the place and the moment. The place, region_n, is the same for everyone crossing the same aligned region, and it is the expensive part. The moment, cantor_t, comes from the mover’s previous event id and is cheap. On any clock, hop_n’s residue is one pairing, done on the clock, of the place’s residue and the moment’s residue, so anyone who already knows the place’s residue on a clock can finish the rest cheaply. That rules out three designs:

  1. Fixed primes make residues reusable. A region’s residues on fixed primes never change, so someone who computed a region once could keep its table and cross it again for about 27 percent of a fresh hop at height 20, measured. Under version 1 such a crossing costs about 73 percent, because the full-width combine cannot be cached. That is the “instant teleportation over previously-trod terrain” that the temporal axis exists to prevent (§5.1).
  2. Fixed primes make residues leak. Every published opening reveals residues of one mover’s hop_n. Anyone can compute that mover’s cantor_t from its public previous event id and run the last pairing backwards on the clock to peel off the place’s residue (a quadratic, so at most two candidates). With fixed primes these leaks add up: an independent review pooled the openings of 30 movers through one region and rebuilt 76 percent of that region’s table, enough to cross it on other people’s work.
  3. A window into a fixed catalog can be aimed. If each hop used a consecutive stretch of one fixed catalog of primes, starting at a position chosen by its previous event id, a mover could re-roll its own previous event id before publishing it, by changing that event’s created_at and signing again. That does not touch the previous event’s proof, which depends on the event before it. The mover would stop when the stretch landed on primes it already held a table for.

Drawing every prime on its own, from (previous_event_id, j), out of about 27 quadrillion candidates, closes all three. The next hop has a whole new set of clocks, so a table on the old clocks is useless. An opening reveals residues on clocks that, in practice, no other hop will ever use. Re-rolling the previous event id gives a brand-new scattered set of primes, with no stretch to aim at. The previous event id is the right seed for the same reasons it seeds the temporal axis (§5.3): the verifier reads it from the event, nobody knows it until the previous hop is done, it differs at every position in the chain, and it exists before the work starts. The seal could not serve, because the primes are needed to make the list that is sealed.

5.10 The seal, the re-roll price and the openings (normative)

The seal. Split the residues into m / RESIDUE_BLOCK blocks of 8 consecutive residues: block b holds r_(8b) to r_(8b+7). Each block is one leaf:

leaf_b = SHA256(HOP_RESIDUE_LEAF_DOMAIN || previous_event_id || be64(b)
                || be64(r_(8b)) || be64(r_(8b+1)) || ... || be64(r_(8b+7)))

Append PAD_LEAF until the number of leaves is a power of two, and build the tree bottom-up with parent = SHA256(left || right), as in §6.4 step 5. The root is the seal, and it is the value of the hop’s proof tag (§8.4). depth is the number of levels above the leaves: the smallest d with 2^d ≥ m / RESIDUE_BLOCK. A tree of a single leaf has depth 0, and its seal is that leaf.

Why a seal (non-normative). The list is far too big for an event: at height 20 it is 365,288 residues of 8 bytes each, about 2.9 MB. A Merkle tree seals it into 32 bytes, as version 1’s fingerprint sealed hop_n, with one difference that is the whole point: a Merkle tree can be opened one entry at a time. Change any residue and its leaf changes, then every box above it, and finally the seal, so once the seal is published the list is locked. An opening is the one block plus the boxes hanging off its route to the top, a couple of dozen hashes. Each leaf carries the previous event id and its own block number, so a leaf of one hop is never a leaf of another hop, nor of another position in the same tree.

The re-roll price. The sample positions are drawn from a 32-byte value G that costs residue work to obtain. One attempt, for an unsigned 64-bit nonce:

seed   = SHA256(HOP_RESIDUE_GRIND_DOMAIN || previous_event_id || seal || be64(nonce))
g_base = ((int(seed) mod 2^85) >> HOP_GRIND_HEIGHT) << HOP_GRIND_HEIGHT
r_g    = compute_subtree_cantor(g_base, HOP_GRIND_HEIGHT) mod p_0
G      = SHA256(HOP_RESIDUE_GRIND_DOMAIN || seed || be64(r_g))

int(seed) reads the 32 bytes as a big-endian integer, p_0 is the hop’s first prime, and r_g is computed modulo p_0 as in §5.9, without the root itself. The price A is the sum of the budgets for the hop’s three axis heights and K, and at least 1:

B(h) = HOP_REROLL_BUDGET[h]                          for h ≤ 22
B(h) = floor(223681 × 9^(h - 22) / 4^(h - 22))       for h > 22, in exact integer arithmetic
A    = max(1, B(h_x) + B(h_y) + B(h_z) + B(K))

The prover MUST publish, in the mn tag, a nonce for which G, read as a 256-bit big-endian integer, satisfies G × A < 2^256. Each attempt succeeds with probability 1/A, so the prover performs A attempts on average, and a verifier repeats one. Any nonce that meets the price is valid; the golden vectors take the first one counting up from 0, and a production prover MAY split the search across workers.

Why the price (non-normative). Without it, a prover could do the expensive part honestly and skip some of the cheap part: build the trees, compute only some of the residues, put junk in the rest, and then keep drawing new sample positions until all 16 miss the junk. If a fresh draw were nearly free, that would save up to about a third of the work. An independent review found exactly this in an earlier version of this design, which priced draws only below h18. The residue work is divisible: as with a Merkle tree, where half the leaves cost half the work, half the residues cost about half the residue work, so it needs the price at every height. The Cantor trees are holographic: every residue depends on every leaf and every pairing, so the cheap way to most residues is the root, and holding even one sixteenth of them costs most of a full tree (§5.9). The trees therefore need no price of their own; the price protects the divisible part. When every fresh set of samples costs at least 1/HOP_SAMPLES of the divisible work, no fraction of skipped work lowers the expected cost of an accepted proof (§5.11 states the argument, which is §6.11’s), and with the price in place the cheapest forger found pays 1.000 times the honest cost at h16, h18, h20 and h22 (§5.12).

Why it is priced this way (non-normative). This is the re-roll price of the sidestep (§6.10), with three differences. First, the currency is residue work, not SHA-256: one attempt is one aligned height-12 tree modulo a 61-bit prime, measured at 6.1 microseconds, which hash-mining hardware cannot make cheaper, and the seed chooses the tree’s base, so no attempt can be prepared in advance. Second, the cost of an honest hop is not a simple count of leaves, because the numbers grow as the tree climbs, so the budget per height is a table calibrated by measurement: HOP_REROLL_BUDGET[h] is one sixteenth of an honest hop at height h, counted in attempts, measured on one core of a Ryzen 7 6800H. Above h22 each height costs 9/4 of the one below, close to the growth of 2.23 to 2.24 per height measured from h19 to h22. Third, a multi-axis hop sums the budgets of its axes and of K, which prices it conservatively. As for the sidestep, the threshold is an integer comparison rather than a count of leading zero bits, so that the price stays exact for sums that are not powers of two. The table is a set of normative constants, like the terrain constants of §5.2, and changing it is a change to the chain rules (§8.12).

The draw. For each i from 0 to HOP_SAMPLES - 1:

idx_i = int(SHA256(HOP_RESIDUE_SAMPLE_DOMAIN || G || be32(i))) mod m

idx_i names the residue r_(idx_i), which sits in block idx_i div 8 at position idx_i mod 8. Indices MAY collide, and implementations MUST NOT deduplicate them, so that the number of openings is fixed and the mp tag is fixed-width.

Why the draw comes from the seal (non-normative). Nobody asks the mover for particular entries in real time. A hash of the seal, the previous event id and the nonce asks the question in place of a live checker, so every verifier, at any time, reads the event, works out the same 16 positions and checks that the openings are exactly those. This is the Fiat-Shamir transform (Amos Fiat and Adi Shamir, 1986). Because the draw depends on the seal, the list is locked before the mover learns which entries will be opened, and re-sealing or trying nonces until the draw is friendly is what the price makes expensive. The previous event id enters the draw directly, through seed, as it does for the sidestep (§6.10) and the ride (DECK-0001 §5.5), and again through p_0 and through every leaf.

The openings. For each idx_i, in ascending i, the prover publishes one opening: the 8 residues of block idx_i div 8, each as be64, followed by the depth sibling hashes on the route from that block’s leaf to the seal, from the leaf level upward. An opening is 64 + 32 × depth bytes, and the 16 openings together are HOP_SAMPLES × (64 + 32 × depth) bytes. Two samples in the same block publish the same opening twice. At each level the verifier determines left and right from the block number, as in §6.10: an even position is a left child and an odd one a right child, and the position halves, rounding down, at each level up. The mp tag carries the openings (§8.4).

Why openings carry whole blocks (non-normative). The verifier works out the sampled residue itself, but it needs the other seven residues of the block to recompute the leaf it climbs from. Blocks of 8 make the tree three levels shallower than one leaf per residue would, which saves 96 bytes of siblings per opening and costs 56 bytes of extra residues. Each opening carries its own siblings even when two openings share some, so every opening has the same width and the tag needs no separators.

Golden vectors (normative). hop-residue-reference.py (§14) prints the golden vectors of this construction, and a conforming implementation MUST reproduce every one of them exactly. For the movement of §5.7, (0, 0, 0) → (4104, 0, 0) with previous_event_id equal to 32 zero bytes:

  • the axis heights are 13, 0, 0 and K = 11, so h_max = 13, m = 2856 in 357 blocks, depth = 9, and A = 179 (149 for the axis at height 13 and 30 for K = 11)
  • p_0 = 2501841973170584791 and p_1 = 2618389119072288907
  • proof (the seal): c5524980e1b021dc49fb64d14a521456a48693d0711a886516c1f4ab733db5cb
  • mn: 0000000000000057 (nonce 87, the first that meets the price counting up from 0), with G = 003e95fef5d92b12ea28d8d2ac538c91712219afaab153f2ee1a94f6a6d64e40
  • the first sample index is 2092, and its residue is 2707389969566835098
  • mp: 11,264 characters, whose SHA-256, taken over the tag value as ASCII, is 3d5d88eba8a384d134bba7ba00ea48b7188802c482f011fbef3b8100ccbc4e93

The script also prints a hop that moves on all three axes with a nonzero previous_event_id, single primes (one at an index above 2^32), one leaf, one attempt, and budgets above h22.

hop-residue-vectors.json (§14) carries these golden vectors as machine-readable values, so that a port in any language can test itself against them without running Python: the single values above, the §5.7 hop and six more hops with every value a prover computes on the way to its tags, the 16 Level 1 checks (§5.11) of the §5.7 hop one at a time, and that hop’s tags changed one way at a time, each with the verdict Level 1 reaches. The file is not normative. It is written from the reference by hop-residue-vectors.py, and where it disagrees with this text, the text is right and the file is a bug.

5.11 Hop verification levels

Level 1: residue openings. A verifier checks a hop’s proof as follows; §8.7.1 places these steps among the other checks of a hop.

  1. Derive everything from the event, taking nothing from the prover: each axis’s height and aligned base from c and C (§4.4, §4.5); K from C, including its plane bit (§5.2); t_base from previous_event_id and K (§5.3); and from those h_max, m (§5.9), depth and A (§5.10).
  2. Parse the seal from proof, the nonce from mn and the 16 openings from mp, and reject unless each has exactly the form and width §8.4 gives it.
  3. Replay one attempt: compute G from previous_event_id, the seal and the nonce (§5.10), and reject unless G × A < 2^256.
  4. Derive idx_0 to idx_15 from G (§5.10).
  5. For each i, with opening i: derive p = p_(idx_i) (§5.9); compute hop_n mod p from the axis bases and heights and from t_base and K (§5.9); reject unless it equals residue idx_i mod 8 of the opening’s block; then recompute leaf_b for b = idx_i div 8 from the opening’s 8 residues, climb its depth siblings, and reject unless the climb ends at the seal.
  6. Accept if and only if every step passes.

Level 1 never builds a root, region_n or hop_n. It costs one attempt, at most 17 prime derivations, 16 residues of hop_n and 16 paths: about 4 milliseconds per hop at height 20, measured (§5.12).

Level 2: full audit. A verifier rebuilds every root, computes every residue r_j for j from 0 to m - 1, rebuilds the seal and compares it with the proof tag, then checks the price and the openings as at Level 1. This costs the same order of work as making the hop.

Security model. As for sidesteps (§6.11), the protocol does NOT require every verifier to perform Level 2. Security relies on deterministic fraud detectability: the true seal is a deterministic function of the hop’s coordinates and previous_event_id, every one of which is public on the event, so a seal over anything but the true residues remains permanently and objectively detectable by any party willing to do the work, and a detected fraud invalidates the chain from that event forward.

What sampling bounds (non-normative). A prover whose sealed list holds the true residue at a fraction f of its positions survives 16 samples drawn by G with probability about f^16:

Share of the sealed list that is trueChance of passing all 16 checks
99 percent85 percent
90 percent19 percent, about 1 in 5
75 percent1 percent
50 percent1 in 65,536
1 in 161 in 2^64

What decides whether partial work pays is the price of trying again. Write W for the divisible part of an honest hop’s work, which is at most all of it, and S for HOP_SAMPLES. Every fresh set of samples costs at least W/S, so a prover holding a fraction f of the true residues pays at least f·W + f^(−S)·W/S for the divisible part, against the honest W + W/S. The difference is W·u(f) with u(f) = (f^(−S) − 1)/S − (1 − f), and u(f) ≥ 0 for every f in (0, 1], by the proof in §6.11. With any cheaper retry, skipping a small fraction of the residues would pay. The holographic part needs no price: the cheapest strategy measured for holding one sixteenth of the true residues costs 79 to 96 percent of the exact trees, and then passes with odds of 1 in 2^64.

What is proven, what is measured, what is assumed (non-normative).

ClaimStatus
the residue identity of §5.9, the method of differences, the CRT bound of §5.9, the f^16 sampling bound and the price argument aboveproven, and checked numerically by hop-residue-reference.py
the cost of every strategy above, of the honest prover and of the verifiermeasured on one machine (§5.12)
the re-roll budget tablecalibrated on that machine; if on other hardware the price came to only half of W/S, the most a cheater could gain is about 1.1 percent of the divisible work, by the same argument
that no algorithm computes most residues of a root much faster than building the tree, beyond those triedassumed, the same assumption the protocol already makes about the root itself (§4.1, §13)

Why 16 checks (non-normative). With the price in place, the sample count no longer decides whether skipping work pays. It decides how hopeless the holographic shortcut is, what a verifier spends, and how large the openings are. Sixteen checks make the one-sixteenth shortcut hopeless, at odds of 1 in 2^64, cost a verifier about 4 milliseconds at height 20, and keep the openings near the size of a sidestep’s (§5.12).

5.12 Performance of residue openings (non-normative)

Every figure in this section was measured on one core of a Ryzen 7 6800H, with the prover in C using GMP and the verifier in C using 64-bit words. The chains are 40 linked hops, each starting where the previous one ended, and the verifier derived every height, base, K and temporal base from the events themselves. Version 1 verification is a recomputation, so it costs exactly version 1’s production.

40 linked hopsproduce, version 1produce, residue openingsverify, residue openingsverify vs version 1 productionverify vs residue openings productionverify vs the Cantor trees alone
heights 10 to 2021.7 s26.4 s (1.22x)0.039 s561x faster683x faster153x faster
heights 8 to 161.57 s1.82 s (1.16x)0.015 s103x faster120x faster22x faster
all at h20160.2 s193.3 s (1.21x)0.154 s1,040x faster1,255x faster295x faster

The last column is the most conservative. Every accepted proof at h18 and above must contain the Cantor trees (§5.9, §5.11), so the trees alone are a floor on any producer, and the verifier beats even that floor. Flipping one residue in one opening made the verifier reject the chain at that hop.

Other measured figures:

  • One residue of an h20 root: 2.2 ms as a plain tree modulo p, and 0.23 ms by the method of differences at level 6, which is 12.8 times faster. Making the whole h20 hop under version 1 takes 3.86 s, of which 1.08 s is the axis tree and 2.78 s the full-width combine and hash.
  • One hop prime: about 2 µs. Over 5,000 test draws the search visited about 20 odd candidates on average and 208 at most, and about four rejections in five came from the small-prime filter.
  • One re-roll attempt: 6.1 µs.
  • The honest hop under residue openings, its re-roll price, and the cheapest forger found, minimized over every fraction f of residues held:
hhonest hop, residue openingsre-roll pricecheapest forger, price only below h18cheapest forger, price at every height
160.18 s0.012 s1.00x honest1.000x honest
180.97 s0.10 s0.70x honest1.000x honest
204.74 s0.40 s0.65x honest1.000x honest
2223.3 s1.6 s0.64x honest1.000x honest

These measurements rounded the price up to a power of two of attempts (at h20, 2^16 attempts, where A is about 44,800), which is at least the price A of §5.10, so the honest overhead they show is an upper bound for this section’s price. The honest residue work is also unoptimized: the remainder tree costs 2 to 3 times the trees, and the prime search is unsieved. Faster versions of either would lower the prover’s overhead, and with it the first two verify ratios, but not the ratio against the trees alone.

The sizes follow from §5.9 and §5.10:

h_maxresidues mthe list, which stays with the proverdepthmp characters
896768 bytes46,144
121,43211 KB810,240
1622,832183 KB1214,336
20365,2882.9 MB1618,432
245,844,52847 MB2022,528
30374,049,4083.0 GB2628,672
345,984,790,49648 GB3032,768
4749,027,403,730,344392 TB4346,080

The proof tag stays 64 characters and mn adds 16. At h20 a hop’s mp is 18,432 characters, against about 11 KB for a single-axis sidestep at the same height (§6.14), and even at h47 it is 46,080 characters, within common relay event-size limits. The list grows as fast as the work, about a quarter of the widest root, and a mover at h47 already needs petabytes for the trees themselves. Implementations SHOULD confirm their relays’ event size limits before publishing hops above about h60, where the mp tag approaches 64 KB.

5.13 Version 2 of the hop proof (normative)

Residue openings are a breaking change to hop verification. The Cantor work is unchanged: the trees, region_n, K, cantor_t and hop_n are exactly as before, so the golden values of §5.7 carry over. What changes is what a hop’s proof tag commits to, and that a hop carries the mn and mp tags.

  • The four domain strings of §5.9 are new, and so are the mn and mp tags on a hop (§8.4).
  • Under chain rules revision 2026-10-08-residue-openings (§8.12), a hop MUST carry the seal of §5.10 in its proof tag, together with its mn and mp tags, and verifiers MUST check them per §5.11 and §8.7.1.
  • Verifiers implementing this revision MUST reject version 1 hops, whose proof tag is the proof_hash of §5.6 and which carry no mn and no mp tag, with one exception: the version 1 hops listed in grandfathered-v1-hops.txt. There is no grace period and no dual-acceptance mode for anything not on that list.
  • The list names, by event id, the version 1 hops published before the reference clients began publishing version 2, as found by a final census taken at the cutover. Each one is audited before it is listed: its proof_hash is recomputed per §5.6 from its own c, C and previous_event_id, and compared with its proof tag. A hop that fails that audit is not listed, so it stays invalid, as it already was.
  • A verifier MUST accept a listed hop’s proof tag without recomputing it, and MUST check everything else about it exactly as for any other hop: chain linkage, continuity, its sector tags, and the count and form of its tags (§8.8). A listed hop MAY lack the mn and mp tags (§8.8). Because every version 1 hop published before the cutover is listed unless it fails the audit, the cutover itself invalidates no chain and makes no identity respawn.
  • A version 1 hop that is not on the list is invalid, and so is the chain from that event forward (§8.7.3). There is no date cutoff: event ids cannot be forged, so the list cannot be joined after the fact, as a date cutoff could be by backdating created_at.
  • Each non-empty line of grandfathered-v1-hops.txt that does not begin with # starts with a 64-character lowercase hex event id; anything after the id on the same line is commentary. This is the format of grandfathered-v2-sidesteps.txt (§6.16).
  • The list is filled from the final census, taken when the reference clients begin publishing version 2 hops.

Version 1 hops are recognizable by the absence of the mn and mp tags.

Why version 1 hops are not accepted alongside version 2 (non-normative). A version 1 hop cannot be forged; it is expensive to check. If verifiers kept accepting it, every verifier would still need the full recomputation for any hop it meets, and a mover that kept publishing version 1 hops would make everyone who checks its chain replay its whole journey. One proof per action keeps every verifier’s cost bounded by the openings.

Why a list of event ids and not a date (non-normative). created_at is whatever the signer writes, so a date cutoff could be joined after the fact by backdating, at no cost. An event id is the hash of the event, so nobody can make a new event with a listed id. Listing every audited old hop by id means the cutover invalidates no chain, while every hop published afterwards is cheap to verify. A verifier implementation can embed the listed ids as a constant generated from the file, noting the commit it came from, rather than fetching them at runtime.


6. The Wall and the Sidestep

The Cantor pairing tree gives Cyberspace its spatial fabric, but it also reveals a fascinating limitation that turns out to be a feature.

6.1 The storage bottleneck (non-normative)

As the Cantor tree gets taller (meaning, as you cross larger regions of space), the intermediate values computed during the pairing process grow exponentially in bit size. The Cantor pairing function π(a, b) = (a + b)(a + b + 1)/2 + b produces outputs roughly quadratic in the size of its inputs. After h levels of pairing, intermediate values can be millions or billions of bits long, and they must be stored during construction because parent nodes require both children.

LCA HeightCantor Intermediate StorageMerkle Working Memory
h20~11 MB640 bytes
h30~11 GB960 bytes
h34~182 GB1,088 bytes
h40~11 TB1,280 bytes
h50~11 PB1,600 bytes
h60~12 EB (about 0.1% of installed world storage)1,920 bytes
h70~12 ZB (roughly all installed storage today)2,240 bytes

This is not a bug. This is the digital equivalent of a mountain range.

Storage figures in this document are 85 × 2^h bits per axis root in decimal units (1 GB is 10^9 bytes); the h34 root is 182.5 GB, which is 170 GiB.

The storage bottleneck creates natural barriers in Cyberspace: walls that cannot be crossed by direct Cantor computation regardless of how much time you have, because you simply can’t store the intermediate values. These walls aren’t designed by anyone. They emerge from the mathematics.

But walls are only interesting if there’s a way to get past them — expensively, deliberately, with real effort.

6.2 How the sidestep action works

A sidestep action traverses 1 Gibson in a direction using an alternative POW that makes otherwise impossible LCA barriers feasible to cross. Instead of Cantor pairing, a sidestep produces a tree with a Merkle hash tree over SHA-256 hashes of leaf coordinates. The critical insight: SHA-256 operations are fixed-size (256 bits in, 256 bits out) regardless of tree height. No storage bottleneck. The cost of a sidestep is purely time: how long it takes to hash every leaf coordinate.

At heights above roughly h16 a sidestep is cheaper in wall-clock time than the equivalent hop, and the gap widens with height (see §6.14). The hop remains the primitive that produces a region root; the sidestep is the primitive that crosses a boundary. An agent hops when it wants the root (a discovery key or a domain) and sidesteps when it wants to move.

The sidestep is a toll: its work is seeded by the mover’s chain position, so it is paid in full by every traveller and cannot be reduced, sold, or inherited from anyone else’s published proof (§6.4, §6.15). The hop is deliberately not a toll, because its work product is a canonical region root that a holder may choose to share (§6.12).

Core terms:

  • Sidestep: A movement action that crosses an LCA boundary via a Merkle hash tree proof instead of a Cantor pairing tree proof. Crosses exactly 1 Gibson past the boundary, regardless of the amount of work it takes.
  • Merkle root (sidestep): The root hash of a binary Merkle tree built over SHA-256 hashes of every leaf coordinate in an aligned subtree, seeded by the mover’s chain position. Domain-separated from other protocol hashes.
  • Toll: The property that a sidestep’s spatial work is non-transferable. Every traveller crossing a given boundary pays the full price; no published proof reduces the cost for any other traveller.
  • Openings: The inclusion paths published with a sidestep: the destination leaf’s path plus SIDESTEP_SAMPLES paths at pseudorandomly sampled positions (§6.10).
  • SIDESTEP_DOMAIN: b"CYBERSPACE_SIDESTEP_V2", the domain separation prefix used for all sidestep leaf hashes.
  • Re-roll price: The work a prover must spend to obtain one set of sample positions: on average one eighth of the crossing’s tree. It makes trying again cost as much as the work a retry could save (§6.10, §6.11).
  • SIDESTEP_GRIND_DOMAIN: b"CYBERSPACE_SIDESTEP_GRIND_V1", the domain separation prefix of the re-roll price hash G (§6.10).
  • SIDESTEP_SAMPLE_DOMAIN: b"CYBERSPACE_SIDESTEP_SAMPLE_V2", the domain separation prefix used to derive sampled opening indices from G.
  • SIDESTEP_SAMPLES: 8, the number of sampled openings published per non-trivial axis.

6.3 Sidestep geometry (normative)

A sidestep is the smallest possible move across a wall. The wall is the boundary between the two children of the LCA subtree: the two aligned halves that an axis value must cross between when its high bit at height h - 1 flips. A sidestep starts on the leaf touching the wall on the source side, and ends on the leaf touching the wall on the destination side. The two leaves are neighbours: they differ by exactly 1 Gibson, and the wall runs between them. Everything else the avatar wants to do (reaching the wall, and continuing past it) is done with hops, which are the primitive that produces a region root (§4, §5); the sidestep only crosses.

Given source axis value v1 and destination axis value v2 on an axis where movement occurs:

  • The LCA height h = find_lca_height(v1, v2) identifies the wall. base = (v1 >> h) << h is the first leaf of the LCA subtree, and half = 2^(h - 1) is the number of leaves in each of its two children. The wall lies between leaf base + half - 1 (the last leaf of the lower child) and leaf base + half (the first leaf of the upper child).
  • The source MUST be the leaf touching the wall on its side. Crossing upward (v2 > v1) the source is base + half - 1: every bit below h - 1 is one. Crossing downward (v2 < v1) the source is base + half: every bit below h - 1 is zero.
  • The destination MUST be the neighbouring leaf on the other side of the wall: v2 = v1 + 1 crossing upward, v2 = v1 - 1 crossing downward. In both directions |v2 - v1| = 1, and v1 and v2 are in different children of the LCA subtree.
  • Non-crossing axes MUST have v1 == v2. A sidestep that crosses walls on more than one axis at once is described in §6.9; each crossing axis obeys the rules above independently.

Worked examples on one axis (values written in binary, most significant bit first):

  • v1 = 0b0111 and v2 = 0b1000. Here h = 4, base = 0, half = 8. The wall is between leaves 7 and 8. The source 7 is base + half - 1 (all lower bits one) and the destination 8 is base + half (all lower bits zero): a valid upward sidestep.
  • v1 = 0b1000 and v2 = 0b0111. The same wall crossed downward: the source 8 is base + half and the destination 7 is base + half - 1: a valid downward sidestep.
  • v1 = 0b0101 and v2 = 0b1000. Still h = 4, but the source 5 is not touching the wall (leaf 7 is). This is NOT a valid sidestep. The mover first hops from 5 to 7 (a hop with h = 2), then sidesteps from 7 to 8.
  • v1 = 0b0111 and v2 = 0b1011. Not a valid sidestep either: the destination 11 is 3 Gibsons past the wall. The mover sidesteps from 7 to 8, then hops from 8 to 11 (a hop with h = 2).

Why the source constraint exists: the Merkle root (§6.4) is computed over every leaf of the whole LCA subtree, 2^h leaves, whichever leaf the avatar starts from. If the source could be anywhere inside its half, a single sidestep event would carry the avatar up to half - 1 Gibsons to the wall and then across, with no hop and therefore no region root along the way. Pinning the source to the wall keeps a sidestep to its one job, crossing, and keeps every other Gibson of travel inside hops. It also removes an ambiguity: with the source at the wall, “the first leaf of the adjacent aligned subtree” and “exactly 1 Gibson past the boundary” describe the same leaf in both directions.

A verifier at Level 1 (§6.11) checks this geometry directly from the event’s coordinates before it looks at any hash: h from the two values, the source touching the wall on its side, the destination exactly one Gibson beyond it. An event that fails the geometry check is invalid regardless of its proof.

6.4 Per-axis Merkle root (normative)

Sidestep leaves are seeded. Let previous_event_id be the 32 raw bytes of the id referenced by this event’s e tag with marker previous, and let axis_byte be a single byte identifying the axis: 0x00 for X, 0x01 for Y, 0x02 for Z. Define the per-axis seed prefix:

seed_prefix = SIDESTEP_DOMAIN || previous_event_id || axis_byte || SEED_PAD

SIDESTEP_DOMAIN is 22 bytes and SEED_PAD is 9 zero bytes, so seed_prefix is exactly 64 bytes: one full SHA-256 block. This is deliberate (§6.5).

For each axis where movement occurs (v1 ≠ v2):

  1. Compute h = find_lca_height(v1, v2).
  2. Compute the aligned subtree base: base = (v1 >> h) << h.
  3. The aligned subtree contains 2^h leaves: [base, base+1, ..., base + 2^h - 1].
  4. For each leaf value L_i (where i ranges from 0 to 2^h - 1):
    • Encode as big-endian minimal bytes: leaf_bytes = int_to_bytes_be_min(base + i)
    • Compute leaf hash: H_i = SHA256(seed_prefix || leaf_bytes)
  5. Build the Merkle tree bottom-up:
    • For each pair (H_{2j}, H_{2j+1}): parent = SHA256(H_{2j} || H_{2j+1})
    • Continue until a single root M_axis remains.
  6. The per-axis Merkle root is M_axis (32 bytes).

Domain separation constant (normative):

SIDESTEP_DOMAIN = b"CYBERSPACE_SIDESTEP_V2"   # 22 bytes
SEED_PAD        = b"\x00" * 9                 # brings seed_prefix to exactly 64 bytes

If any aspect of sidestep leaf hash computation changes in a future version (preimage format, domain string, encoding), the domain string MUST be bumped to a new value to avoid cross-version collisions.

Trivial axes (h = 0): When v1 == v2 on an axis, the Merkle root is the single leaf hash: M_axis = SHA256(seed_prefix || int_to_bytes_be_min(v1)). No tree construction is needed.

Why the seed (normative rationale): Without it, the leaf preimage contains no identity and no chain context, so the root for a given aligned subtree is the same 32 bytes for every traveller in the history of the protocol. Because the destination is deterministic (§6.3) and both the roots and the openings are published in the clear (§8.5), the first identity to cross any boundary would publish everything a later identity needs: a follower could copy mr and mp from a relay, compute only the temporal axis (at most 2^16 Cantor pairs, about 100 ms), and produce a proof that passes both verification levels, because the copied root is the correct root. Boundary crossings would be priced for the pioneer and free for everyone after. The seed makes each traveller’s tree unique to its chain position, so the price in §6.14 is what every traveller pays, every time.

Why the axis byte (normative rationale): Earth is centred at exactly 2^84 on every axis (§9.7) and its surface radius is about 2^55.6 Gibsons. Because 2^84 is a multiple of 2^h for every h ≤ 84, the centre is always a cell boundary, so above about h56 the aligned base on each axis takes one of only two values, and any two axes falling on the same side of the centre plane share it exactly. Without axis separation such a crossing would compute one tree and claim it as two or three, and §6.9’s “the total work is the sum of per-axis work” would be false by that factor at exactly the heights where the work is largest.

6.5 Streaming computation (normative)

The Merkle tree MUST be computable in streaming fashion without storing all leaf hashes simultaneously:

  1. Process leaves in ascending order (deterministic enumeration from base to base + 2^h - 1).
  2. Maintain a stack of pending intermediate hashes, maximum depth h.
  3. Working memory: h × 32 bytes (under 3 KB even at h85).
  4. Total hash operations: 2^(h+1) - 1 (2^h leaf hashes + 2^h - 1 internal hashes).
def compute_merkle_root_streaming(seed_prefix: bytes, base: int, height: int) -> bytes:
    """Compute Merkle root over aligned subtree in O(h) memory."""
    if height == 0:
        return sha256(seed_prefix + int_to_bytes_be_min(base))

    stack = []  # (hash_value, level)
    for i in range(1 << height):
        leaf_bytes = int_to_bytes_be_min(base + i)
        current = sha256(seed_prefix + leaf_bytes)
        level = 0
        while stack and stack[-1][1] == level:
            left = stack.pop()[0]
            current = sha256(left + current)
            level += 1
        stack.append((current, level))
    return stack[0][0]

(Implementations MAY use any equivalent algorithm; the result MUST match this definition.)

Midstate optimization (normative for performance, not for consensus): seed_prefix is exactly 64 bytes and constant for the whole tree, so it fills exactly one SHA-256 block. Implementations SHOULD precompute the compression-function midstate over that block once per axis and resume from it for every leaf. Because leaf_bytes is at most 11 bytes and SHA-256 padding needs 9, each leaf then costs exactly one further compression, which is the same per-leaf cost as an unseeded leaf. The figures in §6.14 are therefore unchanged by seeding.

Had seed_prefix not been padded to a block boundary, each leaf would have straddled two blocks and every sidestep in the protocol would have cost twice as much. Implementations that ignore the midstate optimization are still consensus-correct; they are simply half as fast.

6.6 Spatial region integer (region_m)

Combine per-axis Merkle roots into a single spatial proof integer:

mx = int.from_bytes(M_x, "big")   # X-axis Merkle root as integer
my = int.from_bytes(M_y, "big")   # Y-axis Merkle root as integer
mz = int.from_bytes(M_z, "big")   # Z-axis Merkle root as integer
region_m = cantor_pair(cantor_pair(mx, my), mz)

This mirrors the hop proof’s region_n = π(π(cantor_x, cantor_y), cantor_z) but uses Merkle roots instead of Cantor roots.

All three axes always use Merkle roots in a sidestep. There is no mixed mode; the proof type (Cantor or Merkle) is determined by the action type (hop or sidestep), not per-axis.

6.7 Temporal binding

The temporal binding mechanism for sidesteps is identical to hop proofs (§5.2–§5.3):

  1. Compute terrain height K at the destination coordinate per §5.2.
  2. Derive temporal seed t from previous_event_id per §5.3.
  3. Compute cantor_t = compute_subtree_cantor(t_base, K).

This is always feasible because K ≤ 16 (maximum 65,536 Cantor pairs, ~100 ms).

Why temporal binding is retained: In v1 of the sidestep construction the temporal axis was the only thing binding a proof to a chain position, because the spatial Merkle root was deterministic and replayable. Since §6.4 now seeds the spatial leaves with previous_event_id, replay protection is already provided by the spatial component. The temporal axis is retained because it carries the terrain-derived height K (§5.2), which is a property of the destination and not of the mover, and because it keeps sidestep and hop proofs structurally parallel. It is no longer load-bearing for replay.

No precomputation (normative consequence): Because seed_prefix depends on previous_event_id, which is only known once the preceding event is published, the spatial Merkle root cannot be computed in advance of a crossing. An entity MUST perform the full spatial work between publishing its previous event and publishing the sidestep. This is the intended behaviour: it is what makes the cost in §6.14 a toll rather than a one-time preparation that can be amortized or scheduled.

Resumption (non-normative): A crossing at h47 or above is hours of GPU work that can no longer be staged ahead of time, so an interrupted crossing is expensive to lose. Implementations SHOULD persist completed subtree state keyed by (previous_event_id, axis_byte, base, h) so an interrupted sidestep resumes rather than restarting. The seeding of §6.4 makes this safe: cached state is only ever valid for the one chain position it was computed under, so it can never be replayed into a later crossing. This mirrors decks/DECK-0001-hyperspace.md §5.7.

6.8 Sidestep proof hash (normative)

Combine spatial and temporal components:

sidestep_n = cantor_pair(region_m, cantor_t)

Apply double SHA-256 (consistent with hop proofs, §5.6):

sidestep_bytes = int_to_bytes_be_min(sidestep_n)
proof_key = sha256(sidestep_bytes)
proof_hash = sha256(proof_key)  # 32 bytes

When used in Nostr tags, proof_hash MUST be encoded as lowercase hex.

6.9 Multi-axis sidestep

A single sidestep event MAY cross boundaries on multiple axes simultaneously (if source and destination differ on more than one axis). Each crossing axis obeys the geometry of §6.3 on its own: its source touches its wall and its destination is 1 Gibson past it, so the event moves the avatar by exactly 1 Gibson on every crossing axis and by nothing on the others. The proof is constructed independently per axis:

  • Each axis computes its own Merkle root (or trivial single-leaf hash for axes where h = 0).
  • The three roots are combined into region_m via Cantor pairing (§6.6).
  • Temporal binding applies once to the combined proof, not per-axis.
  • The total work is the sum of per-axis work.

6.10 Openings (normative)

In addition to the Merkle roots, the prover MUST publish a re-roll nonce and, for each axis where movement occurs, an inclusion proof for the destination leaf and SIDESTEP_SAMPLES inclusion proofs at pseudorandomly sampled positions.

Each inclusion proof is a sequence of sibling hashes from leaf to root:

axis_proof = H_sibling_0 || H_sibling_1 || ... || H_sibling_{h-1}

Where H_sibling_i is the 32-byte sibling hash at depth i (leaf = depth 0). The verifier determines left/right ordering at each level from the leaf’s position in the subtree (deterministic from the leaf value).

The re-roll price. The sample positions are drawn from a 32-byte value G that costs work to obtain. With M_x, M_y, M_z the three per-axis roots (for a trivial axis, its single seeded leaf, §6.4) and nonce an unsigned 64-bit integer:

G = SHA256(SIDESTEP_GRIND_DOMAIN || be64(nonce) || previous_event_id || M_x || M_y || M_z)

be64(nonce) is the nonce as eight big-endian bytes. Let L be the total number of leaves over the axes where movement occurs, L = Σ 2^h with trivial axes contributing nothing, and let A = max(1, ceil(L / SIDESTEP_SAMPLES)). The prover MUST publish a nonce for which G, read as a 256-bit big-endian integer, satisfies G × A < 2^256. Each candidate nonce succeeds with probability 1/A, so finding one takes A attempts on average, and the verifier checks it with one hash.

Why this price (normative rationale). The preimage of G is 164 bytes, which SHA-256 processes as three 64-byte blocks, and the nonce sits in the first. No intermediate state therefore survives from one attempt to the next, and every attempt costs three compressions. A leaf costs one compression (§6.5) and its share of the internal nodes two more, so one attempt costs exactly one leaf’s share of the tree, and A attempts cost 1/SIDESTEP_SAMPLES of it. That is the smallest price at which trying again never pays (§6.11). The threshold is an integer comparison rather than a count of leading zero bits so that the price stays exact for multi-axis crossings, whose total leaf count is not a power of two.

Sample indices. For an axis with height h and axis_byte as in §6.4, the sampled positions are, for i in 0 .. SIDESTEP_SAMPLES - 1:

idx_i = int(SHA256(SIDESTEP_SAMPLE_DOMAIN || G || axis_byte || be32(i))) mod 2^h

be32(i) is i as four big-endian bytes. Indices are positions within the aligned subtree, so the sampled leaf value is base + idx_i. Indices MAY collide; implementations MUST NOT deduplicate, so that the opening count is fixed and the encoding in §8.5 is fixed-width.

Constants (normative):

SIDESTEP_GRIND_DOMAIN  = b"CYBERSPACE_SIDESTEP_GRIND_V1"
SIDESTEP_SAMPLE_DOMAIN = b"CYBERSPACE_SIDESTEP_SAMPLE_V2"
SIDESTEP_SAMPLES       = 8

Ordering. The openings for an axis are ordered: the destination proof first, then the sampled proofs in ascending i. Each is exactly h sibling hashes, so an axis contributes exactly (SIDESTEP_SAMPLES + 1) × h × 32 bytes.

Trivial axes (h = 0): no openings are published. The Merkle root IS the single leaf hash and there is nothing to sample.

Why sampling is required (normative rationale): The destination inclusion proof alone proves only that the destination leaf sits in some tree with the claimed root. It does not prove the tree was built over the aligned subtree, and it never did. A prover can fabricate h arbitrary sibling hashes, hash upward from the genuine destination leaf, and publish the result: h hash operations instead of 2^h, passing the destination check exactly.

Under the v1 unseeded construction this gap was survivable, because every honest root for a boundary was the same 32 bytes, so any party holding that root detected the forgery by comparison, and no rational prover forged when copying was free and correct. Seeding removes the copy, and with it removes comparison auditing: after §6.4 there is no canonical root to compare a claim against, and only a full O(2^h) recomputation would catch a fabricated tree. Seeding without sampling would therefore be strictly worse than the design it replaces. The two changes MUST ship together.

6.11 Verification levels

Sidestep verification has two levels, reflecting a trade-off between verification cost and trust assumptions:

Level 1: Sampled opening verification, O(SIDESTEP_SAMPLES × h) per axis

A verifier checks that the claimed openings are consistent with the claimed root and that the sampled leaves are the correct seeded values:

  1. Validate coordinates: source and destination are valid 256-bit Cyberspace coordinates.
  2. Validate crossing geometry per §6.3: on every axis where movement occurs, h = find_lca_height(v1, v2), the source touches the wall on its side (base + half - 1 going up, base + half going down), and the destination is exactly 1 Gibson past it; axes without movement have v1 == v2.
  3. Reconstruct seed_prefix from the event’s e previous tag and axis_byte per §6.4.
  4. Check the re-roll price: recompute G from previous_event_id, the three claimed roots and the event’s nonce per §6.10, and reject unless G × A < 2^256.
  5. Recompute the destination leaf hash H_dest = SHA256(seed_prefix || int_to_bytes_be_min(v_dest)) and verify its path to the claimed root M_axis.
  6. Derive the sample indices from G per §6.10. For each, recompute the sampled leaf hash SHA256(seed_prefix || int_to_bytes_be_min(base + idx_i)) from scratch and verify its path to M_axis.
  7. Recompute region_m, temporal axis, and proof_hash. Compare against claimed value.

Level 1 costs one hash for G, SIDESTEP_SAMPLES + 1 leaf hashes and the same number of paths, seconds at any height.

Level 2: Full root verification, O(2^h) per axis

To fully verify that the claimed Merkle root was computed over the correct aligned subtree, a verifier recomputes the entire Merkle tree from scratch. This costs the same order of work as the original proof.

Security model: The protocol does NOT require every verifier to perform Level 2. Security relies on deterministic fraud detectability: the Merkle root for an aligned subtree is a deterministic function of (previous_event_id, axis_byte, base, h), every one of which is public on the event itself, so a fraudulent root remains permanently and objectively detectable by any party willing to do the work. Seeding changes who bears the audit cost, not whether fraud is detectable. Under v1 an auditor could compute a boundary’s root once and check every crossing of it forever; under v2 each event must be audited on its own, which is why Level 1 was strengthened from a single destination path to sampled openings.

What sampling bounds (non-normative). A prover can skip work without touching any leaf it will be asked about. It builds only part of the tree honestly, puts 32 fabricated bytes where each missing subtree’s root belongs, and publishes the root that results. No sample landing inside a fabricated subtree can produce a valid path, because the verifier recomputes the sampled leaf from the public seed. A prover that honestly built a fraction f of the leaves therefore passes one set of samples with probability f^SIDESTEP_SAMPLES. What decides whether cheating pays is the price of trying again.

Version 2 of this construction drew the samples from M_axis alone, so a retry cost about h + 8 hashes: change one fabricated value, rehash the path above it, and derive new samples. The honest part stays cached and the fabricated part never has to exist, so a retry does not require rebuilding the tree, contrary to what this section said under version 2. Building only the half of the tree that holds the destination and retrying about 256 times passed Level 1 for half the honest work at h20, and fabricating more subtrees brought the cost down to 8.6 percent of the honest work at h40, 6.3 percent at h47 and 3.1 percent at h55.

The re-roll price of §6.10 closes this. Each fresh set of samples now costs A attempts, one eighth of the tree. Write W for the tree’s work and S for SIDESTEP_SAMPLES. A prover that honestly built a fraction f of the leaves needs f^(−S) sample sets on average, so its expected cost is f·W + f^(−S)·W/S, against the honest W + W/S. The difference is W·u(f) with u(f) = (f^(−S) − 1)/S − (1 − f). Since u(1) = 0 and u′(f) = 1 − f^(−(S+1)) ≤ 0 on (0, 1], u(f) ≥ 0 for every f: no fraction of skipped work lowers the expected cost of an accepted proof. The price is also the smallest that achieves this. With any cheaper retry, skipping a small fraction ε of the leaves saves ε·W and costs about ε·S extra retries, which is a net gain whenever a retry costs less than W/S.

The honest prover pays the price once, so a crossing costs one eighth more than its tree. The half-tree forgery above, run against sidestep-reference.py, now costs about 29 times the honest crossing on average.

Why 8 samples (non-normative). With the price at W/S, the sample count no longer decides whether cheating pays. It decides the honest overhead, 1/S of the tree, and the size of the openings (§6.14). Sixteen samples would halve the overhead to 6.25 percent but double every mp tag, which would push three-axis crossings above h47 past common relay event limits. Eight keeps the openings exactly as they were.

In practice, Level 1 is for routine validation. Level 2 is for auditors, competitors, or automated fraud-detection services.

Small heights (non-normative). Level 1 costs about (SIDESTEP_SAMPLES + 1) × (h + 1) hash operations and Level 2 costs 2^(h+1) - 1, so the two cross over near h5. Below that, a verifier SHOULD simply perform Level 2, which is both cheaper and complete. Provers still publish the full opening set at every height, so that the mp encoding of §8.5 stays fixed-width.

6.12 Entering ≠ claiming (non-normative)

The sidestep Merkle tree is built over SHA-256 hashes of leaf coordinates. The Cantor pairing tree over those same leaves produces a completely different value. Computing the Merkle root reveals nothing about the Cantor root.

This preserves a critical separation: sidestepping into a region does not yield the region’s keys. The region’s Cantor root, and with it every location-based key inside the region (§7), still requires the full Cantor computation. A visitor who sidesteps through a wall has proven they spent the computational time to cross it, but they hold none of the keys to the space. You can walk into a building without having the keys.

This is desirable: it creates a natural asymmetry between those who hold a region (who have invested in Cantor computation and keep its keys, §7.8) and visitors (who have done the minimum work to cross the boundary). Holding is a capability, not a title: anyone who does the work holds the same keys, and no one is excluded. There are no domains in the base protocol; RATIONALE.md §6 says what holding does and does not buy, and docs/territory-conflict-game-layer.md records the design decision.

A crossing cannot be sold; a root can (non-normative). After §6.4 the two primitives are priced on opposite principles, deliberately.

A sidestep is a toll on an edge. Its proof is seeded to one chain position, so it is worth nothing to anyone else. There is no market in crossings, no pioneer subsidising later travellers, and no way to buy a wall crossing except by paying for it yourself.

A hop is a canonical price on a cell. Its work product is the region root of §4.6, whose hash is the region key of §7.2, and the one property that makes region keys work at all is canonical convergence (§4.9, property 4): two parties at the same place derive the same key without meeting. That property is what makes a key issuer-free, and it cannot survive seeding. A consequence is that an identity handed a region root can produce a hop across the corresponding boundary for the cost of the temporal axis alone, roughly 100 ms, at any height.

This is not an oversight and it is not a road in the sense §6.4 forbids. A region root is disclosed only when a holder chooses to disclose it, one recipient at a time, and that disclosure is exactly the act the protocol is built to support: handing someone the key to a place. The v1 sidestep published the equivalent to the whole world automatically, as a side effect of one traveller moving, with nobody choosing anything. Movement is priced; disclosure is a social act.

How much a handed root is worth, measured (non-normative). Less than it sounds, and the reason is worth stating because it decides what businesses are possible here (docs/what-can-be-sold.md).

A hop is four stages: build three axis trees, combine them into region_n, compute the temporal axis cantor_t, then bind and hash. A recipient skips only the first. What remains is not cheap, because a root at height h is a number of 85 × 2^h bits, and the combine multiplies numbers of that size: region_n is about four times an axis root and hop_n about eight times. The three pairings that remain are the three largest operations in the whole computation, and the millions of tiny pairings at the bottom of a tree, which are what the recipient was spared, are nearly free.

Measured, building a tree and then combining: a recipient handed all three axis roots saves about 19% of the work, stable across heights (19.7% at h12, 19.2% at h14, 19.0% at h16), and less than that with faster multiplication. The remainder is Θ(2^h) and includes cantor_t, which is derived from the recipient’s own previous_event_id (§5.3) and is therefore per traveller: it cannot be precomputed by a discloser, shared between recipients, or reused on a second hop.

So a handed root is a real saving on a real cost, not a bypass. A recipient still needs hardware of the discloser’s class to use one at all, since region_n at h47 is on the order of petabytes. This does not close the market in computation, only the market in reusable answers. Anyone may be paid to perform a traveller’s own work for them, and §6.4’s seeding is what keeps that market honest: because nothing can be resold, no operator can compute the world once and rent the archive forever.

6.13 Natural continents (non-normative)

The combination of Cantor hops and Merkle sidesteps creates emergent geography in the coordinate space:

  • h ≤ ~20: Crossable by hop (Cantor) on consumer hardware in milliseconds to seconds. Above this the Merkle sidestep is faster at every height and is the practical movement primitive.
  • h20–50: Crossable by sidestep on consumer hardware (seconds to days on a GPU).
  • h50–58: Crossable by sidestep with a rented-GPU budget of roughly $20 to $3,000.
  • h60+: Not crossable by consumer computation. Crossable by ASIC-scale hash work (a 1 EH/s farm crosses h78 in about a week; a Bitcoin-scale fleet crosses h85 in about a day). Hyperspace (DECK-0001) is the consumer route.

These prices are per traveller and per crossing. Because §6.4 seeds every sidestep tree to its mover’s chain position, a boundary that costs three GPU hours costs three GPU hours for the first identity to cross it and three GPU hours for the ten thousandth. The continents below are therefore a description of the space as every agent actually experiences it, rather than a description of what the first arrival paid.

Nobody designed these continents. They emerge from the interaction between the Cantor pairing function, SHA-256, and the physical limits of computation and storage. Different agents experience different continental boundaries depending on their hardware and patience. There is no single universal map of “passable” and “impassable” walls.

No arbitrary ceiling is designed. The boundary emerges from thermodynamics.

6.14 Performance expectations (non-normative)

Sidestep cost is dominated by SHA-256 leaf hashing and is fixed-size per leaf. Hop cost grows faster than 2× per height because the Cantor operands double in size as well as in count. Measured in the reference implementation (pure Python, same language for both): h14 hop 12 ms vs sidestep 27 ms; h16 100 ms vs 100 ms; h18 720 ms vs 270 ms; h20 6.6 s vs 1.1 s. Above roughly h16 the sidestep wins and its advantage widens by about 1.5× per height; a compiled bignum library is 5 to 10× faster for hops, and SHA-NI or a GPU is 50 to 10,000× faster for sidesteps, so the ordering only sharpens in optimized code.

LCA HeightHop (Cantor)Sidestep (1 CPU core, 10⁸ H/s)Sidestep (1 GPU, 2×10¹⁰ H/s)Notes
h14~10 ms0.3 ms1.5 μseither
h20~6 s21 ms0.1 mssidestep
h30~days (11 GB root)21 s0.1 ssidestep
h34~a day (182 GB root)6 min1.6 ssidestep; hop only when the region root itself is wanted
h40not feasible (12 TB)6 h100 ssidestep
h50not feasible (12 PB)261 d28 hsidestep
h55not feasible23 y38 dsidestep, ~$700 of rented GPU
h60not feasible (12 EB)731 y3.3 yASIC-class hash work
h85not feasible2.5×10¹⁰ y1.1×10⁸ yBitcoin-scale ASIC fleet: about a day

The practical consumer sidestep ceiling is about h55 per axis for a thousand dollars of rented GPU time. Sidestep work is plain SHA-256 over short preimages and is therefore subject to ASIC acceleration; the storage bound of §13.2 applies to Cantor roots, not to travel. Beyond consumer reach, hyperspace (DECK-0001) is the route.

Every figure in this table is now what each traveller pays on each crossing, and none of it can be prepared in advance (§6.7). Each figure is the tree alone; the re-roll price of §6.10 adds one eighth to it. The openings of §6.10 cost (SIDESTEP_SAMPLES + 1) × h × 32 bytes per non-trivial axis, which the mp tag carries as hex and so doubles: about 11 KB of tag text at h20, 23 KB at h40, and 26 KB at h47 for a single-axis crossing. A three-axis crossing at h47 approaches 80 KB and at h55 approaches 93 KB. The mn tag of §8.5 adds 16 characters. Implementations SHOULD confirm their relays’ event size limits before attempting multi-axis crossings above h40.

6.15 Version 2 of the sidestep construction (normative)

The seeding of §6.4, the axis separation of §6.4, and the sampled openings of §6.10 are a breaking change to sidestep verification. They were adopted together because seeding without sampling is strictly worse than the construction it replaces (§6.10).

  • SIDESTEP_DOMAIN is bumped from CYBERSPACE_SIDESTEP_V1 to CYBERSPACE_SIDESTEP_V2, so no v1 proof can be mistaken for a v2 proof or collide with one.
  • Verifiers implementing this revision MUST reject sidestep events built under the v1 construction. There is no grace period and no dual-acceptance mode: accepting v1 proofs would keep the pioneer-priced path open, which is the entire defect being repaired.
  • Chains containing a v1 sidestep are invalidated from that event forward and must respawn. At adoption this affected three events published by two identities, all single-axis crossings at h19 and h20, which is why no migration path was specified.

Implementations of the base protocol prior to this revision computed leaves as SHA256(b"CYBERSPACE_SIDESTEP_V1" || leaf_bytes) with no seed and no axis separation, and published a single destination inclusion path. Those proofs are recognisable by their mp tag carrying exactly one path per axis rather than SIDESTEP_SAMPLES + 1.

Porting hazard: which leaf the path covers. v1 implementations diverged on this and the spec was not the tie-breaker it should have been. §6.10 and §8.7.2 have always specified the destination leaf, and that is what the two TypeScript ports and every sidestep so far published to a public relay actually use. The Python reference implementation named in §14 instead collected the path for leaf 0, the base of the aligned subtree, so its inclusion verifier rejects conforming events and accepts its own. Because the choice never entered region_m, it never affected proof_hash, which is why the divergence survived: the events verified at the proof level while their mp tags were mutually unreadable.

Implementations porting to v2 MUST use destination-leaf semantics for the first opening. The sampled openings make any remaining divergence self-correcting, since a verifier built on the wrong convention fails the sampled paths as well as the destination path, rather than silently ignoring both.

6.16 Version 3 of the sidestep construction (normative)

The re-roll price of §6.10 is a breaking change to sidestep verification. The tree, its seeded leaves and its roots are unchanged, so every golden root vector of sidestep-reference.py carries over. What changes is where the sample positions come from.

  • SIDESTEP_SAMPLE_DOMAIN is bumped from CYBERSPACE_SIDESTEP_SAMPLE_V1 to CYBERSPACE_SIDESTEP_SAMPLE_V2, because its preimage now takes G in place of M_axis, and SIDESTEP_GRIND_DOMAIN is new.
  • Sidestep events MUST carry the mn tag of §8.5. Verifiers MUST reject a sidestep without one, or whose nonce does not meet the price.
  • Verifiers implementing this revision MUST reject sidestep events built under version 2, with one exception: the version 2 sidesteps listed in grandfathered-v2-sidesteps.txt. There is no grace period and no dual-acceptance mode for anything not on that list, because accepting version 2 proofs would keep open the forgery described in §6.11.
  • The list names, by event id, every version 2 sidestep published before the reference clients began publishing version 3, and each listed event was audited at Level 2 (every tree rebuilt from its seed and compared with its mr roots, and its proof_hash recomputed) before it was listed. A verifier MUST accept a listed event’s Merkle roots and openings without re-checking them, and MUST check everything else about it exactly as for any other sidestep: chain linkage, geometry and proof_hash. No chain is invalidated by this revision and no identity has to respawn.
  • A version 2 sidestep that is not on the list is invalid, and so is the chain from that event forward. Event ids cannot be forged, so the list cannot be joined after the fact, as a date cutoff could be by backdating created_at.
  • Each non-empty line of grandfathered-v2-sidesteps.txt that does not begin with # starts with a 64-character lowercase hex event id; anything after the id on the same line is commentary.

Version 2 proofs are recognisable by the absence of the mn tag. Version 1 sidesteps remain invalid under §6.15.


7. Location-Based Encryption and Discovery

7.1 The purpose: chalk on the sidewalk (non-normative)

The purpose of location-based encryption is not primarily secrecy. There are better cryptographic systems for secure communication. The purpose is to model traversable reality.

Consider a message written in chalk on a sidewalk:

  • It is not “encrypted” in any technical sense
  • Anyone who walks by can read it
  • But you cannot read it without walking there
  • Even if someone tells you about it, they had to walk there to know

This is location-gated access that requires no keys, no permissions, no infrastructure. Only presence.

Cyberspace implements this using region-derived keys. A ciphertext can be published publicly on Nostr, but deriving the decryption key requires computing the region preimage, which is the Cantor root for that spatial region. The work required is the same whether you traveled there via a movement chain or computed the region directly for an arbitrary coordinate. There is no free surveillance. Looking and walking cost the same.

7.2 Key derivation (normative)

Given a spatial region integer region_n (the 3D region identifier from §4.7 for some aligned region):

  • region_bytes = int_to_bytes_be_min(region_n)
  • location_decryption_key = sha256(region_bytes)
  • lookup_id = sha256(location_decryption_key)

Why two layers: Seeing lookup_id (which is published to help people find the content) does not allow deriving location_decryption_key without the region preimage. The lookup ID is safe to publish; the decryption key requires work.

Note (non-normative): the temporal axis used for hop proofs (§5) is intentionally not included here. Location-based identifiers and keys remain a stable function of spatial regions. They do not change when someone moves through.

Outputs are 32-byte digests. When used in Nostr tags, they MUST be lowercase hex.

7.3 Discovery radius (non-normative)

Cantor subtree roots represent aligned regions. Choosing a subtree height implicitly chooses a discovery radius: how large an area the encrypted content is visible from.

At the Cantor Height 34 scale (2 meters per height-34 subtree), approximate physical scales are:

HeightLeaves (per axis)Physical scaleMetaphor
01~10⁻¹⁰ mAtomic precision
101,024~0.1 μmMicroscopic
20~10⁶~0.1 mmGrain of sand
30~10⁹~0.1 mHand-span
34~1.7×10¹⁰2 mHuman height (canonical)
40~10¹²128 mCity block
50~10¹⁵131 kmCity region

A local secret at height 34 is discoverable within ~2 meters. At height 50, from anywhere in a city.

Important caveat: Discovery requires equivalent computation to secret creation. Typical scanning range is between height 0 and 16 for sub-second continuous scanning on average consumer hardware. Secrets at larger regions may be unattainable without some hint to help users scan up to their height. §7.7 defines hints: the hider MAY publish the aligned box a bag lies in, one height per axis, so a seeker sweeps the box instead of the space. As hardware improves, passive scanning range will grow and larger secret regions will become attainable.

The discovery radius grows exponentially with height, enabling a natural hierarchy of public, neighborhood, and intimate spatial messages.

At a coordinate (x,y,z) you may scan nearby region keys by selecting heights h = 1..H and computing the aligned subtree base per axis:

  • bx = (x >> h) << h
  • by = (y >> h) << h
  • bz = (z >> h) << h

For each h, compute per-axis subtree Cantor roots:

  • rx = compute_subtree_cantor(bx, h)
  • ry = compute_subtree_cantor(by, h)
  • rz = compute_subtree_cantor(bz, h)

Combine to a 3D region integer:

  • region_n = π(π(rx, ry), rz)

Then derive lookup_id per §7.2.

Implementations SHOULD cap H for interactive use and may cache values; higher subtrees change less frequently.

7.5 Caching optimization (non-normative)

When moving, many higher subtrees do not change between positions. This provides a significant optimization for applications that scan multiple discovery radii.

Boundary crossing principle: An aligned subtree of height h changes only if you cross a boundary at that height.

Example (1D): Moving from position 7 to position 8:

Height  Base (at pos 7)  Base (at pos 8)  Changed?
-------  ----------------  ----------------  --------
   0           7                 8           YES (boundary at 8)
   1           6                 8           YES (boundary at 8)
   2           4                 8           YES (boundary at 8)
   3           0                 8           YES (boundary at 8)
   4           0                 0           NO  (same [0..15])
   5           0                 0           NO  (same [0..31])
   ...         ...               ...         NO

Heights 4 and above are unchanged. Position 7 and 8 share the same base for h≥4.

Boundary detection:

def subtree_changes(v1: int, v2: int, h: int) -> bool:
    return (v1 >> h) != (v2 >> h)

When (v1 >> h) == (v2 >> h), both positions lie in the same aligned subtree, so the cached region key remains valid.

Implementation strategy:

region_cache = {}  # height -> (base, region_key)

def get_region_key(x, y, z, h):
    bx = (x >> h) << h
    by = (y >> h) << h
    bz = (z >> h) << h

    if h in region_cache:
        cached_base, cached_key = region_cache[h]
        if (bx, by, bz) == cached_base:
            return cached_key  # Cache hit

    # Cache miss: compute and store
    region_key = compute_region_key(bx, by, bz, h)
    region_cache[h] = ((bx, by, bz), region_key)
    return region_key

Performance implications:

  • Small moves: most heights remain cached; only recompute low heights
  • Large moves: more heights change, but high heights often remain the same
  • Continuous scanning: avoid recomputing all 50+ region keys on every position update

Note: this caching optimization applies to spatial region computations for discovery. Hop proofs still require computing the temporal axis root per §5 on every hop.

7.6 The bag (normative)

Content hidden at a place is published as a bag. A bag is one Nostr event of kind 33330 (event format in §8.6) whose payload is encrypted with the key of one region at one height (§7.2), and it holds everything its author has hidden in that region at that height. Anyone can fetch a bag from a relay, because the ciphertext is public. Only someone who has computed the region’s key can open it, whether they computed it by moving into the region or by deriving it for the coordinate directly (§7.1). The bag is addressable by its lookup_id, so a relay keeps only the newest bag per author and region, and the author changes what is hidden there by publishing a newer bag.

Height (normative): the region’s height MUST be at least 1. A height-0 region is a single Gibson, and height 0 is the one case in which a root does not identify its height (§4.6); discovery scanning starts at height 1 (§7.4). A bag whose height tag (§8.6) states 0 MUST be rejected.

Cipher (normative):

  • key: the location_decryption_key of §7.2 (32 bytes)
  • cipher: AES-256-GCM with a 12-byte nonce and a 16-byte tag, no additional authenticated data
  • the nonce MUST be fresh for every encryption
  • payload = nonce || ciphertext || tag, encoded as base64 (standard alphabet, padded)

A reader without the region key cannot decrypt the payload. An attempt with the wrong key fails at the GCM tag check and reveals nothing about the plaintext. A failed decryption therefore means only that the reader does not hold this region’s key; it MUST NOT be treated as an error in the bag.

Plaintext (normative):

The plaintext is arbitrary bytes. The protocol places no requirement on it beyond the two shapes below, which tell a reader how to interpret what it has decrypted:

  • A list of entries: a JSON array. Each element is either an item, a JSON object that is a nostr event carried inline, signed or unsigned, or a reference, a JSON array that is a tag naming an event published elsewhere. The JSON type tells them apart. Readers MUST try this shape first, because a list of entries is the shape clients render entry by entry. An element that is neither an event nor a reference is skipped.
  • Opaque: anything that is not a list of entries, such as a text note or a file. Its interpretation is application-defined; a client may show it as text or offer it as a download.

Items (normative):

  • An item is a nostr event. It MAY be signed. If it carries a sig, its id MUST be the canonical id (§8.2) and the signature MUST verify; a reader MUST drop an item that fails either check, and only that item, because one corrupt or forged item says nothing about the others. An item without a sig is allowed, because some content is deliberately left unsigned; its pubkey is then a claim, and readers MUST NOT present it as verified, unless it is a rumor that the bag vouches for (Rumors, below).
  • The bag’s pubkey is the key that placed the items in the region. Readers MUST attribute placement to the bag’s author, and MUST attribute authorship of an item’s content to the item’s pubkey only when the item is signed or is a rumor that the bag vouches for. A signed item written by one key and hidden by another is therefore shown as that author’s content, placed here by the hider.
  • An item MAY carry a C tag: ["C", "<coord_hex>"], its exact coordinate (§2), which lets a client render it at a point rather than somewhere in the region. If present, the coordinate MUST lie inside the region the bag is encrypted to: the same plane, and equal to the region’s base above height h. Readers MAY drop an item whose C lies outside, because such an item claims a place its key does not cover. Without a C tag, an item is located no more precisely than the region.
  • A reader that does not understand an item’s kind skips it and renders the rest.

Rumors (normative):

A rumor is an item that carries an id and no signature: no sig field, or a sig that is the empty string. The term is NIP-59’s, for the unsigned event that NIP-17 carries as a kind 14 inside its seal. A writer MUST set a rumor’s id to the canonical id (§8.2) of its own pubkey, created_at, kind, tags and content, and MUST set its pubkey to the key that signs the bag, or the item, that holds it. An item whose sig is any other value is a signed item, and its signature MUST verify as above.

  • A rumor whose pubkey is the bag’s pubkey and whose id is canonical is vouched for by the bag. A reader that keeps it MUST attribute its content to the bag’s author, and MAY present that authorship as verified. Reason: the bag’s signature covers its encrypted payload, and under the region key that payload decrypts to exactly one plaintext, in which this rumor’s pubkey is the bag’s own.
  • A rumor whose id is not canonical is not vouched for by anyone. A reader MUST NOT present its author as verified; it MAY drop it, or read it as an unsigned item identified by its canonical id.
  • A rumor whose pubkey is not the bag’s pubkey is an unsigned item like any other, and its pubkey is a claim.
  • Inside an item: some items carry a list of entries of their own, encrypted in their content; a chest (kind 3341) is one, a list of entries sealed to a public key. A rumor inside such an item is vouched for by that item when three things hold: the rumor’s pubkey equals the item’s pubkey, the rumor’s id is canonical, and the item’s own authorship is verified, because it is signed and its signature verifies, or because it is itself a rumor vouched for in the same way. The item’s signature covers its content, which decrypts to exactly one list. This applies at every depth. Any other rumor inside such an item has a pubkey that is a claim.
  • Messages: a message, a kind 1 item with its text in content, MUST be written as a rumor. A writer MUST NOT sign a message it hides, whether it hides it in a bag or inside another item. A reader MUST still accept a signed message whose signature verifies, because messages written before 2026-10-20 are signed.
  • Hidden audio: a kind 1063 item, a NIP-94 file event naming an encrypted file and carrying its key (DECK-0007), MUST be written as a rumor, for the same reason as a message (DECK-0007 §3). A writer MUST NOT sign hidden audio it hides, in a bag or inside another item. A reader MUST still accept a signed one whose signature verifies.
  • Every other kind: a writer SHOULD sign every item that is not a message or hidden audio, because a shard, a key item or a chest can be taken from one place and seen in another, where only its own signature says who made it. Since writers write only messages and hidden audio as rumors, a reader MAY drop a rumor of any other kind, or read it as an unsigned item whose pubkey is a claim.

Note (non-normative): a bag is rewritten whole (Lifecycle, below), and its author’s client carries every existing entry forward as it is. A message hidden before 2026-10-20 therefore stays signed until its hider removes it or hides it again. Writing it again as a rumor would change its id, which is what comments and reactions on it name.

Protected items (normative):

  • A writer MUST add NIP-70’s protected tag, ["-"], to every item it signs or writes as a rumor into a bag or into another item: a shard (3330), a message (1), a key item (3340, an item that is a keypair), a chest (3341) and hidden audio (1063, DECK-0007). A relay that honours NIP-70 accepts an event that carries - only from its author, after NIP-42 authentication, so a finder who copies an item out of a bag cannot republish it to such a relay under the hider’s name. An item signed by another key, which a writer places as it is (Items, above), is carried unchanged, because adding a tag to it would break its signature.
  • A writer MUST NOT add - to the bag itself (§8.6) or to a referenced event (References, below). Both are published on their own, and NIP-70 makes refusing an event that carries - a relay’s default behaviour (a relay accepts one only from its authenticated author, and only if it chooses to), so a protected bag or a protected referenced event would reach fewer relays.
  • A reader MUST NOT reject a reference because the event it names carries -. The author of a public object may add - to it; others can still place it by reference, but no one else can republish the object itself to a relay that honours NIP-70, so a client that would copy it onto its own relays places an object of its own instead, signed by its own key and crediting the original (DECK-0003).
  • A reader MUST NOT drop an item for carrying - or for lacking it. Shards, messages and chests written before 2026-10-20 lack it; key items have carried it since they were introduced.

Why messages are rumors and items are protected (non-normative): a finder who opens a bag holds every item in it as JSON. A signed kind 1 message lifted out of the bag is a valid public note: published anywhere, it shows as a note its hider wrote, with the exact coordinate of the hiding place in its C tag. A rumor is not a valid event, so no relay or client accepts a copy of it as the hider’s note, while the bag, which the hider does sign, still tells everyone who reached the place who left the message. Chat lines (kind 23333 inside a kind 23330 envelope) have been written this way since 2026-10-13. Hidden audio (kind 1063) has been since it was introduced on 2026-10-23: a signed copy would show in feed clients as the hider’s own file post, playable by anyone, since its key is in the event (DECK-0007 §3). Shards, key items and chests stay signed, because their own signature is the only proof of who made them once they are taken elsewhere. The - tag asks relays to refuse a copy of one of them republished by anyone but its author; a relay that does not honour NIP-70 still accepts such a copy, with its exact C coordinate. On a message the - tag is redundant, since a rumor cannot be published as a valid event at all; it is there so that every item follows one rule. Neither measure gives deniability: whoever publishes the bag together with its region key can still show what it contained, signed by its author. They prevent a finder from publishing one item, alone, as a valid event under the hider’s key.

References (normative):

A reference hides an event that is published on its own, so that the bag stays small and the referenced event has an id and an address of its own. It is one of two tags, in the shape NIP-01 gives them, with the entry’s exact coordinate as an optional fourth element:

  • ["a", "<kind>:<pubkey>:<d>", "<relay hint>", "<coord_hex>"] names the event by its coordinate: its own kind, its author and its d tag. A reader fetches the newest event at that coordinate, so the reference follows its author’s edits.
  • ["e", "<event_id>", "<relay hint>", "<coord_hex>"] names one event by its id. It is for events of a regular kind, which relays keep. It does not pin a version of an addressable event: NIP-01 lets a relay keep only the newest event at an address and discard the one it replaces, so an e reference to an addressable event stops resolving once its author publishes over it. Name an addressable event by its coordinate.

The rules:

  • The referenced event MAY be of any kind. Its kind is the kind in the a coordinate, or the kind of the event the e id names; nothing in the bag restates it.
  • The relay hint MAY be the empty string. <coord_hex> is the entry’s exact coordinate and follows the rules of the C tag above: it MUST lie inside the bag’s region, and a reader MAY drop a reference whose coordinate lies outside. It MAY be omitted, in which case the entry is located no more precisely than the region.
  • The referenced event is a partially encrypted event in the shape of Fanfares’ NIP FF-1: its content is a public preview for readers who cannot open it, and it carries exactly one ["encrypted", "aes-256-gcm", "<payload>", "cyberspace:region"] tag. The payload is the event’s hidden content, encrypted with this bag’s region key under the cipher above. The fourth element, cyberspace:region, stands where FF-1 puts a key service URL and says that the key is derived from a place rather than issued: a reader MUST NOT make a network request for it. The event carries a d tag, as FF-1 gives every partially encrypted event whatever its kind, which is what gives every referenced event a coordinate.
  • The referenced event MUST carry nothing that says where it is: no C, no height tag (H, or the h of §8.6), no hint and no sector tag. Those belong to the bag, which is what the region key protects. The event is a locked box in plain view; the bag is the note that says where the box stands.
  • Whoever opened the bag opens every event it references, with the key already in hand, and a reader that has not opened the bag can open none of them. What the decrypted payload means is defined by the referenced event’s kind; DECK-0003 §3.2 and §3.4 define it for objects.
  • The referenced event is published, so it is signed like any other event, and a reader MUST verify it as usual. Placement is attributed to the bag’s author, and authorship of the referenced content to the referenced event’s pubkey, which MAY differ from the bag’s: placing another author’s event is a placement.
  • A reference that cannot be fetched, or whose payload does not open with this bag’s key, is a missing entry. A reader drops it and SHOULD say that something was found but could not be retrieved, rather than that nothing was found.

Why a reference is a tag and not an item (non-normative). An item that only pointed elsewhere would repeat what the reference already says: its kind is in the coordinate, its author and time are the bag’s, and its content would be empty. What must survive is the pointer and the exact coordinate, and a tag carries both. Measured on an object reference, the item form is 304 bytes of JSON and the tag form 162, which matters because size is the reason references exist. NIP-51 lists already encrypt their private entries as a JSON array of tags, so the shape is familiar.

Note (non-normative): kinds in use. ONOSENDAI hides five kinds: 3330, a shard (geometry in content, the kind carried over from v1), 1, a message (text in content), 3340 and 3341, an item and a chest (DECK-0004), and 1063, hidden audio (DECK-0007). All carry a C tag and NIP-70’s - (Protected items, above), and a message and hidden audio are written as rumors (Rumors, above). Local chat uses the same envelope in the ephemeral range (DECK-0005), and comments on hidden things are sealed to the same key (DECK-0006). New kinds need no change to this section: the container is the same, and a client that does not know a kind skips it. A large object is hidden by reference instead, as its own kind 33331 event (DECK-0003 §3.2).

Why one bag per region (non-normative): d is the lookup id, so there is exactly one bag per author, region and height, and it is addressable. A region accumulates content by rewriting its bag: the author decrypts the current bag, adds or removes items, and publishes the whole list again. This costs one event per change instead of one event per item, and it keeps the relay ignorant: a relay sees one ciphertext per region and never learns how many items the bag holds or what kinds they are.

Lifecycle (normative):

  • To add or remove an entry, the author republishes the bag with the new list and a created_at strictly greater than the previous bag’s, because relays keep the newest addressable event and readers MUST do the same.
  • To remove the last entry, the author publishes a NIP-09 deletion (kind = 5) with ["e", "<bag_event_id>"] and ["k", "33330"]. An empty bag would still occupy the region’s slot on the relay, so a bag holding a list of zero entries MUST NOT be published.

Note (non-normative): the reference CLI’s encrypt writes opaque plaintext (a text or a file); ONOSENDAI writes a list of entries. Both conform to this section, and each can open what the other publishes.

7.7 Hints (optional)

A bag is a cache of data encrypted by a region key at a height (§7.6) and it reveals nothing about where it is. Its lookup_id is a hash of a hash (§7.2), and discovery scanning (§7.4) reaches only a few heights around the scanner. Without more information, a bag is found only by intentionally deep scanning and/or wandering. With no additional information, any given bag is equally likely to be at any point in the full 2^256 coordinate space: an impossibly hardened secret.

A hint is the hider’s clue as to where the bag is. It is optional, public, and as coarse as the hider wants: the aligned box the bag’s region lies in, one height per axis, on one plane. The hint box is scalable along each axis; the bag is somewhere within the box. A seeker simply sweeps the box to find the secret, and the hider scales the hint to achieve the desired difficulty.

The hinted box (normative):

  • Hx, Hy, Hz: integers in [0, 85], the hint heights
  • bx = (x >> Hx) << Hx, by = (y >> Hy) << Hy, bz = (z >> Hz) << Hz: the aligned bases
  • the box is [bx, bx + 2^Hx) × [by, by + 2^Hy) × [bz, bz + 2^Hz) on plane P

In this section H stands for any one of the hint heights Hx, Hy and Hz. It is a number, not the bag’s H tag (§8.6). The bag’s own height, which that tag states, is the number h.

A height of 85 leaves an axis open: the base is 0, the box spans the whole axis, and the hint says nothing about that coordinate. Equal heights make a cube. Unequal heights make a slab or a column; an exact axis (height equal to the bag’s) with two coarse axes turns the search into two dimensions. Heights of 30 on all three axes name exactly one sector (§10).

The hint tag (normative):

["hint", "<coord_hex>", "<Hx>", "<Hy>", "<Hz>"]

  • coord_hex: the 256-bit coordinate of the box’s base (bx, by, bz, P), encoded per §2.2, 32-byte lowercase hex. It MUST be the aligned base: the low H bits of each axis MUST be zero, and an axis with H = 85 MUST be 0. Requiring the base means every hider who hints the same box publishes the same tag, so readers can compare hints by equality.
  • Hx, Hy, Hz: decimal strings, no sign, no leading zeros except "0" (the rules of §10).
  • A bag MUST carry at most one hint tag.

What a hint claims (normative):

The bag’s region (the aligned cube of height h, where h is the height the bag’s height tag states, §8.6) lies inside the box, on plane P. Because both the region and the box are aligned, containment is two checks per axis: H >= h, and the region’s base equals the box’s base after both are shifted right by H. When the bag states its height, each hint height MUST therefore be at least h; a box smaller than the region could not contain it. Three heights equal to h name the region itself: the hint is then a destination the seeker can compute or walk to directly, not a search.

Sector tags (normative):

A hint fixes the sector on every axis with H <= 30, because the sector index is the axis value shifted right by 30 (§10) and the hint fixes every bit above H. For each such axis the bag MUST carry that axis’s sector tag (X, Y or Z), computed from the box’s base. When all three are fixed, the bag MUST carry S. An axis with H > 30 gets no sector tag, because its sector is not determined. A bag without a hint MUST NOT carry sector tags, because on a bag they are derived from the hint and would otherwise leak a location the hider did not choose to publish.

Malformed hints (normative):

A hint tag that breaks any rule above MUST be treated as absent, meaning the bag is read as if it carried no hint: wrong arity, bad hex, a base that is not aligned, a height outside [0, 85], a non-canonical integer, or a height below h. Sector tags that disagree with the hint MUST be ignored. A bad hint never invalidates the bag, because hints are advisory metadata about where to look; whether a bag is valid is decided by §7.2 and §7.6 alone.

Why the hint is a knob (non-normative):

A seeker who trusts a hint sweeps the box: for every candidate region of height h inside it, derive the region key (§7.2), compute its lookup_id, and check the relay for a bag with that d tag (one batched query can carry many lookup ids). The number of candidates is 2^((Hx - h) + (Hy - h) + (Hz - h)), the product of the choices on each axis. The seeker’s own position never enters this cost, because §7.1 makes looking and walking equivalent: a region key can be computed for any coordinate without traveling there. The gap between hint height and bag height, summed over the three axes, is therefore the price of the search, and the hider sets it when publishing the hint.

Total gapCandidatesSingle core, bag at height 8 or below
01a destination
124,096seconds
18262,144minutes
2416.7 millionhours
30 or morea billion or moredays to never

The times in the table assume the key cost measured on 2026-09-01 on one desktop core: about 0.05 ms per key at heights 0 to 4, 1.3 ms at height 8, 30 ms at height 12 and 816 ms at height 16. Because a key at a greater height costs more to derive, the same gap takes longer for a bag hidden at a greater height. A sector-only hint (H = 30 on every axis) on a bag at height 5 is a gap of 75, about 2^75 candidates, which no one will sweep; such a hint tells a seeker where to travel, not where to search.

Reading is not reaching (non-normative):

Anyone who does the work of deriving the key can read the bag from anywhere; reading has no distance term. Being inside the region is a separate fact: it costs the movement work of §4 to §6 to get there, and only a movement chain whose head lies inside the region proves it (§8). An application that rewards finding a bag has to say which of the two it rewards, reading or reaching. How a find is proven in public is left to applications and DECKs (§8.9).

A hint is a claim (non-normative):

Nothing in the protocol verifies a hint until the bag is found and its region is compared with the box. A false hint wastes the seeker’s work, and the protocol does not punish it. Applications should weigh a hint by the reputation of the key that published it, as they would any other unverified claim.

Riddles (non-normative):

The bag’s content field MAY hold a plaintext hint written for humans, a riddle (§8.6). A riddle can stand alone or accompany a geometric hint. The protocol does not read it; it is for the seeker to interpret.

Golden vectors:

Produced and checked by hint-reference.py. Points are 256-bit coordinates per §2.2 (32 bytes of hex). london is the §9.8 golden vector.

VectorPoint (plane)Bag hHeightshint coordinateSector tagsCandidates
london_h5_box11london (0)511, 11, 11c492492492492492492492edf5bee7267451c787d95ba4d7840c76d000000000X 18014398541305938, Y 18014398549232983, Z 18014398509410999, S 18014398541305938-18014398549232983-180143985094109992^18
london_h5_x_exactlondon (0)55, 14, 14c492492492492492492492edf5bee7267451c787d95ba4d7840c749041240000same as above2^18
ideaspace_h8_y_opena4b64924924924924924924924924924924924924924924924924d84b60d9c8f (1)812, 40, 12a4b64924924924924924924924924924924924924924924924924d8000000001X 18014398509481984, Z 36028797018963967, no Y, no S2^40

The ideaspace point is x = 2^84 + 12345, y = 3 · 2^80 + 777, z = 2^85 - 1 - 4242 on plane 1. The second vector is a two-dimensional hunt: X is exact, so the seeker sweeps a 2^9 by 2^9 slab of height-5 regions. The third has an open axis: Hy = 40 leaves the Y sector undetermined, so the bag carries X and Z but neither Y nor S, and the sweep is 2^40 candidates, far beyond any search; that hint tells the seeker where to travel.

Contents (optional):

A bag MAY say in public what it holds, by kind and count, so that a seeker knows what the search is for before doing it. Like a hint, this is the hider’s choice and a claim. It says nothing about where the bag is, and nothing about what its items say.

["contents", "<kind>", "<count>"]

  • kind is one of:
    • shard: a shard, carried inline (kind 3330) or by reference (kind 33331, §7.6 References)
    • message: a message (kind 1)
    • key: a key item (kind 3340)
    • chest: a chest (kind 3341)
    • cashu: a Cashu token written in a message’s text
    • nft: a nonfungible.cash claim link written in a message’s text, https://nonfungible.cash/claim/<id>#<key>, where id is 32 lowercase hex characters and key is 43 base64url characters that encode 32 bytes, so its last character is one of AEIMQUYcgkosw048. The scheme and host are compared without regard to case, as in any URL; the id and key are exact. A link glued to the end of a word, or standing inside another URL’s path or query, is not counted. Each distinct link in a message counts once.
    • audio: hidden audio (kind 1063, DECK-0007). It was added after the kinds above, so it is written after them.
    • door: a door, which is a chest (kind 3341) that carries a door tag (DECK-0004 §3.7). It was added after audio, so it is written after it. A door is counted as door. It is never also counted as chest. What a door’s room holds is never counted. It is not counted in the bag that holds the door, and it is not counted in the room bag, because a room bag carries no contents tags (§8.6).
  • count is a decimal string, a positive integer with no sign and no leading zeros (the rules of §10).
  • A message that holds a token or a link is also counted as a message, so message is at least the number of messages that carry them.
  • A bag MUST carry at most one contents tag per kind, and SHOULD write them in the order above. A kind the bag does not hold is left out; a count of zero is never written.
  • A writer that publishes contents MUST compute them from the plaintext it is sealing, every time it publishes the bag, so that they are never stale. Because a bag is rewritten whole (§7.6 Lifecycle), this costs nothing extra.
  • Money alone: a writer MAY publish only that money is inside, as ["contents", "cashu"] with no count, and only while the bag holds a Cashu token. There is no such form for any other kind; in particular, an NFT is not money, and ["contents", "nft"] without a count says nothing.

Reading contents (normative): a reader MUST ignore a contents tag whose kind it does not know, and one whose count is present but is not a positive integer. Contents never invalidate a bag, and a reader MUST NOT treat a bag as holding less than it finds, or more, because of them: what the bag holds is decided by its plaintext alone (§7.6).

Contents are a claim (non-normative): nothing verifies them until the bag is opened. A token or a link counted in public may already have been spent, claimed or cancelled by the time a seeker opens the bag; the count says what was sealed, not what is still there. A hider who publishes that an NFT or money is inside invites sweepers (Reading is not reaching, above: anyone who derives the key reads the bag from anywhere), and may prefer to hide it inside a chest as well.

7.8 Holding a region (non-normative)

Computing a region’s Cantor root produces every intermediate node of the per-axis trees on the way up, and every intermediate node is itself the root of an aligned sub-region (§4.5). Whoever keeps those nodes on disk holds the region: the per-axis roots of every aligned sub-region inside it, at every height, are on hand, so any location-based key inside the holding costs one pairing step (§4.7, §7.2) instead of a tree. Holding is §7.5 carried to its limit.

What holding buys is latency, and only latency:

  • reading content published anywhere in the region at any height without per-item work, where a passerby’s interactive scan reaches roughly h16 (§7.3);
  • writing at any height in the region without rebuilding a tree;
  • deriving a two-factor key, KDF(location_decryption_key || owner_secret), for content that must be both found by presence and unlocked by the holder. DECK-0004 uses this construction for the key of a room behind a door. There the secret is the door’s secret, and the KDF is SHA-256 over a domain prefix and the two keys (DECK-0004 §3.7.2).

“Without rebuilding a tree” is not “at once”, and earlier drafts of this section said “at once” (non-normative). A holder skips the tree build and still pays the combine, which operates on numbers of 85 × 2^h bits and is measured at 0.76 to 1.03 times a full axis build. Holding therefore buys about 4.9 times, roughly two heights, not an instant answer: a held key at h34 is still on the order of hours on a desktop. That is a large and real advantage over not holding, and it is a latency advantage rather than a capability one, exactly as the rest of this section says. §6.12 works the same arithmetic from the other side, and docs/what-can-be-sold.md works through what both mean for anyone building on this.

What holding does not buy: exclusivity (anyone who does the work holds identical keys), any advantage in observing chains (they are public to everyone), or any effect on anyone else. It is a keyring, not a claim.

What holding costs is disk. Each level of a per-axis tree is about as large as its root (§9.9), so the full trees for three axes are about 3 × (h + 1) roots: roughly 19 TB at h34, 1.5 PB at h40, 107 PB at h46. Keeping only the nested cubes that contain one position costs about two roots per axis, roughly 1.1 TB at h34. Stop paying and the keys are a recomputation away again; nothing else happens.

There are no domains in the base protocol. Holding is the whole of what the protocol offers toward territory. Claims, exclusion and governance are left to applications and games; see RATIONALE.md §6 and docs/territory-conflict-game-layer.md.


8. Nostr Integration: The Movement Chain

Cyberspace uses Nostr as its transmission layer. Movement is represented as a per-pubkey, linear hash chain of signed Nostr events. This means Cyberspace does not require new network infrastructure. It composes on top of existing relays.

The state of Cyberspace is the sum of all cyberspace-related Nostr events. Because Nostr is decentralized and permissionless, knowledge of global state is not possible, just as in physical reality.

8.1 Event kind

  • Movement events: kind = 3333

8.2 Canonical event id (NIP-01)

The event id MUST be computed as NIP-01 canonical serialization:

  • Serialize: [0, pubkey, created_at, kind, tags, content]
  • Encode as UTF-8 JSON with no whitespace (equivalent to Python json.dumps(..., separators=(",", ":"), ensure_ascii=False))
  • Hash: sha256(serialized_bytes)

Signature (sig): sig MUST be a valid Schnorr signature over the event id as required by NIP-01. An event whose id or sig fails these checks is not authentic, and a reader discards it before resolving a chain (§8.7.3). A rumor (§7.6), an item that carries an id and no signature inside a bag or inside another item, follows only the id rule.

8.3 Spawn event (first event)

The spawn event declares “I exist at this coordinate.” It is the first event in a keypair’s movement chain.

Required tags:

  • A tag: ["A", "spawn"]
  • C tag: ["C", "<coord_hex>"]
    • coord_hex MUST be a 32-byte lowercase hex string (64 hex chars, no 0x prefix)
    • For spawn events, coord_hex MUST equal the event pubkey (spawn coordinate)
  • Sector tags: X, Y, Z, S computed from C (per §10). Each MUST appear exactly once. Missing sector tags, a sector tag that appears more than once, or values that do not equal the ones computed from C, make the event invalid.

8.4 Hop event

A hop event extends the movement chain by one Cantor pairing tree proof, carried as residue openings (§5.9 to §5.11).

Required tags:

  • A tag: ["A", "hop"]
  • e genesis: ["e", "<spawn_event_id>", "", "genesis"]
  • e previous: ["e", "<previous_event_id>", "", "previous"]
  • c tag: ["c", "<prev_coord_hex>"] (32-byte lowercase hex string)
  • C tag: ["C", "<coord_hex>"] (32-byte lowercase hex string)
  • proof tag: ["proof", "<seal_hex>"] (the seal of §5.10, a 32-byte lowercase hex string)
  • mn tag: ["mn", "<nonce_hex>"] (the re-roll nonce of §5.10, as exactly 16 lowercase hex characters, big-endian)
  • mp tag: ["mp", "<openings_hex>"] (the HOP_SAMPLES openings of §5.10, lowercase hex)
  • Sector tags: X, Y, Z, S computed from C (per §10). Each MUST appear exactly once. Missing sector tags, a sector tag that appears more than once, or values that do not equal the ones computed from C, make the event invalid.

Openings encoding: The mp value is the concatenation of the HOP_SAMPLES openings of §5.10 in ascending i, with no separators. Each opening is its block’s 8 residues, each as 16 hex characters (be64), followed by its depth sibling hashes from the leaf level upward, each as 64 hex characters. An opening is therefore 128 + 64 × depth characters, and the tag is exactly HOP_SAMPLES × (128 + 64 × depth) characters, 18,432 at h_max = 20. depth follows from h_max (§5.9, §5.10), which the verifier derives from c, C and the terrain of §5.2, so a hop carries no height tags. An mp of any other length, or with any character outside 0-9 and a-f, is malformed, and the event MUST be rejected.

Version 1 hops: A hop whose proof tag is the proof_hash of §5.6 and which carries no mn and no mp tag is a version 1 hop. It MUST be rejected per §5.13 unless its id is listed in grandfathered-v1-hops.txt.

8.5 Sidestep event

A sidestep event extends the movement chain by one Merkle hash tree boundary crossing.

Required tags:

  • A tag: ["A", "sidestep"]
  • e genesis: ["e", "<spawn_event_id>", "", "genesis"]
  • e previous: ["e", "<previous_event_id>", "", "previous"]
  • c tag: ["c", "<prev_coord_hex>"] (32-byte lowercase hex string)
  • C tag: ["C", "<coord_hex>"] (32-byte lowercase hex string)
  • proof tag: ["proof", "<proof_hash_hex>"] (32-byte lowercase hex string)
  • mr tag: ["mr", "<M_x_hex>:<M_y_hex>:<M_z_hex>"] (per-axis Merkle roots, colon-separated, each 64 hex chars)
  • mp tag: ["mp", "<openings_x_hex>:<openings_y_hex>:<openings_z_hex>"] (per-axis openings, colon-separated)
  • mn tag: ["mn", "<nonce_hex>"] (the re-roll nonce of §6.10, as exactly 16 lowercase hex characters, big-endian)
  • hx tag: ["hx", "<lca_height_x>"] (LCA height on X axis, decimal string)
  • hy tag: ["hy", "<lca_height_y>"] (LCA height on Y axis, decimal string)
  • hz tag: ["hz", "<lca_height_z>"] (LCA height on Z axis, decimal string)
  • Sector tags: X, Y, Z, S computed from C (per §10). Each MUST appear exactly once. Missing sector tags, a sector tag that appears more than once, or values that do not equal the ones computed from C, make the event invalid.

Openings encoding: Each per-axis segment in the mp tag is the concatenation of SIDESTEP_SAMPLES + 1 inclusion proofs in the order defined by §6.10 (destination first, then samples in ascending i). Each proof is h sibling hashes from leaf to root, hex-encoded, so an axis with LCA height h contributes exactly 64 × h × (SIDESTEP_SAMPLES + 1) hex characters. For trivial axes (h = 0), the segment is an empty string between colons.

Because the segment is fixed-width given h, a verifier reads the per-axis hx, hy, hz tags and splits the segment without ambiguity. A segment whose length is not an exact multiple of 64 × h is malformed and the event MUST be rejected; a segment of exactly 64 × h characters is a v1 proof and MUST be rejected per §6.15. An event without an mn tag is a version 2 proof and MUST be rejected per §6.16 unless its id is listed in grandfathered-v2-sidesteps.txt.

Height tags: The hx, hy, hz tags enable verifiers to determine expected proof lengths without re-deriving LCA heights from coordinates.

8.6 Encrypted content event (bag)

A bag publishes content encrypted to one region at one height (§7.6). Its cipher, plaintext, items and lifecycle are defined in §7.6; this section gives the event format, as §8.3 to §8.5 do for movement.

  • Encrypted content events: kind = 33330
  • kind 33330 is addressable: relays keep the newest event per (pubkey, kind, d)

Required tags:

  • d tag: ["d", "<lookup_id_hex>"] (32-byte lowercase hex string, the lookup_id of §7.2)
  • encrypted tag: ["encrypted", "aes-256-gcm", "<payload_base64>"] (the payload of §7.6)
  • version tag: ["version", "2"]
    • version names the rules of §7.6. A reader MUST ignore a bag whose version it does not know.

Optional tags:

  • H tag: ["H", "<height>"] (decimal string, no sign, no leading zeros except "0"): the height of the region whose key encrypts the content, which is the discovery radius of §7.3; at least 1 (§7.6). This is the bag’s height tag.
  • hint tag: ["hint", "<coord_hex>", "<Hx>", "<Hy>", "<Hz>"]: the hider’s coarse statement of where the bag can be found (§7.7)
  • Sector tags X, Y, Z, S: required on a bag that carries a hint tag, for each axis whose hint height is at most 30 (§7.7, §10); MUST NOT appear otherwise
  • contents tags: ["contents", "<kind>", "<count>"], the hider’s public statement of what the bag holds, by kind (shard, message, key, chest, cashu, nft, audio, door) and count, or ["contents", "cashu"] alone to say only that money is inside (§7.7 Contents)

A room bag (DECK-0004 §3.7.2) carries none of these optional tags. A room bag is a bag that holds what is hidden behind a door, and its key comes from a place and the door’s secret together. Nothing public may say where a room bag is, at what height, or what it holds.

Content: MAY carry plaintext meant for humans, a riddle (§7.7). The protocol does not interpret it.

The height tag (normative):

  • A writer that states a bag’s height MUST write it as exactly one H tag. A writer MUST NOT write an h tag on a bag.
  • A reader reads the height from the H tag. If the bag carries no H tag, the reader reads it from an h tag instead, in the same form: bags written before 2026-10-21 state their height that way. If the bag carries any H tag, the reader MUST ignore every h tag on it, whatever its value.
  • The tag the reader reads MUST appear exactly once, with a well-formed value. If it appears more than once, or its value is missing or malformed, the bag states no height: the reader treats the height as absent, exactly as if the bag carried neither tag. The bag is not invalid for it, because the height tag is optional; a reader that opened the bag knows its height anyway, as the height of the key that opened it (§7.2).
  • A bag that states height 0 MUST be rejected (§7.6).
  • A writer that rewrites a bag (§7.6, Lifecycle) and keeps its height public writes it as H, even when the bag it replaces said it with h.
  • These rules apply to every event that is a bag in all but its kind, such as the chat envelope (kind 23330), which states its room’s height the same way.

Why H and not h (non-normative): The height tag was h until 2026-10-21. NIP-29 (relay-based groups) reads an h tag on an event of any kind as the id of the group the event is posted to. A relay that runs NIP-29 therefore refused bags (it had no group named 7), or would have filed one into a real group whose id happened to be a height. Uppercase H matches cyberspace’s other uppercase tags, such as A and C, and no NIP defines it. The reader fallback exists only so that bags already on relays keep stating their height. It is not a second way to write one. The tag name H is unrelated to the hint heights Hx, Hy and Hz of §7.7, and to the region height H of §8.11.1, both of which are numbers inside other tags.

8.7 Verification summary

8.7.1 Hop verification

To verify a hop (Level 1, residue openings):

  1. Parse previous and current coords; decode to (x1,y1,z1,plane) and (x2,y2,z2,plane).
  2. Plane changes are valid in v2; verifiers MUST support hops where plane1 != plane2.
  3. Compute each axis’s LCA height and aligned base per §4.4 and §4.5.
  4. Derive the terrain-based temporal height K from the destination coordinate (x2,y2,z2,plane2) per §5.2 (including the destination plane bit).
  5. Compute the temporal base t_base from the hop event’s previous_event_id (e tag with marker previous) and K per §5.3.
  6. Compute h_max and m per §5.9, and depth and the price A per §5.10.
  7. If the hop’s id is listed in grandfathered-v1-hops.txt, accept its proof without steps 8 to 11 (§5.13). Otherwise parse the seal from proof, the nonce from mn and the openings from mp, and reject if any of the three is missing or not of the form and width §8.4 gives it.
  8. Compute G from previous_event_id, the seal and the nonce per §5.10; reject unless G × A < 2^256.
  9. Derive the sample indices idx_0 to idx_15 from G per §5.10.
  10. For each idx_i: derive the hop prime p_(idx_i) per §5.9; compute hop_n mod p_(idx_i) from the axis roots and the temporal root modulo that prime per §5.9; compare it with residue idx_i mod 8 of opening i; recompute the leaf of block idx_i div 8 from the opening’s residues, and verify its path of exactly depth siblings to the seal.
  11. Accept iff every comparison and every path holds.

These steps never build a root, region_n or hop_n. A verifier that skips step 8 accepts the divisible-work forgery of §5.10. Level 2 (full audit) verification is described in §5.11.

8.7.2 Sidestep verification (Level 1: sampled openings)

To verify a sidestep (Level 1, sampled openings check):

  1. Parse previous and current coords; decode to (x1,y1,z1,plane) and (x2,y2,z2,plane).
  2. Validate crossing geometry: for each axis, confirm the destination is exactly 1 Gibson past the LCA boundary (§6.3). Verify the hx, hy, hz tags match the computed LCA heights.
  3. Parse per-axis Merkle roots from the mr tag. Read previous_event_id from the e tag with marker previous.
  4. Parse the nonce from the mn tag. Compute G per §6.10 and A from the heights; reject unless G × A < 2^256. If the event has no mn tag, accept steps 4 and 5 only when its id is listed in grandfathered-v2-sidesteps.txt (§6.16), and otherwise reject it.
  5. For each axis where movement occurs: a. Build seed_prefix = SIDESTEP_DOMAIN || previous_event_id || axis_byte || SEED_PAD per §6.4, and the aligned base base = (v1 >> h) << h. b. Split the axis segment of the mp tag into SIDESTEP_SAMPLES + 1 proofs of h siblings each; reject if the length does not match (§8.5). c. Compute the destination leaf hash H_dest = SHA256(seed_prefix || int_to_bytes_be_min(v_dest)) and verify its path to the claimed root M_axis. d. Derive the sample indices from G per §6.10. For each idx_i, compute SHA256(seed_prefix || int_to_bytes_be_min(base + idx_i)) and verify its path to M_axis.
  6. Compute region_m = π(π(mx, my), mz) from the claimed Merkle roots (§6.6).
  7. Derive K and cantor_t from destination coordinate and previous_event_id (§6.7, same as hop).
  8. Compute sidestep_n = π(region_m, cantor_t) and proof_hash per §6.8.
  9. Accept iff it matches the event’s proof tag.

A verifier that skips step 4 accepts the forgery of §6.11. A verifier that skips step 5d is performing a strictly weaker check than v1’s, not an equivalent one, because after seeding there is no canonical root to compare M_axis against (§6.10).

Level 2 (full root) verification is described in §6.11.

8.7.3 Resolving a chain (normative)

An identity’s active chain is the one line of its movement events that says where it is. Relays hand a reader whatever events they hold for a pubkey, in no particular order, and those events can include old chains (before a respawn) and forks. A fork is found when, during the walk of rule 3, more than one distinct event (distinct by id) whose e genesis names the newest spawn names the current event as its e previous (rule 4); it happens when two devices signed in as one identity act from the same point, or when an identity tries to rewrite its own history. Every reader MUST resolve the events it holds into the active chain by the same rule, so that every reader holding the same events arrives at the same chain and the same position.

Authentic events only (normative): Before resolving anything, a reader MUST discard every event it holds that is not authentic. An event is authentic when it is a valid NIP-01 event, meaning its id is the hash of its canonical serialization (§8.2) and its sig is a valid signature over that id by its pubkey, and when its pubkey is the identity’s own. This applies to every event the reader holds, wherever it got it: from a relay, from its own storage, or from another reader. A discarded event is treated as if it never existed. It is not a spawn, it is not a link that any event can follow, it is not a branch of a fork, and it is not an invalid event. Only authentic events take part in the rules below.

Chain events (normative): Only kind 3333 events (§8.1) take part in resolution. Events of any other kind are not chain events, and a reader ignores them here even when they carry A or e tags. A game MAY use other kinds for traffic that is not on the chain, such as ephemeral events for live play (§8.11.7). Being kind 3333 does not make an event part of the active chain: only the events rules 1 to 4 reach are. On the active chain, an action whose name the reader does not recognize is skipped as §8.9 says, and the actions inside a virtual bracket are checked only as §8.11 says.

A branch through a discarded event is cut off (normative): An event that names a discarded event as its e previous names nothing the reader holds, so rule 3 below never reaches it, or anything that descends from it. The chain therefore ends at the event before the discarded one, and that event is the head (rule 5). This is not an invalid chain. The identity continues from that head: its next action names the head as its e previous like any other action, and that action is not a fork (rule 4), because the cut-off events are not part of anything a reader resolves.

Why forged events are discarded before resolution (non-normative): The rules below choose between events by their links, their created_at and their ids, and none of them asks who signed an event. If an inauthentic event took part, anyone could end another identity’s chain by posting a forged event under its pubkey: a forged spawn newer than every real one, or a single forged action that names any event on the identity’s chain but its head as its previous (an action that names the head extends the chain rather than forking it). That forged action would fork the chain, and a fork kills the chain from the spawn (rule 4), so one forged event could wipe out all of an identity’s travel. Nobody should be able to end someone else’s chain by posting a forged event. Discarding inauthentic events first means that only events the identity actually signed can decide its chain, its position and whether its chain is valid. Relays commonly verify signatures, but a reader cannot know which relays did, so it checks for itself.

  1. The spawn. The active chain starts at the newest spawn event (§3.2): the authentic chain event any of whose A tags is spawn, with the largest created_at. When two spawns share the largest created_at, the one with the larger event id is newer. An event is a spawn when any of its A tags is ["A", "spawn"], whatever other A tags it carries and in whatever order. A spawn that carries a second A tag is invalid, because every chain event carries exactly one A tag (§8.8), and when it is the newest spawn the chain is invalid from it and the identity stands at its spawn coordinate (§3.2). The newest spawn starts the active chain whether or not it is valid, and a reader MUST NOT pass over an invalid newest spawn in favor of an older one (§3.2).
  2. The genesis. Only events whose e genesis tag names that spawn can be part of the active chain. Events that name another spawn belong to an older chain; they remain on relays as history and are ignored here, even if their e previous tag would fit.
  3. The links. From the spawn, the chain is followed forward through e previous links: the next event is the one whose e previous tag names the current event.
  4. Forks. When more than one distinct event (distinct by id) whose e genesis names the newest spawn names the current event as its e previous, the chain has forked, and the identity’s chain is dead. It is invalid from the spawn, and the identity stands at its spawn coordinate, the coordinate of its pubkey (§3.2), exactly as when its newest spawn is invalid. This holds whatever the branches contain, whichever was signed first, and however valid the events before the fork are. Only a respawn starts a chain that can be valid again.
  5. The head. The chain ends at the first event that no event names as previous. That event is the identity’s position when the chain is valid; when it is not, the identity stands at its last valid position, or at its spawn coordinate when the chain is dead (below).

A spawn is never a link (normative): An event any of whose A tags is spawn is never reached by rules 2 and 3, whatever e tags it carries. The newest one starts the active chain (rule 1). Every other one is history, like an older chain. It never extends a chain, never forks one, and is never a virtual or skipped action.

Why a spawn is never a link (non-normative): A spawn is the identity’s statement “I start over”, and it names no previous event. Letting one link into a chain would do one of two things, both wrong. As a second next event it would kill the chain with an event whose only meaning is to start over. As the only next event it would put a teleport to the spawn coordinate in the middle of a chain without ending that chain, which §3.2 rules out: a spawn ends the old chain and starts a new one. Rules 1 to 3 use the same test, any A tag equal to spawn, so readers have nothing to choose between.

The first copy of each link (normative): Rules 2 and 3 read the first e tag on an event marked genesis and the first marked previous, in the order the tags appear. Resolution therefore stays deterministic, and it checks no form, even when an event carries a marker twice. Validity then rejects such an event: every chain event after the spawn MUST carry exactly one e genesis tag and exactly one e previous tag, and an exit-virtual action exactly one e entry tag, each with a well-formed value (§8.8). An event that carries two of any of them is invalid, whether it is a recognized action, a skipped action (§8.9) or a virtual action (§8.11.2).

Why a fork kills the chain (non-normative): The rule this revision first carried let the branch signed first continue the chain. Together with resolution before validity, and an invalid chain standing at its last valid position, that rule gave every identity a free rewind. An identity could return to any position it had ever held on its chain, for one signature and no work: it signed an invalid event that named an old event of its chain as previous, with a created_at earlier than the real action that had followed that old event. The older-branch rule picked the invalid event, the chain froze at the old event, and the identity stood where it had stood before, at no cost. A rewind that was paid for was possible too: a valid branch, backdated the same way, replaced everything the identity had published after its fork point. Under the rule that a fork kills the chain, any rewrite of history ends the chain, so history that has been published stays the history. The cost is that an identity that acts from two devices out of sync loses its chain. The check clients make before they sign (below) narrows that window but cannot close it, because two devices can confirm the same head at the same moment and both sign from it. Both branches stay on relays, signed, so a fork is always detectable (§12.1), and detecting one needs nothing but links.

This restores the rule of cyberspace v1, and of the earlier draft of DECK-0001 (§8), which made both branches of a fork invalid. The older-branch rule replaced it when this revision was first written, and it is withdrawn.

Confirm the live head before signing (normative for clients): A client MUST NOT sign an action other than a spawn unless it has confirmed that it holds the identity’s live head, the head of its active chain as rule 5 gives it, for example by fetching the identity’s newest movement events from the relays it publishes to and resolving them. Signing from a stale head forks the chain, and a fork kills it. A spawn is exempt, because a spawn is never a link and cannot fork a chain (above).

Validity and position (normative): Resolution comes first and validity second. Rules 1 to 5 choose the active chain from authentic events by their links, their created_at and their ids alone, without checking any proof or tag, and validity is then decided on the chain they chose, one event at a time, from the spawn forward. A fork is detected by links alone, so it is decided during resolution, before any event is checked: a forked chain is dead from the spawn, and the identity stands at its spawn coordinate (rule 4), whether or not any event before the fork point is invalid. An event that breaks any of the chain rules (§8.12) is invalid, and the chain is invalid from that event: the event and every event after it on the active chain count for nothing. The identity’s position is then its last valid position, the position the chain would give it if it ended at the last valid event before the first invalid one. In the ordinary case that is the C of the last valid event. When the last valid event is a skipped action, or lies inside a virtual bracket, it is the position §8.9 (item 5) and §8.11.4 (rule 7) give a chain that ends there. When the spawn itself is invalid there is no valid event, and the position is the spawn coordinate, the coordinate of the identity’s pubkey (§3.2). When the chain has forked it is dead, and the position is the spawn coordinate too (rule 4). A chain that is invalid without a fork still stands at its last valid position, because it genuinely reached it. An invalid chain is frozen at that position: no event published after the invalid one on that chain can move the identity, however valid it is on its own, and only a respawn starts a chain that can be valid again (§3.2).

Why resolution comes before validity (non-normative): Every reader then agrees on the active chain without verifying a single proof, so readers that verify more, less or nothing at all still point at the same chain, and they can disagree only about whether it is valid, which each can settle by checking the proofs. A fork is found by links alone, so every reader holding the same events also agrees, without checking a proof, on whether the chain is dead.

Why the newest spawn wins even when it is invalid (non-normative): A spawn is the identity’s own statement that it starts over, and because forged events are discarded before resolution, only the identity’s own client can publish an invalid one. Resolution never looks at validity, so every reader holding the same events resolves the same chain before it decides anything about that chain. Falling back to an older spawn would make resolution depend on validity, and it would revive a chain the identity had already chosen to end. The newest spawn therefore decides, and the remedy for an invalid spawn is another spawn.

Why an invalid chain stands at its last valid position (non-normative): Every valid event up to that point carries the work that put the identity where it is, and the invalid event proves nothing. The last valid position is the last place the chain proves the identity reached. Sending the identity back to its spawn coordinate would discard travel that was paid for and checked, and letting later events move it would count moves made from a position the chain never proved.

8.8 Core action types summary

The base Cyberspace v2 protocol defines three movement action types and two bracket action types:

A tag valueDescriptionProof typeDefined in
spawnIdentity placement at pubkey-derived coordinateNone (identity proof)§8.3
hopMovement via Cantor pairing treeResidue openings of the Cantor roots (§5.9)§8.4
sidestepBoundary crossing via Merkle hash treeMerkle root (§6.4)§8.5
enter-virtualOpens a virtual bracket: the identity starts playing a game, and its position in cyberspace is heldNone§8.11
exit-virtualCloses a virtual bracket: the identity leaves the game and is back at the position it entered fromNone§8.11

All five use event kind = 3333. Inside a virtual bracket, the A tag carries a name of the game’s choosing instead (§8.11.2).

Exactly one A tag (normative): Every event in a movement chain MUST carry exactly one A tag. This holds for every action, whether or not a verifier recognizes it (§8.9), and inside a virtual bracket as well as outside one (§8.11). An event with no A tag, or with two or more, is invalid, and the chain is invalid from that event (§8.7.3). An A tag whose value is missing or empty is still an A tag, and a malformed one (below). Because events the identity did not sign are discarded before its chain is resolved (§8.7.3), only the identity’s own client can put such an event on its chain.

Each tag the chain rules read, exactly once and with a value (normative): Every tag that a chain rule reads on an event MUST appear on that event exactly once, with a well-formed value. A tag is identified by its name, its first element, and an e or p tag also by its marker, its fourth element: ["e", "<id>", "", "previous"] is an e previous tag. Its value is its second element, and where the section that defines a tag gives it further elements, such as the height H that is the third element of a region tag (§8.11.1), those are part of its value too. A tag whose value is missing or empty still counts as that tag, and it is malformed: a bare ["A"] is an A tag, so an event that carries it beside ["A", "hop"] carries two A tags, and an event that carries it alone carries one malformed A tag. An event on which a tag the chain rules read is missing, appears more than once, or is malformed is invalid, and the chain is invalid from that event (§8.7.3). A value is well formed when it has the form the section that defines the tag gives it: an A value is a non-empty string, and c, C, proof and the ids in e tags are 32-byte lowercase hex, for example.

The tags the chain rules read are these, and no others:

EventTags the chain rules read
spawn (§8.3)A, C, X, Y, Z, S
hop (§8.4)A, e genesis, e previous, c, C, proof, mn, mp, X, Y, Z, S
sidestep (§8.5)as for a hop, and mr, hx, hy, hz
enter-hyperspace (DECK-0001 §3.1)A, e genesis, e previous, c, C, proof, X, Y, Z, S
hyperjump (DECK-0001 §5.2)as for enter-hyperspace, and from_height, B, mp, mn, and as_of on the first ride after boarding (DECK-0001 §4.3)
enter-virtual (§8.11.1)A, e genesis, e previous, c, C, region, p marked game, X, Y, Z, S
exit-virtual (§8.11.3)A, e genesis, e previous, e entry, C, X, Y, Z, S
a virtual action (§8.11.2)A, e genesis, e previous
a skipped action (§8.9)A, e genesis, e previous

Two exceptions are part of the rules that define them. A sidestep listed in grandfathered-v2-sidesteps.txt (§6.16), and a ride listed in decks/grandfathered-v1-hyperjumps.txt (DECK-0001 §5.8), MAY lack the mn tag, and a hop listed in grandfathered-v1-hops.txt (§5.13) MAY lack the mn and mp tags; when a listed event carries a tag it may lack, that tag appears exactly once. Those lists waive only the re-checking of a listed event’s proof (for a sidestep or a ride its root and openings, for a hop its proof); every other tag it carries that the chain rules read, including proof, and mp on a sidestep or a ride, still MUST appear exactly once with a well-formed value. A listed hop’s proof is the proof_hash of §5.6, and it is well formed when it is 32-byte lowercase hex. The c tag of an exit-virtual action is optional and is never read, so it is not constrained at all (§8.11.3). Every other tag is free: tags the chain rules do not read, such as client, imeta, net (the network for chain validity is Bitcoin mainnet, always, so a net tag on an action is informational and never read, DECK-0001 §1.4), the e tags with other markers, the tags a game puts on its actions inside a bracket, and the tags of a skipped action other than its A, e genesis and e previous tags, MAY appear any number of times with any value. A spawn’s e tags, if it has any, are not read either, because a spawn is never a link (§8.7.3, “A spawn is never a link”).

Why each tag is read exactly once (non-normative): Readers must never disagree about a chain. When a tag the rules read can appear twice, one reader takes the first copy and another the last, and the same chain puts the identity in two places. Resolution therefore follows the first copy of each link (§8.7.3), so every reader resolves the same chain, and validity rejects any second copy of a tag the rules read, so no verdict ever rests on which copy a reader chose. Before this rule, a bare ["A"] was read as no A tag by some readers and as one nameless skipped action by others, so the same chain placed a player in different spots. Requiring each read tag exactly once, and counting an empty tag as a malformed one, leaves nothing for a reader to choose. Only the identity’s own client can publish such an event (§8.7.3), and a client that builds its tags from the rules never does.

8.9 Protocol extensions (DECKs)

This specification defines the base Cyberspace v2 protocol.

Extensions MAY introduce new event kinds, new movement action types (A tag values), and/or additional validation rules.

Extensions are specified as Design Extension and Compatibility Kits (DECKs) in the decks/ directory.

  • Hyperspace extension (DECK-0001, mandatory): decks/DECK-0001-hyperspace.md

Movement is universal (normative): Space is the core primitive of cyberspace, so every way an identity can move is part of the protocol that every reader shares. A DECK that defines an action which can change an identity’s position (an action whose C may differ from its c) is mandatory: every verifier MUST implement it, and it becomes part of the chain rules through a new chain rules revision (§8.12). DECK-0001 (hyperspace) is mandatory, because a hyperjump moves an identity from one stop to another. A DECK whose actions never change an identity’s position is optional, and a verifier MAY leave it unimplemented.

Actions a verifier does not recognize (normative): A verifier recognizes the base actions (§8.8) and the actions of every DECK it implements, which always includes every mandatory DECK. An action whose A value the verifier does not recognize is skipped: the verifier treats it as if it were not on the chain, and goes on verifying every recognized action after it. Skipping works as follows:

  1. Links are still followed. The chain is resolved through e previous links as always (§8.7.3), including links that name a skipped action, so a skipped action never breaks the chain apart.
  2. Position is carried across. The c of each recognized action MUST equal the C of the nearest recognized action before it, not the C of a skipped one. A skipped action that changed the identity’s position therefore leaves the next recognized action’s c mismatched, and the chain is invalid from that recognized action.
  3. Work is still seeded by the actual previous event. A hop or sidestep after a skipped action derives its temporal axis from the skipped action’s event id (§5.3). The id is only a 32-byte value and needs no understanding of the action, so the hop or sidestep is still fully checked.
  4. Rules that look back see through skipped actions. Where a rule depends on the action before an event (for example DECK-0001 §4.3), the nearest recognized action before it stands in, as an exit-virtual action stands in for a bracket (§8.11.4, rule 8).
  5. The head. When a chain ends on one or more skipped actions, the identity’s position is the C of the last recognized action.

What a skipped action is checked for (normative): A skipped action is checked for three things and nothing else:

  • it is authentic: a valid NIP-01 event signed by the identity. Reaching it at all guarantees this, because inauthentic events are discarded before resolution (§8.7.3).
  • it is linked: it carries exactly one e genesis tag, which names the current spawn, and exactly one e previous tag, which names the event before it, each with a well-formed value (§8.7.3, “The first copy of each link”; §8.8). Resolution guarantees that the first copy of each names the right event (§8.7.3, rules 2 and 3); a second copy of either makes the skipped action invalid, and the chain is invalid from it.
  • it carries exactly one A tag, with a value (§8.8).

Its other tags, its proofs and its sector tags belong to the DECK that defines it, and a verifier that does not implement that DECK does not check them. The identity’s position is protected by continuity on the next recognized action (item 2 above).

Continuity and virtual brackets (normative): Continuity, the rule of item 2 that a recognized action’s c equals the C of the nearest recognized action before it, applies outside virtual brackets. A bracket is checked as a unit (§8.11.5). Its enter-virtual action’s c MUST equal the C of the nearest recognized action before it, as for any recognized action; the events inside the bracket, and the c of the exit-virtual action that closes it, are not checked for continuity; and continuity resumes after the exit from the exit-virtual action’s C, which is the identity’s base position restored (§8.11.4, rule 2).

Inside a virtual bracket the rules of §8.11 apply instead of the rules above: every action name there that rule 3 of §8.11.4 does not reserve is a virtual action, and base checks it by §8.11.5 without knowing the game.

Why an unrecognized action is skipped and not a stop: An optional DECK can then add actions that do not move anyone, such as a gesture or a marker left on the chain, and every verifier that has not implemented it still checks the whole chain around them. Under the earlier rule, a verifier stopped at the first action it did not implement and could say nothing about anything after it.

Why a position change across a skipped action is invalid: Every way to move is in a mandatory DECK, so a conforming verifier recognizes every action that can legitimately change a position. An unrecognized action that changes one is a move with no proof that any verifier can check, a teleport, and the chain cannot count it.

Why a DECK that moves identities is mandatory: If it were optional, every verifier without it would find a mismatched c after every use of it and call valid chains invalid, so readers would split into those that accept a traveler and those that reject the same traveler. A new way to move changes which chains are valid, and the chain rules revision (§8.12) is where such a change is named.

8.10 Avatar event

An avatar is the shape an identity is drawn as. It is the one thing in cyberspace that lands on other people’s screens whether they asked for it or not: everyone near its owner sees it, at every zoom. Its size and its detail are therefore paid for in work, on the event that publishes it, and a client draws nothing it cannot verify has paid.

  • Avatar events: kind = 11333
  • kind 11333 is replaceable: relays keep the newest event per (pubkey, kind), so an identity has exactly one avatar and the newest replaces it

An avatar is one per identity, which is what a replaceable event is for. This was kind 33331, addressable, with a d tag fixed at "avatar": a constant d is emulating replaceable semantics with the wrong tool, and it asks every reader to trust a convention where the relay could enforce the rule. Everything in nostr that is one per person is replaceable, including metadata, contacts, relay lists and DM relay lists; addressable is for the other case, many per author told apart by d, as long-form articles and wiki pages and classified listings are.

The change is a clean break rather than a migration. At the time it was made, a query for kind 33331 across twelve relays, including the one this protocol uses, returned nothing, while the same query returned bags and movement events. An identity that had adopted an avatar without publishing it re-mines once, which is the work it paid the first time.

11333 was chosen by querying for it rather than by reading a registry. The registry of kinds and the NIPs index both list only what has been written down, and the replaceable range is full of numbers that are in daily use and appear in neither: 10333 carries Podcasting 2.0 favourites, 10086 a relay indexer’s lists across eighty pubkeys, 10088 something Amethyst writes. A kind is free when the relays say so.

Required tags:

  • nonce tag: ["nonce", "<nonce>", "<target>"] per NIP-13, where target is the leading zero bits the publisher committed to before mining

Optional tags:

  • name tag: ["name", "<name>"], the shape’s name for humans

Content: a shard payload as bags carry them, or empty. The work reads these fields of it: unit (a model unit is 2^unit gibsons), vertices (whole units per vertex), ticks (the fraction of a unit per vertex, in 120ths, packed so that -N stands for N zero triples) and faces. Empty content means the default avatar and owes no work.

No d tag: a replaceable kind has no second key, and writing one would only invite a reader to filter on it.

The work (normative):

AVATAR_FLOOR_BITS  = 16   # every avatar
AVATAR_SIZE_BITS   = 2    # per doubling of reach
AVATAR_DETAIL_BITS = 3    # per doubling of detail beyond the free thirty-two
AVATAR_DETAIL_FREE = 32

def avatar_work(payload) -> int:
    # reach: the farthest any vertex lies from the build origin, on any axis,
    # in gibsons at true scale; never below one gibson
    reach  = max(1.0, max(abs(v + t / 120) for every vertex coordinate) * 2 ** payload.unit)
    detail = max(AVATAR_DETAIL_FREE, len(payload.vertices) + len(payload.faces))
    return ceil(AVATAR_FLOOR_BITS + AVATAR_SIZE_BITS * log2(reach) + AVATAR_DETAIL_BITS * log2(detail / AVATAR_DETAIL_FREE))

An avatar event is paid when its nonce tag’s committed target is at least avatar_work(content) and its id carries at least target leading zero bits. Both conditions are required: committing the target before mining is what stops a lucky id from being claimed against a lower bar than it was mined for (NIP-13).

Verification: parse the content, compute avatar_work, read the nonce tag, count the id’s leading zero bits, apply the two conditions. One hash and a walk over the vertices, on any device.

Drawing (normative): a client MUST NOT draw an avatar event that is not paid, or that carries content it cannot read; it draws its default avatar for that identity instead. A client SHOULD draw a paid avatar at true scale, one model unit as 2^unit gibsons, wherever it would draw the default.

Why the price is shaped this way (non-normative). Reach is priced at two bits per doubling, so a shape twice as far across costs four times the work, and the ladder it makes is: one gibson 16 bits, two gibsons 18, four 20, sixteen 24, a thousand 36, and one the size of cyberspace about 190, which is to say never. Reach is the term that matters to other people, since a large avatar is the one that gets in everyone’s way, and the slope is set so that a modest shape of a few gibsons costs minutes on a phone while a sector-sized one is out of reach of any hash power. Detail is priced at three bits per doubling beyond thirty-two vertices and faces, because a busy small avatar troubles nobody much, and because bytes are charged already without a term: every nonce hashes the whole serialized event, so an avatar at the vertex and face caps runs about thirty times more slowly per try than a plain one. The sixteen-bit floor is seconds on a phone today and is set with a hundred-year horizon of growing hash power in mind; it is the one constant this section expects to be revisited. Reach is measured from the build origin, not from the shape’s own centre, so a shape is priced as its builder placed it against the reference avatar on the bench.

Reference implementations: avatar.ts in cyberspace-core and cyberspace_core/avatar.py in cyberspace-cli, pinned to one set of golden vectors.

8.11 Virtual brackets (normative)

A virtual bracket is a stretch of an identity’s own movement chain in which the identity plays a game instead of moving through cyberspace. It opens with an enter-virtual action and closes with an exit-virtual action. Every action between the two belongs to the game, and none of them moves the identity in cyberspace: the identity’s position stays where it was when it entered, and the exit-virtual action puts it back there. The protocol does not define what a game is. A game is identified by a pubkey of its own, which every entry names (§8.11.1). What its actions mean, who has won and what an exit costs are the game’s to decide, and the base protocol never consults them (§8.11.7).

A bracket is opaque to the base protocol. The base protocol checks how a bracket opens, that the events inside it are linked and use no reserved action name, and how it closes. It reads nothing else inside the bracket: whatever coordinates, moves or tags a game puts on its actions are the game’s (§8.11.4, rule 4).

Why a bracket and not a second chain: An identity has one chain and one position (§3). A second line of events for the same pubkey is either a respawn, which ends the chain the identity has, or a fork, which kills it (§8.7.3), so a game played on a separate chain would cost the identity all of its travel. Entering a game therefore extends the chain the identity already has. Any reader can tell from the chain itself whether the identity was in a game at any point, with no registry and no new cryptography, and the identity keeps every hop, sidestep and ride it made before and after the game.

8.11.1 Enter-virtual event

Required tags:

  • A tag: ["A", "enter-virtual"]
  • e genesis: ["e", "<spawn_event_id>", "", "genesis"]
  • e previous: ["e", "<previous_event_id>", "", "previous"]
  • c tag: ["c", "<prev_coord_hex>"]: the identity’s position in cyberspace when it enters, which is the C of the nearest recognized action before it (§8.9). This is its position for the whole bracket (its base position).
  • C tag: ["C", "<coord_hex>"]: MUST equal the c tag. Entering a game does not move the identity, just as boarding hyperspace does not (DECK-0001 §3.1). Where the identity starts inside the game, if the game has such a thing, is the game’s to say, in a tag the game defines.
  • region tag: ["region", "<coord_hex>", "<H>"]: the aligned cube the game is played in, declared in the clear (below)
  • p tag marked game: ["p", "<game_pubkey>", "<relay_hint>", "game"]: the game’s identity, a 32-byte lowercase hex pubkey. An enter-virtual action MUST carry exactly one p tag marked game. relay_hint MAY be an empty string.
  • Sector tags: X, Y, Z, S computed from C, which is the base position (per §10). Each MUST appear exactly once. Missing sector tags, a sector tag that appears more than once, or values that do not equal the ones computed from C, make the event invalid.

The region (normative): The region is an aligned cube of height H, in the same terms as a hint box whose three heights are equal (§7.7):

  • H: an integer in [0, 85], written as a decimal string with no sign and no leading zeros except "0"
  • coord_hex: the 256-bit coordinate of the cube’s base (bx, by, bz, P), encoded per §2.2, 32-byte lowercase hex. It MUST be the aligned base: the low H bits of each axis MUST be zero.
  • the region is [bx, bx + 2^H) × [by, by + 2^H) × [bz, bz + 2^H) on plane P
  • a coordinate (x, y, z, p) lies inside the region when p = P and x >> H = bx >> H, y >> H = by >> H and z >> H = bz >> H

A base verifier checks the region for form only: the tag has the shape above, the base is aligned, and H is canonical. It does not check that the base position, or any coordinate a game puts on its actions, lies inside the region. The base protocol does not require the base position to lie in or near the declared region, so an identity can play a game without traveling to it. What the region means for the game’s actions is the game’s to decide.

Proximity is the game’s (non-normative): A game that wants its players to be near the place it is played enforces that itself, for example by checking that a player’s chain head lies within some distance of the region before it honors the player’s entry. This proximal validation is optional. It belongs to the game, and to the future Games DECK (DECK-0002, §8.11.7), and it has no effect on the validity of any chain under the base protocol.

Why the region is declared in the clear: Any reader, including a client that has never heard of the game, can then see where the game says it is played, and a client can draw that box while the identity is inside it (§8.11.7). A lookup_id (§7.2) is a hash, and it names a region only to someone who has already computed that region’s key, so it cannot serve this purpose. Publishing the box gives away nothing the game did not choose to say.

Why a game is named by a pubkey: A pubkey is unique without a registry, and a name chosen freely is not: two games that both call themselves “chess” would each read the other’s players as their own. A pubkey also gives the game a way to act. A game that needs to sign events, to rule as an arbitrator, publish results or admit players, signs them with that key. The pubkey is carried in a p tag because relays index only tags whose name is a single letter, so a game finds every entry that names it by asking relays for kind 3333 events that tag its pubkey, and then follows each player’s chain by author. The game marker says why the pubkey is tagged.

8.11.2 Virtual actions

Every event on the chain after an enter-virtual action, up to and not including the exit-virtual action that closes it, is a virtual action.

Required tags:

  • A tag: ["A", "<action_name>"]: a name of the game’s choosing. It MUST NOT be a name reserved by rule 3 below, which at this revision are hop, sidestep, enter-hyperspace, hyperjump and enter-virtual. An event any of whose A tags is spawn is never a virtual action: it is a spawn (§8.7.3, rule 1), and a spawn is never a link (§8.7.3, “A spawn is never a link”), wherever it is published (§3.2).
  • e genesis and e previous, as for a hop (§8.4)

A virtual action carries no base proof and costs no base work. Everything else on a virtual action belongs to the game. A game MAY require tags of its own on its actions, including c and C tags and sector tags with whatever meaning the game gives them. The base protocol neither requires nor checks a virtual action’s c, C or sector tags (§8.11.4, rule 4).

Why base actions are invalid inside a bracket: Base verifiers check a list of names they already know: the actions of the base protocol and of the mandatory DECKs. A game reads the names it chose. Neither needs the other’s knowledge, and no reader can mistake a move made inside a game for travel through cyberspace. A game that wants to score real travel reads the real chain outside any bracket instead.

Why the bracket is opaque: Games define their own movement, or none. A chess game or a card game has no positions in space at all, and a game that has them decides for itself what they mean, how far a player can go in one action and whether the box binds its players. A base rule about coordinates inside a game would either rule such games out or check numbers that mean nothing to them. The base protocol therefore holds the identity’s position in cyberspace for the whole bracket and checks only the parts it owns: the entry, the links, the reserved names and the exit. How clients draw what happens inside a game is not a base matter. It is reserved, with the recommended primitive game actions and their shapes, control definitions and every other game matter, for the Games DECK (DECK-0002, decks/README.md), which is not yet written.

8.11.3 Exit-virtual event

Required tags:

  • A tag: ["A", "exit-virtual"]
  • e genesis: ["e", "<spawn_event_id>", "", "genesis"]
  • e previous: ["e", "<previous_event_id>", "", "previous"]: the last virtual action, or the enter-virtual action itself when no virtual action came between
  • e entry: ["e", "<enter_virtual_event_id>", "", "entry"]: the enter-virtual action this closes
  • C tag: ["C", "<coord_hex>"]: MUST equal the c tag of the enter-virtual action. This is the base position, restored.
  • Sector tags: X, Y, Z, S computed from C, which is the base position (per §10). Each MUST appear exactly once. Missing sector tags, a sector tag that appears more than once, or values that do not equal the ones computed from C, make the event invalid.

Optional tags:

  • c tag: ["c", "<coord_hex>"]. An exit-virtual action MAY carry a c tag, for example the identity’s last position inside the game, with whatever meaning the game gives it. A base verifier does not check it (§8.11.4, rule 4).

The exit’s c is never read (normative): Base verification never reads the c tag of an exit-virtual action. A c tag on an exit that is missing, malformed, empty, or carried more than once therefore never makes the exit invalid, and the rule that every tag the chain rules read appears exactly once (§8.8) does not apply to it. The exit’s base position is its C, which is read and MUST equal the c of its enter-virtual action (§8.11.4, rule 2).

Why the exit’s c is free (non-normative): The inside of a bracket belongs to the game, and an exit’s c describes where the identity was inside the game, if anywhere. A game may use it however it likes, or not at all, and nothing about it can change where the base protocol puts the identity.

8.11.4 Rules

  1. The base position is held. From an enter-virtual action up to and including the exit-virtual action that closes it, the identity’s position in cyberspace is the c tag of the enter-virtual action, which its C repeats. Virtual actions do not change it, whatever coordinates they carry.
  2. The exit restores it. The C of an exit-virtual action MUST equal the c of its enter-virtual action. The next action after the exit names the exit as its e previous, and its c is that restored position, as for any action (§8.9).
  3. No base actions inside. An event inside a bracket whose A tag names an action of the base protocol or of a mandatory DECK, in the chain rules revision the verifier implements (§8.12), is invalid, and the chain is invalid from that event, as with any other invalid event. At this revision those names are hop, sidestep, enter-hyperspace, hyperjump and enter-virtual; a spawn is never inside a bracket (below), and an exit-virtual action closes it (rule 6). These names are reserved: a game MUST NOT use them for its own actions, and when a new mandatory DECK enters the chain rules through a new revision, its action names are reserved inside brackets too. Brackets therefore do not nest.
  4. The inside belongs to the game. Inside a bracket the base protocol checks only that each event is linked (it carries exactly one e genesis tag, which names the current spawn, and exactly one e previous tag, which names the event before it, each with a well-formed value, §8.8), that it carries exactly one A tag, with a value (§8.8), and that its name is not reserved (rule 3). The c, C and sector tags of virtual actions are neither required nor checked, and neither is the c of the exit-virtual action, which is never read, so a missing, malformed or duplicated one never makes the exit invalid (§8.11.3). Continuity (§8.9) stops at the enter-virtual action and resumes after the exit-virtual action, from its C.
  5. Names a game does not use are ignored. A base verifier does not know the game and cannot know which names it uses, so it treats every name inside a bracket that rule 3 does not reserve as a virtual action and checks only what rule 4 lists. A game ignores a virtual action whose name it does not use: that action has no effect in the game, and it does not end the chain or make it invalid.
  6. An exit closes the open bracket and nothing else. An exit-virtual action is invalid when no bracket is open, when its e entry tag names anything but the open enter-virtual action, or when it carries no e entry tag or more than one (§8.8), and the chain is invalid from that event.
  7. An unclosed bracket is legal. A chain MAY end inside a bracket. The identity’s position in cyberspace is then the c of its open enter-virtual action.
  8. A bracket is transparent to rules that look back. Where a rule depends on the action before an event (for example DECK-0001 §4.3, which says what a hyperjump may follow), an exit-virtual action stands for the action before its enter-virtual. Work is still seeded by the actual previous event: the first hop after a bracket derives its temporal axis from the exit-virtual action’s id (§5.3).

A respawn is never inside a bracket. A spawn is never a link, whatever e tags it carries (§8.7.3, “A spawn is never a link”), so it starts a new chain wherever it is published, including while a bracket is open (§3.2, §8.7.3), and a bracket left open on the old chain stays in that chain’s history. The identity has then left the game without an exit: no exit-virtual action closes the bracket, and what that means is the game’s to decide, as for any exit (§8.11.7).

8.11.5 Verifying a bracket (base)

A base verifier checks a bracket as a unit. To verify a bracket, it:

  1. Checks the enter-virtual action: it carries exactly one A tag (§8.8), and every other tag it reads exactly once with a well-formed value (§8.8); its c equals the C of the nearest recognized action before it (§8.9); its C equals its c (§8.11.1); it carries each sector tag exactly once, with the value computed from its C (§10); it carries exactly one p tag marked game, holding a 32-byte lowercase hex pubkey; and its region tag is well formed, with an aligned base and a canonical H (§8.11.1).
  2. Checks each following event, until an exit-virtual action or the end of the chain: it is linked, with exactly one e genesis tag, naming the current spawn, and exactly one e previous tag, naming the event before it (resolution already guarantees that the first copy of each names the right event, §8.7.3, and a second copy of either makes the event invalid, §8.8); it carries exactly one A tag, with a value (§8.8); and that tag is not a reserved name (rule 3). Nothing else about it is checked (rule 4).
  3. Checks the exit-virtual action: it carries exactly one A tag, exactly one e genesis, e previous and e entry tag, and every other tag it reads exactly once, each with a well-formed value (§8.8); its e entry tag names the open enter-virtual action (rule 6); its C equals that action’s c (rule 2); and it carries each sector tag exactly once, with the value computed from its C (§10). Its c is not read, so nothing about it can make the exit invalid (§8.11.3).
  4. Continues ordinary verification after the exit-virtual action, whose C is the identity’s base position: the c of the next recognized action MUST equal it (§8.9).

A base verifier checks the game’s p tag and the region tag only for form. It does not contact the game, it does not check that anything lies inside the region, and it does not check virtual actions against the names the game uses; that is the game’s work (§8.11.7).

8.11.6 What a bracket does not do (non-normative)

  • It does not hold stakes. An exit-virtual action is always valid under the base protocol, so an identity can leave a game at any moment, including in the middle of losing it. A game that has stakes decides for itself what an exit means, for example that an exit while contested counts as a loss (§8.11.7). The protocol will not hold anyone in a game.
  • It does not claim the region. Any number of identities, playing any number of games, can hold brackets in the same region at once. Declaring a region is a statement of where the game is played, not a claim on it (§6.12, §7.8).
  • It cannot be erased by a later branch. A branch that names an event before the bracket as its previous forks the chain, and a fork kills the chain (§8.7.3). No one can remove a bracket that was already published and keep the chain alive, not even the identity itself.

8.11.7 Games and clients

The protocol defines the bracket and nothing about the game played inside it. These rules are for games, and for clients that draw brackets.

  • Advertising (recommended): A game SHOULD advertise the region it is played in, so that players can find it. The protocol defines no mechanism for this: a game may say so in its own profile, on a web page, or anywhere else.
  • Liveness (normative for games): Whether a player is still in play, what they hold and whether they have won is the game’s liveness, which the game owns and the base protocol never consults (decks/README.md, Game mechanics). A game MUST NOT decide any verdict by created_at.
  • Leaving (normative for games): A game whose outcomes carry stakes MUST say in its rules what an exit means, for example that an exit while contested counts as a loss. A respawn while a bracket is open leaves the game without an exit-virtual action (§8.11.4), and the game’s rules SHOULD say what that means too.
  • Drawing (recommended): Clients SHOULD draw an identity inside a bracket at its base position, where the protocol holds it, and SHOULD draw the bracket’s region while the identity is inside it. A client that also draws positions inside a game, where the game defines them, SHOULD draw them differently from positions in cyberspace, so that a viewer never mistakes play inside a game for travel.
  • Live play off the chain (permitted): A game MAY carry live play in events of other kinds, for example ephemeral events, so that moves reach other players without waiting for chain events. Such events are never chain events (§8.7.3, Chain events): they are never on any identity’s chain, the base protocol never reads them, and they cannot move an identity or make a chain invalid. What they mean is the game’s to say.
  • The Games DECK (reserved): DECK-0002 is reserved for a future Games DECK (decks/README.md). It will define recommended primitive game actions and their shapes, control definitions such as onscreen controls and key bindings, and all other game matters, including how clients draw games. It is not yet written, and nothing in this section depends on it.

Open (non-normative): meetings between players inside one bracket, such as two players proving they stood in the same place at once, wait for the encounter primitive: a contact event in which two chains reference each other’s heads. It is a design note and is not yet specified (docs/territory-conflict-game-layer.md §4.1, work list item 10).

8.12 Chain rules revision (normative)

  • CHAIN_RULES_REVISION = "2026-10-08-residue-openings"

The chain rules are the rules that decide which movement chains are valid and which event is an identity’s position: §3.2, §8.3 to §8.5, §8.7, §8.8 (exactly one A tag, and each tag the chain rules read exactly once with a value), §8.9, §8.11, and §10 for the sector tags of movement events, together with the chain rules of every mandatory DECK. A DECK is mandatory when its actions can change an identity’s position (§8.9); at this revision the only mandatory DECK is DECK-0001. A verifier SHOULD state the revision it implements, so that two verifiers that disagree about a chain can see whether they are running the same rules.

RevisionChanges
(unnamed, before 2026-09-28)Chains as defined by §3.2 and §8.3 to §8.7.2, with sidestep proofs of version 2 (§6.15). Forks were not resolved by the base protocol.
2026-09-28-virtual-bracketsSidestep proofs of version 3, with the re-roll price and the grandfathered list (§6.16). DECK-0001 (hyperspace) made mandatory, with ride openings of version 2 (DECK-0001 §5.8). The fork rule (§8.7.3). Virtual brackets (§8.11). Movement is universal: a DECK whose actions change an identity’s position is mandatory, an action a verifier does not recognize is skipped, and a position change across skipped actions makes the chain invalid (§8.9). Folded in on 2026-10-07: events that are not authentic (an invalid NIP-01 id or signature, or another author) are discarded before resolution, and a branch through one is cut off (§8.7.3); the newest spawn wins even when it is invalid, with no fallback to an older spawn (§3.2, §8.7.3); an invalid chain is frozen at its last valid position until the identity respawns (§3.2, §8.7.3); every event carries exactly one A tag (§8.8); a skipped action is checked only for being authentic, linked and carrying one A tag (§8.9); a virtual bracket is opaque and checked as a unit, its entry does not move the identity, and nothing inside it but links, the A tag and reserved names is checked (§8.9, §8.11); rule 3 of §8.11.4 reserves every action of the base protocol and of a mandatory DECK (§8.11.4); sector tags count toward the validity of every base and mandatory DECK action (§10, §8.3 to §8.5, §8.11.1, §8.11.3, DECK-0001 §1.3); and there is no zero-length ride (DECK-0001 §5.2, §5.6, §5.8). Clarified on 2026-10-08: an event without a valid signature is discarded even when it was never published (§8.2); each sector tag appears exactly once (§10); and the base position need not lie in or near a bracket’s region (§8.11.1). Folded in later on 2026-10-08: a fork kills the chain, which is invalid from the spawn, and the identity stands at its spawn coordinate until it respawns; this replaces the rule that the branch signed first continues the chain, and the clarification of the same day that an earlier invalid branch continues it (§3.2, §8.7.3, §8.11.6, DECK-0001 §8); clients MUST confirm they hold the live head before signing (§8.7.3); only kind 3333 events take part in resolution (§8.7.3, Chain events); an event is a spawn when any of its A tags is spawn, and a spawn with a second A tag is invalid (§3.2, §8.7.3 rule 1, §8.11.2); every chain event after the spawn carries exactly one e genesis and one e previous tag, and an exit exactly one e entry tag, while resolution follows the first copy of each (§8.7.3, §8.9, §8.11.4, §8.11.5); every tag the chain rules read appears exactly once with a well-formed value, and an empty or valueless tag counts as a malformed one (§8.8, DECK-0001 §8); the c of an exit-virtual action is never read and never makes the exit invalid (§8.11.3, §8.11.4); a spawn is never a link, whatever e tags it carries, so it never extends or forks a chain and is never a virtual or skipped action (§8.7.3, §8.8, §8.11.2, §8.11.4); and the network for chain validity is Bitcoin mainnet, always, and a net tag on an action is never read (§8.8, DECK-0001 §1.4).
2026-10-08-residue-openingsEverything in 2026-09-28-virtual-brackets, with hop proofs of version 2: residue openings (§5.9 to §5.11, §5.13). A hop’s proof tag carries the seal over its residues instead of the proof_hash of §5.6, and a hop carries the mn and mp tags, each read exactly once (§8.4, §8.7.1, §8.8). The re-roll budget table of §5.10 is part of these rules. Version 1 hops are invalid, except those listed by event id in grandfathered-v1-hops.txt, whose proof is accepted without recomputation while everything else about them is checked; there is no date cutoff, and the list is filled from the final census of version 1 hops at the cutover (§5.13).

Golden vectors (normative): The golden vectors in chain-rules-2026-09-28-virtual-brackets.json, in this repository, lock the chain rules of revision 2026-09-28-virtual-brackets. The reference implementation (§14) generated them. A verifier conforming to that revision MUST reach every vector’s verdict, its position and, for an invalid vector, its invalid_at. For an invalid vector, position is the last valid position, where the identity stands frozen. The file’s reasons field names the rule that each reason code stands for. A port runs every vector in full and skips none. This is possible because every signature and proof in the vectors is real and cheap to check, and because the vectors need no real Bitcoin data. Only the hyperspace actions of DECK-0001 (enter-hyperspace and hyperjump) use block data. In the vectors they point at the synthetic block line in line.blocks instead of Bitcoin mainnet (DECK-0001 §1.4). A verifier uses that line in place of Bitcoin mainnet when it runs the vectors, and at no other time. A verifier MUST check DECK-0001 §5.6 before a ride’s proof, because the two zero-length ride vectors carry proofs that no Level 1 check can verify.

Golden vectors of 2026-10-08-residue-openings (normative): The golden vectors in chain-rules-2026-10-08-residue-openings.json, in this repository, lock the chain rules of revision 2026-10-08-residue-openings. To lock a revision means that a verifier conforms to that revision only if it reaches every vector’s verdict. The file named in the Golden vectors (normative) paragraph above locks revision 2026-09-28-virtual-brackets in the same way. The reference implementation (§14) generated both files.

What a chain-rules vector is: A chain-rules vector, or golden vector of the chain rules, is one signed, synthetic movement chain, together with the verdict that the chain rules give it.

  • Signed means that every event in the chain is a complete nostr event, with a real id and a real signature. The events are signed with test keys. The file gives the derivation of each key (test_key, other_key), and it also gives the secret key of test_key.
  • Synthetic means that the chain was generated for testing. Most events in these chains have nothing to do with Bitcoin. The exceptions are the hyperspace actions of DECK-0001: boarding the line (enter-hyperspace) and riding it (hyperjump, a ride). Those actions point at blocks on the Bitcoin block line (DECK-0001 §1.4). In these vectors they point at eight made-up blocks instead of real Bitcoin blocks. The made-up blocks are listed in the file’s line.blocks field, called the synthetic block line, each with a height, a block hash and a Merkle root. A verifier uses that line in place of Bitcoin mainnet when it runs the vectors. As a result the vectors are self-contained, and every verifier gets the same answer without fetching Bitcoin data.

The verdict says whether the chain is valid, at which position the identity stands, and, for an invalid chain, at which event the chain breaks. The vectors are in the file’s vectors field.

Version 1 hops and listed hops: A version 1 hop is a hop whose proof tag is the proof_hash of §5.6, and which carries no mn tag and no mp tag (§5.13, §8.4). This revision rejects a version 1 hop unless the hop is listed. A listed hop is a version 1 hop whose event id is on the list of version 1 hops that §5.13 exempts. Outside a run of the vectors, that list is grandfathered-v1-hops.txt. The proof of a listed hop is accepted without being recomputed, and everything else about the hop is still checked (§5.13).

An example vector: Here is one vector from the file. Its four events, and the first, second and fourth ids in chain, are shortened to placeholders. The third id in chain is shown in full, because it is the same id as invalid_at:

{
  "name": "hop-version-1-unlisted",
  "spec": ["5.13", "8.4", "3.2"],
  "description": "A version 1 hop (its proof the 5.6 proof_hash of this very hop, no mn and no mp) whose id is not on the list. This revision rejects it, so the chain is invalid from it and frozen at the hop before, and the valid version 2 hop after it does not move the identity.",
  "events": ["<spawn>", "<version 2 hop>", "<version 1 hop>", "<version 2 hop>"],
  "expected": {
    "valid": false,
    "chain": ["<event id>", "<event id>", "f3ce377ca71bb89fbc7f343a92432dd46bf0d670e357827040f2e4653d1ed52b", "<event id>"],
    "position": "73e16910c65f371bfed61e3d953925a286c34a1fd8aaf5644b0d318448b39ba7",
    "reason": "hop-proof",
    "invalid_at": "f3ce377ca71bb89fbc7f343a92432dd46bf0d670e357827040f2e4653d1ed52b",
    "invalid_index": 2
  }
}

In this vector the third event is a version 1 hop that is not listed. The chain is therefore invalid from that event. invalid_at is that event’s id, and invalid_index is its index in chain. position is the position of the hop before it, where the identity stands frozen. reason is a code, and the file’s reasons field says which rule each code stands for. Here the code is hop-proof, which the file explains as a hop that does not verify at Level 1 (§8.7.1, §5.11). An unlisted version 1 hop is one such hop. §8.7.1 step 7 requires mn and mp of any hop that is not listed, and a version 1 hop has neither.

What a conforming verifier does with them: Everything that the Golden vectors (normative) paragraph says of the vectors of 2026-09-28-virtual-brackets holds for these vectors too:

  • A verifier conforming to this revision MUST reach every vector’s verdict, its position and, for an invalid vector, its invalid_at. For an invalid vector, position is the last valid position, where the identity stands frozen.
  • The file’s reasons field names the rule that each reason code stands for.
  • A port runs every vector in full and skips none.
  • For the hyperspace actions of DECK-0001, the synthetic block line in line.blocks takes the place of Bitcoin mainnet when a verifier runs the vectors, and at no other time.
  • A verifier MUST check DECK-0001 §5.6 before a ride’s proof.

The hops in these vectors: Every hop in these vectors carries residue openings, the version 2 hop proof (§5.9 to §5.11). There are two exceptions: a version 1 hop, and a hop whose openings a vector removes or damages on purpose.

A verifier derives a hop’s residue count m, its depth and its price A from the event itself, from the hop’s coordinates and its terrain height K, and not from its tags (§5.9, §5.10, §8.7.1 step 6). For every hop in these vectors, those values are the smallest that a hop can have:

  • m = 8 residues, which fill one residue block (§5.10). A residue block is a group of 8 residues that the hop proof hashes into one leaf of its own Merkle tree. It has nothing to do with Bitcoin blocks;
  • a depth of 0. The seal is the root of the hop proof’s Merkle tree, built over its residue leaves, and it is the value of the hop’s proof tag. A tree of a single leaf has depth 0, and its seal is that leaf;
  • a price of A = 1.

With these values, the mp tag of a version 2 hop whose openings are intact is 2,048 hex characters: 16 openings of 64 bytes each, with no sibling hashes (§5.10). The same smallest values hold for the version 1 hops too. A verifier derives the same values from a version 1 hop’s coordinates and its terrain height K, but a version 1 hop carries no residues for it to check. These smallest values keep every hop cheap to check.

The test list: The file also carries a test list of version 1 hops. The test list is the array of event ids in the file’s grandfathered_v1_hops.ids field:

"grandfathered_v1_hops": {
  "description": "The test list: ...",
  "ids": ["5ee54472bf8d2e3cbf45ec3db2a127c328363b0a9adb196d0bdff3e6f5f0086b", "..."]
}

A verifier MUST use the test list in place of grandfathered-v1-hops.txt when it runs the vectors, and at no other time.

The reason is that the vectors that lock §5.13 need version 1 hops that are listed. No real list names a synthetic event, so the vectors bring their own list. Each id on the test list is a version 1 hop signed by the vectors’ test key. A verifier that runs the vectors with the real list instead finds those hops unlisted, and fails those vectors.

The test list is not a second exemption. Outside a run of the vectors, grandfathered-v1-hops.txt is the only list, as §5.13 says. The test list does for §5.13 what line.blocks does for DECK-0001 §1.4. The test list stands in for grandfathered-v1-hops.txt. line.blocks stands in for the Bitcoin block line that the hyperspace actions point at. Each does so only while the vectors run.

Each revision has its own file: Neither file is a set of vectors of the other revision.

  • The vectors of 2026-09-28-virtual-brackets carry version 1 hops. This revision rejects version 1 hops unless they are listed in grandfathered-v1-hops.txt (§5.13). Those vectors are therefore not vectors of this revision.
  • The vectors of this revision carry version 2 hops, which 2026-09-28-virtual-brackets rejects. These vectors are therefore not vectors of that revision.

A verifier runs the file of the revision it states.

How the two files relate: Every vector of the earlier file is also in the later file, under the same name. Its verdict is the same, apart from the event ids it names. The two files differ in the hops, because the hops are where the two revisions differ. They also differ in what follows from the hops:

  • the ids of the hops, and the ids of every event after them;
  • the proofs of the rides after them, because those proofs are seeded by those ids.

The golden vectors of §5.10 lock the hop proof itself, at sizes that the chain vectors never reach. hop-residue-vectors.json (§14) carries them as machine-readable values.

Note (non-normative): the rulings of 2026-10-07 and 2026-10-08 were folded into 2026-09-28-virtual-brackets rather than named as a new revision, because no verifier had shipped claiming that revision when they were made. A chain signed before 2026-10-07 can be invalid under the rulings of that day, for example because its sector tags do not match its C; such a chain is frozen at its last valid position like any other invalid chain (§8.7.3). A chain signed before 2026-10-08 can be invalid under the rulings of that day, for example because it forked, and a forked chain is dead from its spawn (§8.7.3, rule 4).

Note (non-normative): residue openings are a new revision, not a ruling folded into 2026-09-28-virtual-brackets, because they change what a hop proof is. A verifier of 2026-09-28-virtual-brackets rejects every hop of version 2, and a verifier of 2026-10-08-residue-openings rejects every unlisted hop of version 1, so the two revisions disagree about chains, and the revision a verifier states is what tells two such verifiers apart.

Note (non-normative): the GPS mapping has its own version string (§9.5). The two are independent: a change to the mapping moves places, and a change to the chain rules changes which chains are valid.


9. Mapping to Physical Reality: GPS and Dataspace

9.1 Why a physical mapping exists

Dataspace (plane=0) maps WGS84 GPS coordinates (latitude/longitude/altitude) into the u85 axis space. This creates a cryptographic overlay on the physical world where Cyberspace coordinates correspond to actual locations on and around Earth.

This mapping is consensus-critical: if multiple clients are expected to agree on the same coord256 for a given GPS point, they must all use the exact same deterministic algorithm.

The mapping applies only to dataspace. Ideaspace (plane=1) has no GPS mapping.

9.2 Dataspace cube size (Cantor Height 34 scale)

The Cantor Height 34 scale defines the relationship between dataspace coordinates and physical distances:

  • Full axis length: ~4.5 trillion kilometers (~0.48 light-years)
  • Half axis length: ~2.25 trillion kilometers
  • Gibson size: ~1.16×10⁻¹⁰ meters (approximately the diameter of a hydrogen atom)
  • Cantor Height 34 = 2 meters (the canonical scale parameter)

This scale provides “atomic” granularity in dataspace while maintaining axis extents that vastly exceed the geosynchronous orbit requirement. The universe starts small and extends far.

9.3 Scale rationale (non-normative)

The Cantor Height 34 scale was chosen through rigorous testing to balance several concerns:

For consumers: At this scale, consumer hardware can traverse human-centric distances and derive useful location-based secrets with significant but achievable effort. Moderate cloud compute expenditure ($200–$1,000) extends range substantially.

Against nation-states: Cantor root cost scales with the side length of the aligned cube, per axis (85 × 2^h bits): a person (h34) is 182 GB, a 7 km city (h46) is 748 TB, a 262 km country (h51) is 24 PB, an Earth octant (h57) is 1.5 EB, and the GEO cube (h60) is 12 EB, against roughly 10 to 20 ZB of installed world storage. A country-scale root is within reach of a well-funded organization today and an Earth-scale root is within reach of a hyperscaler or a state. This is structural rather than a calibration choice: a country is only 2^17 times wider than a person, while the storage gap between a consumer and a state is about 2^20, so any scale that keeps human-scale hops feasible for consumers keeps country-scale roots feasible for states. The scale therefore does not deliver a century-long guarantee against large regions being held. Holding a region costs disk for as long as it is held (§7.8), which is the protocol’s whole maintenance economics; claims, exclusion and governance are not protocol matters and are left to applications and games.

The gap is fixed, and the calibration cannot widen it (non-normative). The argument above is right and can be made exact. A root is 85 × 2^h bits per axis, so the highest height a storage budget B reaches is h_max ≈ log2(B) − 6.018. The calibration term does not appear in that equation and cannot: the calibration maps heights to meters, the cost function maps heights to bytes, and the two compose without interacting. The distance between what an individual reaches and what a state reaches is therefore log2(B_state / B_consumer) whatever the calibration. Measured at 16.7 heights for a mainstream desktop, 13.0 for an enthusiast rig and 22.0 for a phone. Changing the calibration slides a window of fixed width; it never widens it, and which consumer you mean moves the answer by 9 heights, which is more than any calibration change ever proposed here.

The shelf life, with a number (non-normative). On central storage-growth assumptions a one billion dollar budget reaches the root of the whole Earth around 2045, or 2036 optimistic, or never if the 2025 to 2026 storage price reversal proves permanent. Every ceiling past about one day of patience is capacity-bound, so compute growth barely moves these dates and storage price is the only sensitive input. No calibration changes them meaningfully, because the window is rigid.

Changing the calibration is not a hard fork (non-normative). It is one constant in §9.7 step 9. No chain is invalidated, no proof breaks, nobody respawns; it is a smaller break than the sidestep v2 change already shipped. The reason not to change it is therefore not difficulty but consensus: two incompatible Earths is worse than either Earth, and that reason does not expire. Anyone proposing a change should be answered with the paragraph above rather than with the cost of making it.

Aesthetics:

  • 2 meters is a metaphor for the human scale of the universe
  • Cantor Height 34 / 85-bit axis = 34/85 = 0.4 = 2/5, a rational and memorable relationship
  • Cantor Height 33 = 1 meter
  • 1 Gibson is roughly the size of a hydrogen atom, the first atomic element

No difficulty adjustment. Unlike Bitcoin, Cyberspace has no difficulty adjustment mechanism. The scale is fixed by mathematical definition. A coordinate’s Cantor tree is deterministic. It cannot be made “harder” without changing the coordinate itself. As technology advances, all parties gain greater computation and storage, gradually increasing the scale of territorial claims over time. The base protocol remains stable; difficulty migrates upward through extension mechanisms (DECKs) over decades.

9.4 Axis naming convention (ECEF → Cyberspace)

Starting from standard Earth-Centered Earth-Fixed (ECEF):

  • +X_ecef: (lat=0°, lon=0°)
  • +Y_ecef: (lat=0°, lon=+90°)
  • +Z_ecef: north pole

Cyberspace dataspace axis naming is:

  • X_cs = X_ecef
  • Y_cs = Z_ecef
  • Z_cs = Y_ecef

9.5 Canonical spec version and deterministic arithmetic

Spec version string (required):

  • CANONICAL_GPS_TO_DATASPACE_SPEC_VERSION = "2026-03-16-h34-corrected"

Canonical requirements:

  • Use decimal arithmetic end-to-end (no platform libm for trig).
  • Decimal context:
    • precision: 96
    • rounding: ROUND_HALF_EVEN
  • π constant: use this exact truncated decimal string:
    • PI_STR = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679"
  • Deterministic trig:
    • Termination epsilon: TRIG_EPS = 1e-88
    • Max iterations: TRIG_MAX_ITER = 256

9.6 Altitude handling (normative)

The canonical mapping is defined for latitude/longitude plus an optional altitude in meters.

  • If altitude is omitted, implementations MUST treat altitude_m = 0.
  • Implementations MUST support “clamp to surface” behavior that forces altitude_m = 0 (this is what the golden vectors cover).
  • If non-zero altitude is supported, altitude_m MUST be interpreted as meters above the WGS84 ellipsoid and processed using the same canonical decimal parsing rules.

9.7 Canonical mapping algorithm (normative)

  1. Parse inputs as decimals.

  2. Clamp latitude to [-90, 90].

  3. Wrap longitude to [-180, 180).

  4. Convert degrees→radians using PI_STR.

  5. Compute deterministic sin/cos using range reduction + Taylor series, terminating when abs(term) < TRIG_EPS.

  6. Convert WGS84 geodetic to ECEF (meters) using decimals (using altitude_m after clamping, if applicable).

  7. Convert meters→kilometers.

  8. Permute ECEF axes into Cyberspace axes per §9.4.

  9. Convert kilometers-from-center into u85 axis values:

    • units_per_km = 1000 * 2^33 (derived from Cantor Height 34 = 2 meters)
    • u = km * units_per_km + 2^84
    • round using ROUND_HALF_EVEN
    • clamp to [0, 2^85 - 1]

    Derivation: At Cantor Height 34 scale, 2^34 Gibsons = 2 meters. Therefore 1 Gibson = 2^-33 meters, and 1 km = 1000 * 2^33 Gibsons. This formula maps GPS coordinates into a region centered at u85 value 2^84 (the half-axis point).

  10. Produce coord256 with plane=0 using the interleaving in §2.

Note (non-normative): the three h85 planes. Because the mapping centers Earth at exactly 2^84 on every axis, the equatorial plane (Y_cs = 2^84) and the planes X_cs = 2^84 and Z_cs = 2^84 (the meridians at 0°/180° and ±90° longitude) are h85 boundaries: a one-metre step across the equator costs the same as crossing the whole axis. They behave like oceans, uncrossable on foot and crossed routinely through hyperspace (DECK-0001), whose landfalls sit on both shores. Only points within one last mile of a plane (about 0.75% of the surface at current landfall density) ever notice them. The centering is kept for symmetry; an offset of 2^56 would lower the walls to h57 and remains available as a future revision if landfall density is ever reduced.

9.8 Golden vectors (consensus locks)

An implementation of §9.7 MUST reproduce every vector below exactly. The mapping is consensus-critical (§9.1): two clients that disagree on a vector disagree on where a place is. Implementations SHOULD include the vectors as tests, to catch accidental drift.

These are the required vectors for spec version 2026-03-16-h34-corrected (hex is 32 bytes, no 0x prefix).

Golden vectors assume altitude_m = 0 with clamp-to-surface behavior enabled:

  • origin_equator_prime lat=0 lon=0
    • e000000000000000000001200041040208048040000000000000000000000000
  • equator_east_90 lat=0 lon=90
    • e000000000000000000000480010410082012010000000000000000000000000
  • equator_west_90 lat=0 lon=-90
    • c492492492492492492492012482082410480490000000000000000000000000
  • north_pole lat=90 lon=0
    • e000000000000000000000900004924920020000820000920100824920800020
  • london lat=51.5074 lon=-0.1278
    • c492492492492492492492edf5bee7267451c787d95ba4d7840c76d1e33c9940
  • nyc lat=40.7128 lon=-74.0060
    • c4924924924924924924921f79235dae293ada913e78294253a235239a332854

9.9 Consumer benchmarks (non-normative)

Cantor root cost scales with the side length of the aligned cube, per axis, not with its volume: a region twice as wide costs twice as much storage and somewhat more than twice the time. The root of a height-h subtree over 85-bit leaves is exactly 85 × 2^h bits, which is checkable at any small height and holds without rounding: each level of pairing doubles the operand width and halves the count.

On peak memory, corrected (non-normative). An earlier draft said construction needs “roughly two levels live at once”, which would make the peak about twice a root. Measured, the peak is about 6.1 times a root. Two levels live is the floor a perfect implementation would reach, not what a real one does: producing a level allocates the new values before the old ones can be released, the multiply itself needs working space of the same order as its operands, and a garbage-collected runtime holds both longer still. Size a machine against 6.1 roots, not 2.

RegionAligned heightRoot per axisConsumer feasibility
1 m cubeh3392 GBhours to a day on a desktop with a fast SSD
2 m cube (canonical)h34182 GBabout a day
4 m cubeh35370 GBdays
128 m blockh4012 TBexternal storage array, weeks

Notes:

  • A 50 m³ region is h35, twice the cost of h34, not fifty times. Volume-linear accounting overstates small claims and understates large ones.
  • Computation is parallelizable across axes and levels; storage and I/O bandwidth are the binding constraints.
  • Contiguous claims are significantly more efficient than discrete parcels due to Cantor subtree structure sharing.

9.10 Nation-state limits (non-normative)

Root sideHeightRoot per axisFeasibility
City (7 km)h46756 TBa well-funded organization
Country (262 km)h5124 PBa state or a large company today (about a million dollars of disks, days of I/O)
Earth octant (16,777 km)h571.5 EBa hyperscaler or a state
GEO cube (134,000 km)h6012 EBabout 0.1% of installed world storage
h70h7012.7 ZBroughly all installed storage today

The limiting factor on how high a party can go is storage capacity, and the protocol’s work equivalence property ensures the data cannot be optimized away. There is no ASIC advantage, because no chip removes the need to hold the intermediates. The limiting factor on how long it takes beneath that ceiling is arithmetic rather than I/O bandwidth: multiplying two n-bit numbers costs far more than one operation per byte, and the work is measured at about 28 times compute-bound. §13.2 says more. Sidestep travel (§6) is plain hash work and has no such protection; see §12.3.

9.11 Storage as the primary constraint (non-normative)

Cantor tree computation is memory-bound. At Cantor Height 34, a single subtree contains 2³⁴ ≈ 17 billion leaf nodes. The intermediate values cannot fit in RAM and must be streamed to disk.

This is intentional. Capacity is the equalizer (and see §13.2 on why the wait beneath the ceiling is arithmetic rather than bandwidth):

  • Consumer SSDs provide enough I/O for small roots
  • Nation-states have faster storage, but exponential growth limits scaling
  • There is no “ASIC advantage” because the bottleneck is data movement, not hash rate

The storage constraint ensures that territorial roots remain bounded by physical infrastructure, not just financial resources.


10. Sectors and Spatial Querying

A sector is a cube of 2^30 Gibsons per axis. Sectors exist to divide Cyberspace into manageable pieces and, critically, to allow proximal querying of public Cyberspace objects on Nostr relays.

On the index’s width. An axis runs to 2^85 Gibsons and a sector is 2^30 of them, so a sector index is 2^55 values wide and needs 55 bits per axis, not 32. An earlier draft of this paragraph said sectors “fit into u32 systems”, which is wrong by 23 bits; a u32 would cover only the first 2^32 sectors of 2^55 on each axis. The tag values in §10 are decimal strings and are unaffected, but an implementation storing a sector index in a 32-bit integer will silently wrap. Use 64-bit integers, or the strings themselves.

On what a sector is useful for. At the calibration of §9 a sector is 2^30 Gibsons, which is about 12.5 cm. A single-sector query therefore asks what is inside a box the size of a shoebox, and a single-axis query asks about a 12.5 cm slab through the whole universe. Proximal querying at a scale a person perceives, a room or a street, is not expressible as a sector query and needs a tag ladder at several heights, which this document does not define.

Because Nostr cannot query “prefix ranges” on tag values, per-axis sector tags make it possible to query slices along a single axis.

Given x_u85, y_u85, z_u85:

  • sx = x_u85 >> 30
  • sy = y_u85 >> 30
  • sz = z_u85 >> 30

All events that claim a coordinate MUST include the tags below, except virtual actions and skipped actions (below):

  • X tag: ["X", "<sx>"]
  • Y tag: ["Y", "<sy>"]
  • Z tag: ["Z", "<sz>"]
  • S tag: ["S", "<sx>-<sy>-<sz>"]

Tag formatting rules (normative):

  • sx, sy, sz MUST be encoded as base-10 integers (strings), with no leading + and no leading zeros (except "0").
  • S MUST be exactly "<sx>-<sy>-<sz>".

Movement events (kind 3333, normative): On every movement event whose action belongs to the base protocol or to a mandatory DECK, which at this revision are spawn, hop, sidestep, enter-hyperspace, hyperjump, enter-virtual and exit-virtual, the four sector tags above are REQUIRED, computed from the event’s C, and are part of the event’s validity. An event whose sector tags are missing, or whose values do not equal the ones computed from its C in the format above, is invalid, and the chain is invalid from that event (§8.7.3). Each of the four MUST appear exactly once: an event carrying two or more of any one sector tag (two X tags, for example, or two S tags) is invalid in the same way, exactly as an event carrying two A tags is, under the rule that every tag the chain rules read appears exactly once (§8.8). Sector tags are not required on the virtual actions inside a bracket, which the base protocol does not read (§8.11.4, rule 4), and they are not checked on skipped actions, whose tags belong to the DECK that defines them (§8.9).

Why sector tags count toward validity (non-normative): Relays index single-letter tags, and the sector tags are how a reader asks a relay what is in a sector or along a slice. A reader that asks for a sector receives the events whose tags say they are there, and it cannot tell from the query whether a tag tells the truth. If sector tags carried no weight, an identity could stand in one place while its events were indexed as somewhere else: hidden from everyone who looked where it stood, and shown to everyone who looked where it was not. Making the tags part of validity means that a movement event found by its sector is in that sector, or its chain is invalid. A client computes the tags from C as it publishes, so the rule costs an honest client nothing.

Encrypted content events (kind 33330): a bag without a hint claims no coordinate and carries no sector tags. A bag with a hint (§7.7) claims a box. It MUST carry the sector tag of each axis whose hint height is at most 30, computed from the box’s base, and S when all three are fixed. A relay query on #S, or on one axis tag, returns the hinted bags in a sector or a slice the same way it returns movement.


11. Visualization Conventions

This section defines canonical conventions for rendering Cyberspace coordinates in 3D visualizers. The goal is to ensure that different viewers agree on orientation (left/right, up/down, ahead/behind).

These conventions are about visualization only. They do not change coordinate encoding (§2) or movement proof verification (§4–§8).

11.1 Handedness and axis semantics

Implementations that render Cyberspace in 3D MUST preserve the Cyberspace axis semantics defined in §9.4 exactly.

Graphics-engine handedness and camera defaults are implementation details and MUST NOT change Cyberspace semantics.

When the viewer is oriented per §11.3:

  • +X_cs is screen-right.
  • +Y_cs is up.
  • +Z_cs is forward (toward the black sun / east reference marker).

11.2 Black sun reference marker

The “black sun” is a reference to the hacker haven in Neal Stephenson’s Snow Crash, one of the foundational works that inspired the Cyberspace Protocol. In Cyberspace, the black sun serves a simple practical purpose: it is a subtle guidepost so you know which direction you are facing. It is rendered as a purple circle marking the +Z_cs boundary of the coordinate space.

If a visualizer renders the black sun, it MUST place it on the +Z_cs boundary of the Cyberspace cube.

The +Z_cs boundary is the Z axis maximum, 2^85 - 1 (§2.1). The marker is placed at the center of that face:

  • black_sun_u85 = (x=2^84, y=2^84, z=2^85 - 1) in u85 coordinates
  • In physical units: black_sun = (x_km=0, y_km=0, z_km≈+2.25×10^12 km), one half-axis (approximately 0.24 light-years) from the cube center along +Z_cs

These two forms describe the same point. The physical frame of §9.7 is centered on the cube, so km=0 on each axis is u85 2^84, whereas u85 values are measured from the cube corner. Converting the km figures above with the §9.7 formula lands on the u85 coordinate above, up to the rounding in the km figure (the exact half-axis is 2251799813685.248 km).

The black sun is a directional guidepost for east (+Z_cs). Marker color SHOULD be purple. Marker shape (point/sphere/circle/disk) is implementation-defined.

The black sun marker MUST be visible in both planes. (The plane bit does not affect XYZ decoding; it only labels the plane.)

11.3 Camera convention (“facing the black sun”)

A visualizer MUST provide (either as its default view or as an explicit preset) a camera/view mode equivalent to:

  • View direction: looking toward +Z_cs.
  • Up direction: +Y_cs.
  • Screen-right direction: +X_cs.

This is the canonical interpretation used when describing a coordinate as “left/right”, “above/below”, or “ahead/behind” relative to the origin.

11.4 Engine adaptation

Different graphics engines have different defaults for camera forward direction and orbit-control behavior.

Implementations MUST use camera placement/orientation and/or a render-space transform so that the semantic rules in §11.1–§11.3 remain true, without mirroring or re-labeling Cyberspace axes.

For quick regression tests and cross-implementation debugging, see visualization_vectors.json in this spec repository.


12. Limitations and Threat Model (non-normative)

12.1 What the protocol provides

  • Single-location constraint (per keypair): A valid, linear movement chain makes forking detectable, and a fork kills the chain (§8.7.3), so an identity cannot hold two positions, or rewrite where it has been, and keep its chain.
  • Hop freshness: Every hop includes non-cacheable temporal work derived from chain context.
  • Work equivalence (for discovery): An entity must compute region preimages to derive discovery keys; there is no shortcut.
  • Auditable movement history: The chain provides an ordered trail of hops.
  • Locality imposition: Distance and regions become meaningful in a 256-bit address space.

12.2 What the protocol does NOT provide

  • Physical location proof: Dataspace mapping is deterministic, but it does not prove a body is physically at that GPS point.
  • Trusted identity / sybil resistance: One operator can control many keypairs.
  • Privacy by default: Movement events are public if published.
  • Traversal necessity for decryption: Region preimages can be computed directly without maintaining a movement chain.

12.3 Acknowledged attack vectors

  • Coordinate scanning: An observer can compute region preimages for arbitrary coordinates and query for content. This is considered acceptable because the work required is the same as for a traveler.
  • Chain abandonment: An entity may abandon a keypair and start fresh, or publish a new spawn event to restart their chain. Applications can require continuity/reputation at higher layers.
  • ASIC-accelerated sidesteps: Sidestep work is plain SHA-256 over short preimages. A purpose-built ASIC fleet crosses boundaries that consumers cannot: a 1 EH/s farm crosses h78 in about a week and a Bitcoin-scale fleet crosses h85 in about a day. The storage bound protects Cantor roots (claims and keys), not travel.
  • Key grinding: Spawning inside an aligned region of height h costs about 2^(3·(85−h)) key generations. Regions walled above roughly h75 can be spawn-camped by grinding; travel reaches about h50 and hyperspace reaches stop neighbourhoods; regions walled between h50 and h75 therefore have the strongest isolation the protocol offers. Applications should know which regime they are building in.

13. Structured Proof-of-Work (non-normative)

This section describes how the computational work in Cyberspace relates to physical reality and how it differs from traditional proof-of-work systems like Bitcoin.

13.1 A new class of proof-of-work

Bitcoin’s proof-of-work operates by grinding random nonces through SHA-256 until the output falls below a difficulty target. The work is real (it consumes electricity and generates heat) but the output is arbitrary. A valid Bitcoin hash proves that energy was spent. It does not encode any spatial or structural information. The hash is discarded after use.

Cantor pairing tree computation is a fundamentally different kind of work. The output is not arbitrary. When you compute a Cantor tree over a set of coordinates, the root you produce uniquely identifies that spatial region. It is a bijection. The root can be unpaired to reconstruct the entire tree. The proof of your movement is the mathematical fabric of the space itself.

Every Cantor root you compute becomes a stable region identifier that persists as useful infrastructure. It can be used for encrypting localized secrets, discovering nearby content, and holding a region (§7.8). The work product is meaningful, not disposable.

13.2 Capacity-bound, and compute-bound within it

Bitcoin’s proof-of-work is compute-bound. Faster chips produce more hashes per second, and specialized hardware (ASICs) can be built to optimize SHA-256 throughput. The bottleneck is hash rate.

Cantor work is storage-bound. The Cantor pairing function produces intermediate values that grow exponentially in bit size. At height 34, the intermediates require approximately 182 GB of storage. At height 40, approximately 11 TB. At height 50, approximately 11 PB. These intermediates must physically exist on disk during computation because parent nodes require both children during bottom-up tree construction.

This means the limiting resource on how high you can go is capacity: you cannot compute a root you cannot hold, and no ASIC optimizes around needing terabytes of intermediates. That part is right and it is the reason §13.3’s fixed difficulty behaves the way it does.

The limiting resource on how long it takes, at a height you can hold, is arithmetic rather than bandwidth, and an earlier draft of this section said otherwise. Multiplying two n-bit numbers costs far more than one operation per byte, so the work per byte read from disk is high and the computation is measured at about 28 times compute-bound rather than I/O-bound. Both statements matter and they are about different limits: capacity decides the ceiling, arithmetic decides the wait beneath it. §6.12 and §7.8 work the same arithmetic in the context of disclosure and holding, and docs/what-can-be-sold.md collects all of it.

13.3 Fixed difficulty

Bitcoin adjusts its difficulty every 2,016 blocks to maintain a 10-minute target block time. This adjustment requires protocol-level governance and creates a competitive arms race between miners.

Cantor tree difficulty is fixed by the mathematics. The cost of computing a region is a deterministic function of the coordinates involved. There is no adjustment mechanism, no governance, and no parameters to tune. As hardware improves over time, all parties gain access to greater computation and storage. The boundaries of what is computable expand gradually for everyone. The protocol requires no ongoing calibration.

13.4 Where the energy goes

The thermodynamic cost of Cantor work is real but mediated differently than in Bitcoin. In Bitcoin, the cost pipeline is direct: electricity flows into ASIC chips, which run SHA-256 repeatedly, generating heat. The conversion from watts to proofs is immediate and measurable.

In Cantor work, the energy costs arise from several sources. CPU cycles perform the pairing arithmetic, which generates heat but is relatively minor at scale. The dominant cost is disk I/O: writing and reading terabytes of intermediate values to and from storage generates heat and consumes significant electricity. The storage media itself must be physically allocated and occupied for the duration of the computation, representing both an energy cost and an opportunity cost.

There is also an interesting connection to Landauer’s principle, which states that erasing one bit of information costs a minimum of kT × ln(2) joules (where k is Boltzmann’s constant and T is temperature). When Cantor intermediates reach petabytes in size, the theoretical minimum energy cost of erasing them after computation may become non-trivial.

13.5 The sidestep as traditional proof-of-work

The sidestep (§6), which uses SHA-256 Merkle hash trees instead of Cantor pairing, has a more direct thermodynamic profile. SHA-256 hashing is pure compute with fixed-size inputs and outputs. The cost is straightforward: hash operations multiplied by time equals watts. The sidestep is, in this sense, closer to traditional proof-of-work than the Cantor hop.

This creates an interesting layering: Cantor hops are storage-bound structured work (fast but limited by storage), while Merkle sidesteps are compute-bound hash work (slow but unlimited by storage). The protocol naturally routes movement through whichever regime is feasible for the boundary being crossed.

The two also differ in what the work leaves behind, and the difference is deliberate (§6.12). A Cantor hop’s output is durable public infrastructure: a canonical region root that anyone may be handed and reuse. A Merkle sidestep’s output is consumed at the moment of use: seeded to one chain position, worth nothing to anyone else, and disposable in exactly the way §13.1 says a Bitcoin hash is disposable. The sidestep is the one place in Cyberspace where work is burned rather than accumulated, which is precisely what makes it a price on movement instead of an investment in a place.


14. Reference Implementation

The reference implementation for this spec is:

Implementers should treat that repo as the reference for:

  • Integer→bytes canonicalization for hashing
  • Movement proof computation
  • Canonical GPS→dataspace mapping (CANONICAL_GPS_TO_DATASPACE_SPEC_VERSION and golden vectors)

This repository also carries stdlib-only reference scripts that are executable statements of specific sections, each self-checking when run:

  • sidestep-reference.py: the version 3 sidestep construction (§6.4, §6.5, §6.10, §6.11), with golden vectors and a check that each property those sections claim actually holds, including that the half-tree forgery of §6.11 costs more than an honest crossing
  • hop-residue-reference.py: residue openings, version 2 of the hop proof (§5.9 to §5.11, §8.4): residues of a root, the method of differences, the hop primes, the seal, the re-roll price, the draw, the tag encoding and both verification levels, with golden vectors, a cross-check that its derivation reproduces the §5.7 golden proof_hash and lookup_id, and a check that each property those sections claim actually holds, including that a prover holding only part of the true residues passes Level 1 exactly when every sample lands on a residue it holds
  • hint-reference.py: §7.7 and the §10 rule for bags: canonical form, containment, sector tags, seeker work, malformed hints and plane preservation, locking the golden vectors of §7.7
  • decks/landfall-reference.py: landfall derivation (DECK-0001 §1.2)

This repository also carries machine-readable golden vectors of the hop proof, written from its reference script, so that a port in any language can test itself against the same values without running Python:

  • hop-residue-vectors.py: the stdlib-only script that imports hop-residue-reference.py by path, checks every value against it and produces hop-residue-vectors.json, byte for byte the same on every run; with --check it reports whether the file on disk is what it would produce, and it refuses to run when the reference’s SHA-256 is not the one it records, so the file’s provenance never goes stale
  • hop-residue-vectors.json: the golden vectors of residue openings (§5.9 to §5.13, §8.4, §8.7.1, §8.8) as machine-readable values, namely the single values the reference prints, seven hops with every intermediate value and their tags, the 16 Level 1 checks of the §5.7 hop one at a time, tampered proofs and version 1 hops with the verdict §5.11 and §8.7.1 give each, and the prices and sizes of §5.10 and §5.12, described by its own format field and copied unchanged by every port into its fixtures

These vectors are not normative. They are written from the reference script, and where they disagree with the text of this specification, the text is right and the file is a bug.

This repository also carries the golden vectors of the chain rules, copied byte for byte from the reference implementation:

  • chain-rules-2026-09-28-virtual-brackets.json: signed synthetic chains with their verdicts, locking chain rules revision 2026-09-28-virtual-brackets (§8.12); its format is described in vectors/README.md of the reference implementation
  • chain-rules-2026-10-08-residue-openings.json: signed synthetic chains with their verdicts, locking chain rules revision 2026-10-08-residue-openings (§8.12). Every hop in it carries residue openings, except a version 1 hop and a hop whose openings a vector removes or damages on purpose. The file also carries a test list of version 1 hops, which takes the place of grandfathered-v1-hops.txt while the vectors run. Its format is described in the same vectors/README.md.