Skip to main content

Crate choir_identity

Crate choir_identity 

Source
Expand description

L8 identity: one ed25519 key per actor, signatures over op entries (DECISIONS.md D13, key-per-agent).

An actor’s id is the self-describing ContentHash of its public key, so ids survive a future signature-scheme change the same way content addresses survive a hash change (D6). The signature covers choir_oplog::OpEntry::signing_hash — the entry with the signature field blanked — and lands in the entry’s additive author_sig field, so pre-L8 logs remain valid and verification is opt-in per deployment until the daemon leaves localhost.

Trust policy (who may touch which workspace/ref) is a later layer; this crate only answers “is this entry really from that key”.

§Examples

use choir_identity::{ActorKey, Registry};
use choir_oplog::{OpEntry, FORMAT_VERSION};

let key = ActorKey::generate();
let mut registry = Registry::new();
registry.register(&key.public_key_bytes()).unwrap();

let mut entry = OpEntry {
    format_version: FORMAT_VERSION,
    parent: None,
    seq: 0,
    channel: "agent-1".into(),
    payload: b"op".to_vec(),
    witnesses: Vec::new(),
    author_sig: None,
};
key.sign_entry(&mut entry);
assert_eq!(registry.verify_entry(&entry).unwrap(), key.actor_id());

§Where this sits

docs/architecture.md is the map of the whole workspace. This crate is L8, one ed25519 key per actor and the signatures over log entries.

It builds on choir_hash and choir_oplog.

Structs§

ActorKey
An actor’s signing keypair.
Registry
Known public keys, indexed by actor id. This is the verification side’s whole world: an unregistered key is an unknown author.

Enums§

IdentityError
Failure modes of signing and verification.

Constants§

P256_SPKI_PREFIX
Prefix that turns a raw P-256 point into SubjectPublicKeyInfo DER.

Functions§

p256_point_to_spki
Wraps a raw uncompressed P-256 point as SubjectPublicKeyInfo DER.
verify_carried_webauthn
Verifies a WebAuthn assertion against the credential key the signature carries (D45), for a reader holding no credential store.
verify_es256
Verifies an ECDSA-P-256/SHA-256 signature, the scheme WebAuthn calls ES256 (COSE algorithm -7).
verify_webauthn_assertion
Verifies a WebAuthn assertion and that it attests to signing (D39).
webauthn_challenge
The challenge bytes a browser must be given so that the assertion it returns attests to this submission (D39).