LIGHTNING-LISTADDRESSES(7)

πŸ“¦
version 26.06.9 Β· 2 versions
, in nixpkgs unstable

πŸ’– LIGHTNING-LISTADDRESSES(7) πŸ’–

okay so bestie, you already know this is the lightning-listaddresses page, and it's genuinely one of the cutest little RPCs in the whole lightning family β€” let's get into it πŸŽ€


✨ NAME ✨

listaddresses β€” the command that lists, like, every address your node has ever handed out to date. yes, all of them. the whole collection. πŸ¦‹


🌸 SYNOPSIS 🌸

listaddresses [address] [start] [limit]

three optional little args, super chill, no pressure πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

this one's a newer addition, bestie β€” it got added in v24.11. not me showing up late to the party but absolutely slaying once i arrive 😭

the listaddresses RPC command gives you a detailed list of all the Bitcoin addresses that have been generated and issued by the Core Lightning node up to the current date. like a whole scrapbook of every address your node ever gave out πŸ“–βœ¨

here's what you can pass in:

  • address (string, optional) β€” a Bitcoin accepted type, including a bech32, address for lookup in the list of addresses issued to date. so if you wanna hunt down one specific address, this is your girl πŸ”
  • start (u64, optional) β€” starting key index for listing addresses or searching for a particular address. the default is 1. gotta start somewhere, right? πŸ’«
  • limit (u32, optional) β€” the maximum number of addresses to return or search for. the default is Total number of addresses issued. so if you don't say anything, you get the whole pile, no cap πŸŽ€

πŸ”₯ RETURN VALUE πŸ”₯

on success, you get back an object containing addresses. it's an array of objects, and each object contains:

  • keyidx (u64) β€” the key index of the address issued. the receipts, basically 🧾
  • bech32 (string, optional) β€” the bech32 (native segwit) address. classic, iconic πŸ‘‘
  • p2tr (string, optional) β€” the taproot address. taproot girlies stay winning 🌈

πŸ‘‘ AUTHOR πŸ‘‘

Shahana Farooqui sfarooqui@blockstream.com is mainly responsible. we stan a main character who builds RPCs fr fr 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

iykyk, go read those next πŸ’–


⭐ RESOURCES ⭐

Main web site: https://github.com/ElementsProject/lightning β€” go be nosy, it's encouraged 🧚


🌸 EXAMPLES 🌸

Example 1 πŸ’«

Request:

$ lightning-cli listaddresses "bcrt1p2gppccw6ywewmg74qqxxmqfdpjds3rpr0mf22y9tm9xcc0muggwsea9nkf"

{
  "id": "example:listaddresses#1",
  "method": "listaddresses",
  "params": [
    "bcrt1p2gppccw6ywewmg74qqxxmqfdpjds3rpr0mf22y9tm9xcc0muggwsea9nkf"
  ]
}

Response:

{
  "addresses": [
    {
      "keyidx": 14,
      "p2tr": "bcrt1p2gppccw6ywewmg74qqxxmqfdpjds3rpr0mf22y9tm9xcc0muggwsea9nkf"
    }
  ]
}

look at that β€” she found the address, keyidx 14, tapped in and tapped root-ed πŸ’…βœ¨


Example 2 πŸŽ€

Request:

$ lightning-cli listaddresses -k "start"=6 "limit"=2

{
  "id": "example:listaddresses#2",
  "method": "listaddresses",
  "params": {
    "start": 6,
    "limit": 2
  }
}

Response:

{
  "addresses": [
    {
      "keyidx": 6,
      "bech32": "bcrt1qkpw662yvzdy5ttdg8nw4eh4el0uc7m2ythw0h3"
    },
    {
      "keyidx": 7,
      "p2tr": "bcrt1pn45xgkyj54usdu98plm4zgcp4c5jvvfxmyexwcm5kc3gyfsrjmasd6ctsf"
    }
  ]
}

start at 6, limit to 2, and boom β€” you get keyidx 6 (bech32) and keyidx 7 (p2tr). two icons, one response 🀩


friendly reminder bestie: address, start and limit are all optional β€” if you just yell listaddresses into the void, it defaults to starting at 1 and returning Total number of addresses issued. no surprises, no drama, just vibes πŸ“

okay that's the whole page! this one's brought to you by Core Lightning v26.06.9 β€” shoutout to the version tag holding it down at the bottom of the manpage, we love a consistent queen πŸ§šβ€β™€οΈπŸ’œ periodt.

πŸ“¦ where this page comes from