mempoole on Nostr: Easy way to convert hex public keys to npub using nostr-tools. ``` let sk = ...
Easy way to convert hex public keys to npub using nostr-tools.
```
let sk = generatePrivateKey() // `sk` is a hex string
let pk = getPublicKey(sk) // `pk` is a hex string
let npub = nip19.npubEncode(pk)
```
https://github.com/nbd-wtf/nostr-toolsPublished at
2023-03-08 02:36:27Event JSON
{
"id": "5aa4fc753fe8b2514d13b97314149aba9ca05f3194bf658c7e629880198d467b",
"pubkey": "77aa5d046813120fcdea24b25eacc18431946f48873bcb71dcc958b707d7ef1e",
"created_at": 1678242987,
"kind": 1,
"tags": [],
"content": "Easy way to convert hex public keys to npub using nostr-tools.\n\n```\nlet sk = generatePrivateKey() // `sk` is a hex string\nlet pk = getPublicKey(sk) // `pk` is a hex string\nlet npub = nip19.npubEncode(pk)\n```\n\nhttps://github.com/nbd-wtf/nostr-tools",
"sig": "0aca601b4643910f3820054ea59553f61a39db36ae07ffb7856ab86ce33a4f4de76484c4d410170e2b6af0e1312434576837f4052d542bda55bbc10a416dc2b4"
}