Skip to main content

Module control

Module control 

Source
Expand description

The v2 Control Plane (CORD-04 over CORD-01/02).

Editions use the vsk/eid/ev/ep/vac tags, the frozen edition_hash (community::version, label vector-community/v1/edition, which upstream froze verbatim), and the shared fold rules, riding the stream envelope: a kind-3308 UNSIGNED rumor inside a plaintext seal (20014) at control_pk. Authorship is the seal’s signature: super::stream::open_wrap Schnorr-verifies the seal and pins rumor.pubkey == seal.pubkey, so by the time an edition is parsed here its author is already proven. The plaintext seal is load-bearing: a compaction re-wraps the signed seal into a new epoch byte-verbatim, and the signature (over the rumor string) survives — an encrypted seal could not.

Two deliberate wire choices:

  • editions carry NO ["v","1"] protocol tag (frozen derivations partition protocol revisions by address; version tags are the rejected mechanism).
  • the owner is proven by the self-certifying community_id commitment (super::derive::verify_community_id), not an attestation event — vsk 7 is retired.

Structs§

CategoryMetadata
A Category (vsk 15, CORD-03 §4), eid == category_id, gated by MANAGE_CHANNELS. Deletion is terminal.
ChannelMetadata
Channel metadata — the vsk-2 entity content (CORD-03 §2). eid = the channel_id; gated by MANAGE_CHANNELS. Absent flags mean false; deletion is terminal.
CommunityIdentity
A v2 community’s self-certifying identity triple. The id IS the owner commitment — carry all three together and verify before trusting any claim.
CommunityMetadata
Community metadata — the vsk-0 entity content (CORD-02 §6). eid = the community_id itself; gated by MANAGE_METADATA.
ControlPlane
The Control Plane as this member holds it for one epoch.
Genesis
The two wraps of a community genesis — exactly two owner-signed editions: the community metadata (vsk 0) and one public #general channel (vsk 2). Nothing more — no default roles, no scaffolding.
ImageRef
An encrypted-blob image pointer (icon/banner): the media server sees only an opaque blob; members fetch, decrypt with key/nonce, and verify hash.
SealedChannelMeta
A Private Channel’s sealed metadata edition (CORD-03 §2): what every member needs to resolve access stays plain; the rest is sealed under the Channel’s key at epoch.

Enums§

ControlError
Errors from the control plane layer (envelope errors ride inside).

Constants§

MAX_DESCRIPTION_BYTES
UTF-8 byte cap on a community description.
MAX_NAME_BYTES
Protocol-wide UTF-8 byte cap on names (community, channel, role).
MAX_TOPIC_BYTES
A Channel’s topic cap (CORD-03 §2).

Functions§

build_edition_rumor
Build the unsigned kind-3308 edition rumor (no protocol v tag). Control editions carry no ms tag: they fold by version, not time.
build_edition_rumor_bound
build_edition_rumor, marked and bound to a Community (binding) when one is given: what every edition of a Community on Roles v2 carries.
cut_name
A name past the 64-byte cap, cut to the last whole character within it: what a reader shows.
genesis
Mint a v2 community: fresh identity (salt-committed to the owner), fresh community_root + control_root (the split, CORD-02 §2), and the two genesis editions sealed at the epoch-0 control plane — signed by the control_root- derived signer, readable under the community_root-derived read key. The caller persists the secrets and publishes the wraps.
genesis_signed
Signer-driven twin of genesis for bunker / NIP-55 accounts: mints from the owner’s public key and seals the two genesis editions through a VectorSigner. owner_pk must equal my_public_key() (the identity the signer signs as).
open_control_edition
Open a control-plane wrap into a verified, parsed edition. Strict on both gates: the rumor must be kind 3308, and the seal must be the plaintext form.
open_sealed_channel_meta
Open sealed channel metadata with the conversation key of its epoch. prev is the carrying edition’s predecessor, which the seal must name; a deletion carries an older seal verbatim and is exempt.
parse_edition_rumor
Parse an edition from an ALREADY-VERIFIED rumor (one produced by stream::open_wrap, which proved the seal signature, the author binding, and the rumor id). No signature lives on the rumor itself — never feed this a rumor that didn’t come through the stream verifier.
parse_sealed_channel_meta
The sealed form of a channel edition, None for the plain form or a malformed one.
sanitize_channel_metadata
meta with whatever breaks the protocol caps dropped, the name cut to fit: what folds is shown, and what a writer re-seals must validate.
seal_channel_metadata
Seal a Private Channel’s metadata under its conversation key at epoch, naming the edition’s predecessor so the seal can’t be replayed as a newer edition.
seal_control_edition
Seal a signed-by-author_keys edition rumor into a control-plane wrap. Local-keys convenience; bunker accounts use stream::seal_content + their remote signer + stream::wrap_seal for identical wire output.
seal_control_edition_signed
Signer-driven twin of seal_control_edition for bunker / NIP-55 accounts: the plaintext seal signs through a VectorSigner. author is the identity the signer signs as (must equal my_public_key()). Wire-identical output.
sealed_tombstone
A sealed edition’s content republished verbatim beside "deleted": true: deleting a Private Channel takes only the bit, never the key.
split_write_group
The SPLIT write group for a freshly minted epoch (genesis / a Refounding’s new plane): the control_root-derived signer with the community_root- derived read key (CORD-02 §5).
validate_category_metadata
validate_channel_metadata
validate_community_metadata
Enforce the protocol byte caps before an edition is built (a strict reader may drop over-cap state; never publish what peers would refuse).