Nordhavn / specs / convene / mix / Mix

convene / mixcontext

Mix

Purpose

One mixing step at a tumbler node — the heart of the transport, the act that breaks the link between how cells arrive and how they leave. A cell reaches the node and is admitted to its Tumbler, held with others; while the pen is still gathering its batch, nothing leaves — the cell simply waits. Once the pen is ready, the whole batch leaves at once, reordered by the entropy so the release order betrays nothing of the arrival order, each cell one hop shorter, each routed onward to a fresh peer the entropy picks. Held-then-reordered-then-released, at node after node, is what decorrelates a sender's cells from each other and from the sender: an observer watching one tumbler sees cells go in and a shuffled batch come out, and can say nothing about which became which.

Role Players

Props

Role Methods

tumbler

entropy

wire

Functionalities

mix

Admits the incoming cell to the tumbler. While the tumbler is not yet ready, it holds the cell and forwards nothing — the cell waits. Once the tumbler is ready, it takes the released batch whole, reorders it by the entropy, and forwards each cell — one hop spent — through the wire toward an onward peer the entropy picks, leaving the pen emptied. It yields the next Tumbler either way, so the node carries its holding forward to the next step. Result: the next Tumbler

Scenarios

A cell below the threshold waits, and nothing leaves

Given: a Mix with a tumbler of threshold 3 already holding one cell, an entropy, a wire, an incoming Cell, and onward peers "peer-7" When: mix is performed Then: the next tumbler holds two cells, ready reports false, and the wire was handed nothing — the cell waits

A ready pen releases a reordered batch, each cell a hop shorter

Given: a Mix with a tumbler of threshold 2 already holding one cell with hops remaining 3, an entropy, a wire, an incoming Cell with hops remaining 3, and onward peers "peer-7" and "peer-8" When: mix is performed Then: the next tumbler holds nothing, and two cells are forwarded through the wire — each with hops remaining 2 — toward the onward peers, released together rather than in arrival order

spoken of by