3.6 KiB
Didactyl — Genesis Bootstrapping
See also: CONTEXT.md · SKILLS.md · README.md
Purpose
genesis.jsonc is the first-run bootstrap document for a Didactyl agent.
It defines initial identity, admin policy, startup events, default skill trigger behavior, and baseline runtime settings so the agent can publish itself onto Nostr.
After bootstrap, the long-term direction is nsec-only startup with state recovered from Nostr events.
File Format
genesis.jsonc is JSONC (JSON + comments).
Minimum practical sections:
key.nsec(or runtime--nsec/DIDACTYL_NSEC)admin.pubkeyllmstartup_events(must include kind10002relay tags)
Typical optional sections:
dm_protocoltoolssecurityadmin_contextapidefault_skill(published as private kind31124, defaultd=default_admin_dm)
First-Run Flow
On first run, the agent:
- Loads
genesis.jsonc. - Derives keys (from
key.nsecor runtime nsec override). - Connects to relay set from startup kind
10002tags. - Publishes/reconciles startup events.
- Initializes runtime services (DM subscriptions, triggers, API if enabled).
First-run detection is based on querying own kind 10002 relay-list availability.
Subsequent-Run Flow
On subsequent runs, the agent can start with nsec supplied via:
- CLI:
--nsec <nsec_or_hex> - Environment:
DIDACTYL_NSEC
Optional runtime API overrides:
--api-port <port>--api-bind <address>
Subsequent-run bootstrap-event republishing is skipped when prior kind 10002 state is found.
Interactive Setup (Zero-Argument Startup)
When Didactyl is run with no arguments:
./didactyl
it enters an interactive setup wizard instead of immediately trying to load ./genesis.jsonc.
Wizard entry choices:
- New agent — generate/provide identity, configure admin + LLM + relays
- Existing agent — provide nsec and recover relay/admin/LLM config from Nostr
- Load genesis — load a specified genesis file path
Menu UX conventions:
- Single-letter hotkeys (case-insensitive)
- First-letter menu mnemonics (e.g.,
Nfor New,Efor Existing) q/xexits or backs out of menus
Security behavior:
- nsec entry is masked in terminal
- writing genesis with nsec is explicit and warned
- recommended export mode is genesis without nsec plus runtime
--nsec/DIDACTYL_NSEC
Encrypted Config Events
Didactyl exposes config persistence tools for encrypted self-config on Nostr:
config_store— publish encrypted kind30078config byd_tagconfig_recall— query+decrypt kind30078config byd_tag
Recommended tags:
d=llm_configd=agent_config
These are encrypted to self with NIP-44.
Relay Bootstrap Strategy
startup_events must include kind 10002 relay tags (["r", "wss://..."]).
That relay list is used as the initial network attachment for querying existing state and publishing startup events.
Migration Notes (v0.2.0)
- Legacy
config.jsoncand template-DSL context files have been removed from the active startup model. - Default DM handling now relies on
default_skillwithd_tag: default_admin_dmand trigger tags:["trigger", "dm"]["filter", "{\"from\":\"admin\"}"]
- Default skill content is plain markdown with inline variables such as
{{my_kind0_profile}}and{{my_npub}}.
Security Notes
- Keep nsec secret.
- Prefer environment or secure credential injection for production nsec handling.
- Avoid publishing plaintext sensitive config; use encrypted
config_storefor long-term state.