Skip to content

Core Lightning plugin that sends events to Nostr

Notifications You must be signed in to change notification settings

joelklabo/nostrify

Repository files navigation

Use nostr-control Instead, this is no longer maintained.

CI Tests

Tested on Bitcoin Core 24.0.1, 23.1 Core Lightning master, 23.02, 22.11.1

Nostrify

Core Lightning plugin that sends events to Nostr

Quickstart

Clone this repo into your /plugins folder. You'll need to run pip3 install -r requirements.txt

By default Nostrify uses lightning-cli makesecret string=nostr to generate a Nostr key for you. This generates a psuedorandom secret based off of your HSM_secret.

See the documentation for makesecret here

To find the pubkey of your node run:

$ lightning-cli nostrifypubkey
"npub1sqqres47s8x9ztva4nn525j5w72l23tvw0rh04t49h3gg5xccq7spvtqzs"

Required Settings (nostr_relay, nostr_pubkey)

Nostrify sends events as DMs. To receive events as an encrypted DM you must set a pubkey in your config file.

You will also need to set some relays with the nostr_relay option, you can set multiple if you like. For example:

# Nostrify
nostr_relay=wss://nostr.klabo.blog
nostr_relay=wss://relay.damus.io
nostr_pubkey=2f4fa408d85b962d1fe717daae148a4c98424ab2e10c7dd11927e101ed3257b2

Disabling Events

You can disable certain events from being sent by setting nostr_disable_event (you can set this multiple times). For example if you wanted to disable connection events and forwards that didn't succeed you could add this to your config file:

Events you can disable:

  • connect
  • disconnect
  • forward_offered
  • forward_failed
nostr_disable_event=connect
nostr_disable_event=disconnect
nostr_disable_event=forward_offered
nostr_disable_event=forward_failed

If there are others you want to disable open and issue and I'll try and add them.

Example of Nostrify messages in Damus DM:

IMG_537E93ECED3E-1

Optional last step

Follow me on nostr npub19a86gzxctwtz68l8zld2u9y2fjvyyj4juyx8m5geylssrmfj27eqs22ckt and send me a Zap or tip at [email protected] 🤙

Contribute

If you find a bug or have feature requests file an issue. PRs are also welcomed 🤙