Back to Eliza

Nostr Plugin

packages/docs/plugin-registry/platform/nostr.md

2.0.11.8 KB
Original Source

The Nostr plugin connects Eliza agents to the Nostr network, enabling note publishing, relay connectivity, and NIP-04 encrypted direct messages.

Package: @elizaos/plugin-nostr

Installation

bash
eliza plugins install @elizaos/plugin-nostr

Setup

1. Generate a Keypair

Use any Nostr client or key generation tool to create a keypair. You need the private key (nsec or hex format).

2. Configure Eliza

json
{
  "env": {
    "NOSTR_PRIVATE_KEY": "nsec1your_private_key"
  },
  "connectors": {
    "nostr": {
      "enabled": true
    }
  }
}

3. (Optional) Configure Relays

json
{
  "env": {
    "NOSTR_RELAYS": "wss://relay.damus.io,wss://nos.lol,wss://relay.nostr.band"
  }
}

Configuration

VariableRequiredDefaultDescription
NOSTR_PRIVATE_KEYYesPrivate key for signing events (nsec or hex)
NOSTR_RELAYSNoComma-separated relay URLs
NOSTR_DM_POLICYNoDM policy: allow, deny, or allowlist
NOSTR_ALLOW_FROMNoComma-separated allowed public keys
NOSTR_ENABLEDNotrueEnable or disable the connector

Features

  • Multi-relay connectivity
  • Note publishing (kind 1 events)
  • NIP-04 encrypted direct messages
  • DM access policies (allow, deny, allowlist)
  • Decentralized — no central server

Auto-Enable

The plugin auto-enables when the connectors.nostr block contains token, botToken, or apiKey. Environment variables alone do not trigger auto-enable. To use env-based config with auto-enable, include "token": "placeholder" in the connector config, or add the plugin to plugins.allow explicitly.