Skip to main content

Module owner

Module owner 

Source
Expand description

Helpers for a community owner, the holder of the root key (§4, ADR-0005, ADR-0011): the genesis descriptor and host delegation, community.create, root rotation and descriptor revisions. The root key never leaves the owner’s device; only signed objects do.

Structs§

DescriptorContent
The owner-editable, public fields of a descriptor (§4.1 fields 7–17).
Genesis
A signed genesis descriptor (revision 1) and the delegation it references (epoch 1).
HostInfo
What an owner needs about a host to delegate to it (§4.2).

Functions§

create_body
The community.create body (§8.1): the genesis pair, the owner’s member key and its registration (purpose 1) for the host’s current host_challenge (from the welcome).
delegate
Signs a delegation of every v1 scope (§4.2) to host, valid from now_ms.
generate_root_key
Generates a fresh root key (§3.2): the community’s identity. Store it sealed; it cannot be recovered (ADR-0011).
genesis
Builds and signs the genesis pair: delegation epoch 1 to host (no expiry, ADR-0005), descriptor revision 1 naming it, with owner_member_key as the owner binding.
next_revision
A copy of current with the next revision and issued_at = now_ms, for the owner to edit and pass to publish_body.
publish_body
Signs descriptor with root (its current root key) and builds the community.descriptor.publish body. A given delegation is referenced by the descriptor (epoch and hash) and sent; a given icon sets the descriptor’s icon hash and is sent.
resign_delegation
Re-signs an existing delegation under a new root key. The bytes, hence the delegation_hash and epoch, are unchanged.
rotate_root
Signs the rotation from the current root old to new (§4.6): rotation_seq follows the descriptor’s latest rotation, and both keys sign.
rotated_revision
The next revision after rotation: the new root key and rotations = [rotation] (§4.1 field 5). Sign it with the new key via publish_body, together with resign_delegation: the delegation is verified under the current root (§4.3 rule 3).