jonnify·bcs /bcs/ideas/identity-contract/the-order-theorem

B1.2 · dive 2 of 4 — the ordered property

String order is mint order.

Because the payload is a fixed-width encoding of a strictly increasing integer, string order equals numeric order equals mint order. A table keyed by branded ids is a timeline with no clock in the process.

The lineage: Twitter's 2010 generator promised ids that were uncoordinated, 64-bit, and roughly sortable. The contract hardens roughly into exactly per node — the minting law makes each node's sequence strictly monotonic.

The proof sketch as a picture — and the three sorts it makes interchangeable (content/contract.md §5; dataset: the committed snowflakes of content/vectors.json, encoded live by a pure function).
the alphabet ascends 0–9 < A–Z < a–z in ASCII byte value the width is fixed 11 digits, zero-padded — no length ambiguity time leads the bits the timestamp occupies the most significant bits ∴ byte order = numeric order = mint order
readout · The fixed dataset is the six committed snowflakes of content/vectors.json — among them 274557032793636864 ⇆ USR0KHTOWnGLuC and 320636799581945856 ⇆ USR0NgWEfAEJfs. Select a sort; all three produce one sequence.
§1

The theorem, and its lineage

content/bcs1.2.md · King 2010

Twitter's 2010 generator promised ids that were uncoordinated, 64-bit, and roughly sortable — close ids for tweets posted close together. The contract's payload is fixed-width and zero-padded over a strictly ascending alphabet, so comparison is positional with no length ambiguity: payload byte order is base62 numeric order, and the timestamp occupies the most significant bits of that number. Roughly becomes exactly per node — the minting law makes each node's sequence strictly monotonic, so a system's table keyed by branded ids is a timeline with no clock in the process.

§2

Proven on a table

bcs_rung_1_1_check.out

The substrate proved the theorem at G4: two thousand mints paged newest-first from byte comparison alone. The store holds no clock — the chronology is in the keys.

content/echo_data/runtimes/elixir/bcs_rung_1_1_check.out · G4frozen
G4 ordered ok -- page_desc(2000) == byte-sort desc over 2000 minted ids; store holds no clock
§3

Extended across a stream

content/out/streams_bench.out

The streams experiment extended the theorem across a second data structure: a ten-millisecond window addressed purely by id arithmetic returned its predicted 40960 entries.

content/out/streams_bench.out · the window addressed by id arithmeticfrozen
window [+10ms, +20ms) via branded-derived ids: 40960 entries (expected 40960)
first id in window: "1781000000010-28672"  (low 22 bits = node 7 << 12 | seq 0 = 28672)
§4

Cursors without a clock

content/contract.md §2 · instants per content/vectors.json

The contract's synthetic cursor is normative: min_for(t) = (t − EPOCH_MS) << 22 — the smallest snowflake mintable at or after instant t, the half-open lower bound for every time-range scan in the system. The two instants below are the committed unix_ms vectors; the cursors are computed live by a pure function.

cursor · Select an instant. A window is two synthetic cursors — a half-open pair of snowflakes no minter needed to issue — and every id minted inside the window compares between them, as text or as integer alike.
§5

What systems do with it

content/bcs1.2.md · When

A table keyed by branded ids is a timeline. A feed is a descending sort. A window is two synthetic cursors — in a table or a stream alike. Consult the theorem when choosing keys, cursors, and replay windows; and any system applying a collation to branded text must use byte order, because a language collation breaks the theorem and the range gate at once. Retired: the second clock — the created_at column an id-keyed table no longer needs.

The namespace-first property completes the picture: within one namespace the prefix is equal, so a sorted index over branded ids is the per-namespace timeline — the partition and the chronology in one comparator.

§6

References

sources · related

Sources

Related