Documentation / @etherfold/core / coherenceToken
Function: coherenceToken() ​
coherenceToken():
string
Defined in: packages/core/src/stateMoved.ts:251
A COHERENCE TOKEN: a value only THIS producer, at THIS point in its history, could have produced.
OPAQUE, and the only question ever asked of it is whether two of them are byte-identical. It is deliberately not a counter and not derived from anything a reader could recompute: a reader that could derive it would be deciding invalidation for itself, and the whole point is that the side which applied the block decides and the reader compares. A counter would also repeat across a restart, which is the one case where an unchanged token would be a lie -- a rebuilt fold saying "nothing you hold is stale".
Same construction as @etherfold/state-store's writer token, for the same reason and deliberately not shared: core cannot depend on the storage seam (ADR-0016). crypto.randomUUID is present on Node, Workers and browsers; the fallback is for a host that predates it.
Returns ​
string