Nordhavn / specs / convene / mix / Cell

convene / mixdata

Cell

Purpose

The unit of the wire — one fixed-size, indistinguishable packet, the only thing the mix layer ever sends. Every cell is the same size and carries the same shape: a DetectionTag its recipient recognises it by, a sealed payload (one CellContent sealed under a SealKey), and a count of hops it has left to travel. Nothing else is visible — not who it is for, not which payload it belongs to, not where it started. An observer sees a stream of identical cells; only a key-holder can test the tag and unseal the content, and only the tumblers move it hop by hop toward the recipient's edge.

Attributes

Invariants

Operations

unseal

Recovers the chunk under a given SealKey, yielding the CellContent the sealed content seals — by handing the cell's sealed content to that key's own opening, the codec's one home; fails when the key is not the one that sealed it — a cell is opened whole or not at all. Result: the CellContent the seal holds; fails when the key is not the one that sealed it

forwarded

Produces a new Cell, identical but for one fewer hop remaining — what a tumbler releases when it passes a cell onward. Result: self

Scenarios

A cell is a tag, a sealed chunk, and a hop count

Given: a DetectionTag "dt-88f1", a sealed content, and hops remaining 3 When: a Cell is created Then: it is accepted carrying that tag, that content, and 3 hops remaining

Forwarding spends a hop

Given: a Cell with hops remaining 3 When: forwarded is performed Then: the new cell is identical but carries hops remaining 2

The right key recovers the chunk

Given: the SealKey "sk-0163", and a Cell whose sealed content is that key's sealing of a CellContent "ra-01" chunk 0 of 3 When: unseal is performed with that key Then: the yielded content is chunk 0 of 3 of payload "ra-01"

spoken of by