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§
- Authority
Citation - 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.
- Entity
Head - 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. - Parsed
Edition - A signature-verified, parsed edition.
Enums§
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_satisfiedwith the heads looked up byhead_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_idis the entity’s 32-byte id,prev_hashis the previous edition’sversion::edition_hash(Nonefor the first edition),contentis the entity payload JSON, andcreated_at_secsis 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_straccepts 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_hashover the canonical edition bytes. Does NOT check roster authorization — that is the caller’s separate step.