nostr_send_dm
Encrypt and send a direct message on Nostr using NIP-44 or legacy NIP-04 encryption. The plaintext is encrypted before broadcast to the recipient's pubkey.
Instructions
Encrypt + send a NIP-04 (kind:4) direct message. Defaults to NIP-44 encryption (current standard); pass version="nip04" only for legacy compatibility. Gated by NOSTR_DM_TOOLS_ENABLED + NOSTR_DM_ALLOWLIST + rate limit. For modern sealed DMs (NIP-17) wait for the next version.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Plaintext message; encrypted before broadcast. | |
| version | No | Encryption scheme. Defaults to nip44 (current standard). NIP-04 is deprecated but widely deployed — use only if you know the recipient's client expects it. | |
| to_pubkey | Yes | Recipient — 32-byte hex pubkey OR an npub bech32 string. |