Skip to main content

Module commit

Module commit 

Source
Expand description

Signed atproto repository commits.

A commit is the signed mutable pointer: it binds an MST root CID (the immutable record-store snapshot) to a DID at a revision, signed by the DID’s #atproto P-256 key. This is what federation verifies to trust a host’s claim about an account’s state — the consensus-free versioning primitive.

§Structure (atproto v3)

Commit {
  did:     String,        // account DID (did:web / did:plc)
  version: u64 = 3,       // protocol version
  data:    Cid (link),    // MST root
  rev:     String,        // TID revision
  prev:    Option<Cid>,   // previous commit (None for genesis)
  sig:     Vec<u8>,       // ES256 signature over the unsigned commit
}

§Signing

sig is ES256 (P-256 ECDSA over SHA-256) of the DAG-CBOR encoding of the unsigned commit — the commit object with the sig field omitted (not present-and-empty). The verifier re-encodes the unsigned form and checks the signature against the DID’s published #atproto P-256 verifying key.

Structs§

Commit
A signed commit — the unsigned commit plus its ES256 sig.
PublishedAtprotoKey
A P-256 key published for commit verification, with a half-open validity interval. The active slot is unbounded; drain and lead slots must carry explicit document bounds.
PublishedAtprotoKeys
A small, authority-checked set of verification keys from a DID document: exactly one active #atproto slot and at most one bounded drain and lead slot. Unknown DID verification methods are intentionally ignored.
UnsignedCommit
An unsigned commit — the form that gets DAG-CBOR-encoded and signed.

Constants§

COMMIT_VERSION
The commit version number (atproto v3).

Functions§

atproto_verifying_key_from_did_document
Resolve the active #atproto P-256 verifying key for expected_did.