Skip to content

Instantly share code, notes, and snippets.

@kdmukai
Last active September 2, 2023 21:08
Show Gist options
  • Save kdmukai/72ff71e6b6278cdda37e5f1ba6c7c08a to your computer and use it in GitHub Desktop.
Save kdmukai/72ff71e6b6278cdda37e5f1ba6c7c08a to your computer and use it in GitHub Desktop.
Airgapped Nostr event signing via SeedSigner

Airgapped Nostr event signing via SeedSigner

Sign any Nostr event without ever having your key "hot" in a Nostr client app, web browser, or browser extension.


Demo of Keith's experimental Nostr integration.

Other posts:


Load your bitcoin BIP-39 seed by scanning the SeedQR you previously made.


Enter BIP-39 passphrase, if applicable.


With your bitcoin seed loaded, enter the experimental Nostr section.


SeedSigner derives your Nostr key from your bitcoin BIP-39 seed.

Now let's sign an event with our airgapped Nostr key!


Scan in the event from the Nostr client app (pretending that clients exist w/QR support already)


It currently reads the full event json because that's what's convenient to access for a demo. But clients should send the shorter serialized event format (which my code can already read).


Verify that the event says/does what you intend.


If the event is a metadata update (kind=0), it's displayed as its key-value pairs (though not much fits on the screen).


When you click "Sign", SeedSigner uses the airgapped Nostr key to sign the event and returns the signature as a QR code.

Our pretend Nostr client reads in the signature and publishes your event.


Recap

Your main Nostr identity key stayed offline the entire time, with SeedSigner serving as your signing device/intermediary. This can work today. Just need client support.


CAVEATS: This is all just an experimental SeedSigner dev branch. I built this branch just to show what's possible. Maybe it will make sense to release it as an officially-supported SeedSigner feature. Maybe not.


If you'd like to see me present this work at Nostrica, please consider helping to fund my travel expenses by DMing my fundraiser bot: @npub1yv3yqhzql8n9sj3zndulzdtx7axlcs6y2k2aun6qau7qmyvr8umsljm9zn, hitting my btcpay server, or via lnurl

@Maveth
Copy link

Maveth commented Sep 2, 2023

I was about to build this, I did some of the same functionality on a android, just got a seedsigner to do this.
i looked for your code, didn't see it, i might be blind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment