Skip to main content

Module did_op

Module did_op 

Source
Expand description

The permanent genesis operation for a hyprstream-hosted did:web account.

This module deliberately implements only operation zero. Successor-chain validation, fork selection, and historical key-validity queries belong to C1 (#1167). The bytes emitted here are nevertheless the first record in that future log, so their grammar is a one-way door for every minted account.

§Rotation custody is structural

GenesisRotationKeys is not a Vec. It has exactly three ordered slots:

  1. a required UserRotationKey;
  2. an enrolled recovery key or an explicit RecoveryKeyEnrollment::Declined;
  3. an enrolled host key or an explicit HostKeyEnrollment::Absent.

A HostRotationKey therefore cannot be passed as priority zero:

ⓘ
use hyprstream_pds::{
    GenesisRotationKeys, HostKeyEnrollment, HostRotationKey,
    RecoveryKeyEnrollment,
};
let _ = GenesisRotationKeys::new(
    host,
    RecoveryKeyEnrollment::Declined,
    HostKeyEnrollment::Absent,
);

The wire form preserves those slots as a fixed three-element rotation_keys array. A declined/absent slot is encoded as a role-bearing map whose key is null, so recovery absence is a signed decision rather than an omitted field or decoder default.

§Hybrid pin

Rotation is not an atproto interoperability surface. Every rotation key and the genesis signature therefore consists of Ed25519 + ML-DSA-65, with both components required. There is no classical constructor or verification mode.

Structs§

DidOpSignature
The decomposed, context-bound composite signature stored in a DidOp.
GenesisDidOp
A sealed, self-signed genesis operation.
GenesisRotationKeys
The only representable genesis rotation-key ordering.
HostRotationKey
An optional host-held rotation key, representable only at priority two.
HybridRotationKey
A pinned-Hybrid public key authorized to control a hosted account.
RecoveryRotationKey
A user-held recovery key kept on a device distinct from the primary key.
RotationSlotRef
A reference to one ordered genesis rotation slot.
UnsignedGenesisDidOp
Operation zero without its signature.
UserRotationKey
The required user-held key occupying genesis priority zero.

Enums§

GenesisRepoHead
The repo state deliberately recorded at genesis.
HostKeyEnrollment
Whether the deployment is enrolled as the lowest-priority rotation actor.
RecoveryKeyEnrollment
The deliberate outcome of the recovery-key enrollment offer.

Constants§

DID_OP_SIGNATURE_CONTEXT
Domain-separation context bound into both signature components.
DID_OP_VERSION
Version sealed into operation number zero.

Functions§

sign_genesis
Sign operation zero with the user-held priority-zero key.