← Learn · one axis

The Cantor tree

One axis of cyberspace is a number line of 285 positions, each one Gibson wide. A region is a block of consecutive positions that is aligned: at height h it is 2h positions wide and starts at a multiple of 2h. The specification gives every region one number, its root, by pairing neighbors upward. This is that computation, drawn.

The rule

The pairing function is Cantor's. For two numbers a and b, let s = a + b; then π(a, b) = s(s + 1) / 2 + b. It is a bijection: every pair of naturals maps to one natural, and every natural comes from exactly one pair. The specification writes the root of a region as the repeated pairing of neighbors until one number remains (section 4.6).

Two worked regions

Region [2, 3] at height 1: s = 5, so π(2, 3) = 5 × 6 / 2 + 3 = 15 + 3 = 18.

Region [0, 1, 2, 3] at height 2: pair the halves first, π(0, 1) = 2 and π(2, 3) = 18, then pair those: s = 20, π(2, 18) = 20 × 21 / 2 + 18 = 228. Set the height slider to 2 and the region to 0 to see it.

Why a region needs a number

The root is the protocol's name for a place at a size. A hop proof is built over the region that contains both ends of the move (section 4.4): the height is the bit length of the XOR of the two positions, and the work of the proof is the whole tree. Three axis roots pair again into one 3D region number (section 4.7), and that number is hashed into the key that encrypts anything hidden in the region (section 7.2).

What the root names

Within one height, different regions always have different roots, because each pairing step is a bijection. Across heights the picture has one wrinkle, and the scene shows it: at height 0 there is nothing to pair, so a position's root is the position itself. That means a small region at a positive height can share its root with a single position somewhere on the axis: [2, 3] at height 1 has root 18, and so does position 18 at height 0. For every height of 1 and above, roots are unique across heights as well, and a region's root grows so fast with height that a region anywhere near Earth (284) has a root wider than the whole axis by height 1. Tick "Start at Earth" to watch the width jump from 85 bits to 170. So the name of a region is the pair (root, height), and above height 0 the root alone is enough.

Scale

The tree doubles in width and roughly doubles in root size with every height. The scene stops at height 5 (32 leaves) because past that the numbers stop being readable, not because the protocol does: height 34 is a human-scale area of 2 meters, and its root is exactly 85 × 234 bits, 182.5 GB. That size is the point: it is the cost that makes distance real.