Skip to main content

Module edition

Module edition 

Source
Expand description

Real-npub authority editions — the keyless model’s authorship + version carrier.

An authority change (a Grant, RoleMetadata, RoleOrder, Banlist, …) is an edition signed by the ACTOR’s own npub, carrying the entity id, a per-entity version, and the previous edition’s hash (prev_hash, see super::version). Authorship is member-verifiable: the Schnorr signature is the proof of who acted, and members check that npub against the roster.

This module is the wire encoding of one edition (build + verify + parse). It does NOT decide authorization — the signature proves WHO acted; the roster (§roles) decides WHETHER they were allowed, and super::version::fold decides which edition is current.

Structs§

AuthorityCitation
The pinned authority an actor claims for an action (mechanism a). Points at the actor’s own authorizing edition (their Grant — or a RoleMetadata for a role-position claim) by stable coordinate + the exact version/hash, so the verifier resolves authority against that frozen point, not its own possibly-lagging-or-ahead live roster.
EntityHead
The folded current head of one control entity — what the caller persists via set_edition_head (the monotonic refuse-downgrade floor) and the send side reads to emit the next version.
ParsedEdition
A signature-verified, parsed edition.

Enums§

EditionError

Constants§

TAG_AUTHORITY_CITATION
Authority citation tag: ["vac", <authorizing-entity hex>, <version>, <edition-hash hex>]. The “pinned proof” — the grant edition the actor claims their authority under. In the MVP it is a COMPLETENESS floor: a verifier confirms it has synced that exact grant to ≥ the cited version (an un-forked, complete view) before acting, and resolves the actor’s actual rank against its current (refuse-downgrade-protected) roster — so a since-demoted actor is dropped there. The full “resolve rank AT the cited version” (block-until-synced re-fetch + a roster-wide snapshot version) is the deferred refinement; today it pins the actor’s own grant, not a whole-roster moment. Absent when the OWNER acts (supreme, no grant to cite).

Functions§

authority_citation_satisfied
version-pinned authority completeness check for an action that carries an AuthorityCitation (a ban, a hide, a delegated grant). The action names the authorizing grant edition it claims authority under; this confirms we have folded a COMPLETE, un-forked view of that grant — synced to AT LEAST the cited version, with the cited hash matching ours at equality.
authority_citation_satisfied_by
authority_citation_satisfied with the heads looked up by head_of: an entity’s (version, self_hash) as the first head held for it would give them.
build_edition_inner
Build the unsigned inner edition event. Sign it with the ACTOR’s real identity keys — that signature is the authorship proof. entity_id is the entity’s 32-byte id, prev_hash is the previous edition’s version::edition_hash (None for the first edition), content is the entity payload JSON, and created_at_secs is the authored time (the version-fold tiebreak).
is_tag_decimal
CORD-01 §5: a tag number rides as “its decimal form with no leading zeros”. So "4" and "0" are the shape; "04", "+4" and "" are not. u64::from_str accepts a leading + and any number of leading zeros, and a peer that doesn’t would drop an event we honored — a divergence neither side can see, because a declined parse is never logged.
parse_edition_inner
Verify + parse an inner edition event. Checks the inner Schnorr signature (the real-npub authorship proof) and extracts the edition fields, computing self_hash over the canonical edition bytes. Does NOT check roster authorization — that is the caller’s separate step.