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 inner event 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). That inner event lives inside the channel/server-root encryption (the outer wrapper is the usual ephemeral signer, super::envelope), so authorship is member-verifiable: the inner 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.
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§

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).
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.