extensions/nostr/README.md
Nostr DM channel plugin for OpenClaw using NIP-04 encrypted direct messages.
This extension adds Nostr as a messaging channel to OpenClaw. It enables your bot to:
openclaw plugins install @openclaw/nostr
Generate a Nostr keypair (if you don't have one):
# Using nak CLI
nak key generate
# Or use any Nostr key generator
Add to your config:
{
"channels": {
"nostr": {
"privateKey": "${NOSTR_PRIVATE_KEY}",
"relays": ["wss://relay.damus.io", "wss://nos.lol"]
}
}
}
Set the environment variable:
export NOSTR_PRIVATE_KEY="nsec1..." # or hex format
Restart the gateway
| Key | Type | Default | Description |
|---|---|---|---|
privateKey | string | required | Bot's private key (nsec or hex format) |
relays | string[] | ["wss://relay.damus.io", "wss://nos.lol"] | WebSocket relay URLs |
dmPolicy | string | "pairing" | Access control: pairing, allowlist, open, disabled |
allowFrom | string[] | [] | Allowed sender pubkeys (npub or hex) |
enabled | boolean | true | Enable/disable the channel |
name | string | - | Display name for the account |
allowFrom can message the botInbound event signatures are verified before policy enforcement and NIP-04 decryption.
Unknown senders in pairing mode can receive a pairing reply, but their original DM body is not
processed unless approved.
{
"channels": {
"nostr": {
"privateKey": "${NOSTR_PRIVATE_KEY}",
"dmPolicy": "allowlist",
"allowFrom": ["npub1abc...", "0123456789abcdef..."]
}
}
}
# Using strfry
docker run -p 7777:7777 ghcr.io/hoytech/strfry
# Configure openclaw to use local relay
"relays": ["ws://localhost:7777"]
| NIP | Status | Notes |
|---|---|---|
| NIP-01 | Supported | Basic event structure |
| NIP-04 | Supported | Encrypted DMs (kind:4) |
| NIP-17 | Planned | Gift-wrapped DMs (v2) |
allowlist mode in productionenabled is not set to falsewss://)MIT