Skip to main content

Module identity

Module identity 

Source
Expand description

Pod-git-root agent identity writer (ADR-124 §5.3 / Defect-3 NEW).

Melvin Carvalho’s create-agent design treats each per-user pod as a full git repository whose ROOT carries two identity artefacts:

  1. agent.did.json — the canonical did:nostr DID document (ADR-125 / §1: three-context, top-level DIDNostr, single Multikey verification method with publicKeyMultibase: "fe7010{2,3}<hex>", #key1; per the did:nostr CG omit-when-empty model, service is omitted entirely when there are no endpoints).
  2. git config nostr.privkey <hex> — the agent’s BIP-340 secret key, stored in the pod-repo’s local git config (never committed).

This module is the solid-pod-rs analogue of create-agent’s identity bootstrap. It is net-new (Defect-3): the pre-pivot bootstrap wrote a 2019-shape did-nostr.json and an identity.env; neither agent.did.json nor git config nostr.privkey existed.

agent.did.json is a document the controller publishes, so when the secret key is supplied it is rendered from the full key by solid_pod_rs::did_nostr_types::render_did_document_published: the parity byte follows the key’s actual y (0x02 even, 0x03 odd), as the did:nostr parity model permits for controller-published documents (nostrcg/did-nostr#145, closing #144). With only the public identifier it falls back to solid_pod_rs::did_nostr_types::render_did_document, the 0x02 form every resolver computes from the identifier alone.

§Invariants

  • I1 — the did:nostr:<hex> identity string is unchanged; the pubkey is the canonical x-only hex.
  • I2 — publicKeyMultibase == "fe7010{2,3}" + <x-only-hex>, produced by the canonical renderers; the body is always the x-only identifier, and the parity byte is 03 only when the supplied secret’s point has odd y.
  • I3 — this writer is provisioning only. It never participates in the NIP-98 auth path; the privkey it git-configs is the signing key, not an authentication oracle.

Structs§

AgentIdentityWritten
Result of writing the pod-git-root identity artefacts.

Constants§

AGENT_DID_FILE
Filename of the canonical DID document at the pod-git root.
NOSTR_PRIVKEY_KEY
The git-config key under which the agent’s BIP-340 secret key (hex) is stored in the pod-repo’s local config (create-agent parity).

Functions§

write_agent_identity
Write the canonical agent.did.json to pod_root and, when a secret key is supplied, run git config --local nostr.privkey <privkey_hex> in the pod repo.