asoltys on Nostr: If you're looking to get the lightning address of a given npub you can query nostr ...
If you're looking to get the lightning address of a given npub you can query nostr relays for "kind 0" events for that pubkey. kind 0 events contain the profile metadata for a given pubkey including their username, avatar, etc. It may also have a "lud16" field with their lightning address, but it's an optional field.
Published at
2024-08-22 05:25:17Event JSON
{
"id": "a95268cb34ddedeb1a154e62689cf546cf1a051de3511a98df8d79e492714e62",
"pubkey": "566c166f3adab0c8fba5da015b0b3bcc8eb3696b455f2a1d43bfbd97059646a8",
"created_at": 1724304317,
"kind": 1,
"tags": [
[
"e",
"2e19c88f7d4ff9c6687c1e7e7a00e4b4303536273969a2277f5e45f9807e4589",
"wss://bouncer.nostree.me",
"root"
],
[
"e",
"632f85e1603049c0a969798a2c03aef8ee38ebe279e7c8ef31607fee56576523",
"wss://bouncer.nostree.me",
"reply"
],
[
"p",
"f4a29f6397c32409a7cd3bcda1acb7ddad76a38e457ea5ddf7a827705b2b1ea3"
],
[
"p",
"b7b51cc25216d4c10bc85ae27055c9a945fe77cafd463cf23b20917e39ce6816"
]
],
"content": "If you're looking to get the lightning address of a given npub you can query nostr relays for \"kind 0\" events for that pubkey. kind 0 events contain the profile metadata for a given pubkey including their username, avatar, etc. It may also have a \"lud16\" field with their lightning address, but it's an optional field.",
"sig": "2b92ba5a34f865995a46a2c03d0934214b20aa462d877f606a055ebaa3cb04a38a150bb0be9f3c23a8a8ae77367aa37f949a0975eaffbd029c912eae16b4ce8d"
}