> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openpawz.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Nostr

> Connect to the Nostr decentralized network so users can chat with your agents via any Nostr client.

# Nostr

Connect to the Nostr decentralized network so users can chat with your agents via any Nostr client.

## Setup

1. Generate a Nostr keypair for your bot (or use an existing one)
2. In Pawz, go to **Settings → Channels**
3. Select **Nostr**
4. Enter:
   * **Private key** — bot's nsec key
   * **Relays** — comma-separated relay URLs (e.g., `wss://relay.damus.io,wss://nos.lol`)
5. Start the channel

## Configuration

| Field         | Required      | Description                    |
| ------------- | ------------- | ------------------------------ |
| Private key   | Yes           | Bot's Nostr private key (nsec) |
| Relays        | Yes           | Relay URLs to connect to       |
| DM policy     | Yes           | Who can message the bot        |
| Allowed users | For allowlist | Nostr public keys (npub)       |

## Features

* Public kind-1 text note replies (NIP-01)
* NIP-04 encrypted direct messages (kind-4)
* Per-user sessions with memory
* Prompt injection scanning
* Agent routing via channel routing rules
* Multi-relay support
* BIP-340 Schnorr-signed events
* ECDH shared secret + AES-256-CBC encryption for DMs

:::info Encrypted DM support
The bridge supports **NIP-04 encrypted DMs** (kind-4 events) using ECDH + AES-256-CBC. This is compatible with all major Nostr clients (Damus, Amethyst, Primal, etc.). NIP-44 (the newer encryption standard with NIP-17 gift wrapping) is planned for a future release.
:::

### Roadmap

| Feature                                 | Status        |
| --------------------------------------- | ------------- |
| NIP-04 encrypted DMs                    | ✅ Implemented |
| NIP-44 encrypted DMs (improved privacy) | Planned       |

## Tips

* Use multiple relays for reliability
* The bot's public key (npub) is derived from the private key automatically
* Users can find your bot by its npub on any Nostr client
* Consider publishing a NIP-05 identifier for discoverability
