LIGHTNING-LISTFUNDS(7)

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

πŸ’Έ LIGHTNING-LISTFUNDS(7) β€” the vibe check on ur bag πŸ’…

okay so first things first: this is the manual page for lightning-listfone... no wait, lightning-listfunds, part of the LIGHTNING manual section 7. Bestie, this is literally the "where's my money" command and I'm obsessed. Let's go πŸŽ€


✨ NAME ✨

listfunds β€” the command that shows you, like, all the funds ur Core Lightning node is currently managing. ur whole bag, one call. no cap πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

listfunds [spent]

🌸 DESCRIPTION 🌸

The listfunds RPC command displays all funds available β€” either sitting in unspent outputs (UTXOs) in the internal wallet, or locked up in channels that are currently open. it's giving "financial transparency" and honestly? iconic. ✨

  • spent (boolean, optional): if you set this to True, then the outputs will include spent outputs in addition to the unspent ones. the default is False. so like, by default it only shows u the money u can still touch 🫢

πŸ‘‘ RETURN VALUE πŸ‘‘

On success, an object is returned, containing:

  • outputs (array of objects) β€” the wallet UTXO situation:
    • txid (txid): the ID of the spendable transaction.
    • output (u32): the index within txid.
    • amount_msat (msat): the amount of the output.
    • scriptpubkey (hex): the scriptPubkey of the output.
    • status (string) (one of "unconfirmed", "confirmed", "spent", "immature")
    • reserved (boolean): whether this UTXO is currently reserved for an in-flight tx.
    • address (string, optional): the bitcoin address of the output.
    • redeemscript (hex, optional): the redeemscript, only if it's p2sh-wrapped.

If status is "confirmed": blockheight (u32): block height where it was confirmed.

If reserved is "true": reserved_to_block (u32): block height where reservation will expire.

  • channels (array of objects) β€” the channel bag:
    • peer_id (pubkey): the peer with which the channel is opened.
    • our_amount_msat (msat): available satoshis on our node's end of the channel.
    • amount_msat (msat): total channel value.
    • funding_txid (txid): funding transaction id.
    • funding_output (u32): the 0-based index of the output in the funding transaction.
    • connected (boolean): whether the channel peer is connected.
    • state (string) (one of "OPENINGD", "CHANNELD_AWAITING_LOCKIN", "CHANNELD_NORMAL", "CHANNELD_SHUTTING_DOWN", "CLOSINGD_SIGEXCHANGE", "CLOSINGD_COMPLETE", "AWAITING_UNILATERAL", "FUNDING_SPEND_SEEN", "ONCHAIN", "DUALOPEND_OPEN_INIT", "DUALOPEND_AWAITING_LOCKIN", "CHANNELD_AWAITING_SPLICE", "DUALOPEND_OPEN_COMMITTED", "DUALOPEND_OPEN_COMMIT_READY"): the channel state, in particular CHANNELD_NORMAL means the channel can be used normally. πŸ’…
    • channel_id (hash): the full channel_id (funding txid Xored with output number). (added v23.05) ⭐

If state is "CHANNELD_NORMAL": short_channel_id (short_channel_id): short channel id of channel.

If state is "CHANNELD_SHUTTING_DOWN", "CLOSINGD_SIGEXCHANGE", "CLOSINGD_COMPLETE", "AWAITING_UNILATERAL", "FUNDING_SPEND_SEEN" or "ONCHAIN": short_channel_id (short_channel_id, optional): short channel id of channel (only if funding reached lockin depth before closing).

fr fr bestie, read ur state field before u panic. CHANNELD_NORMAL = all good, main character energy. ONCHAIN = the channel is doing its on-chain era. 🧚

🫢 AUTHOR 🫢

Felix fixone@gmail.com is mainly responsible. thank u Felix, u ate πŸ’–


🌈 SEE ALSO 🌈

lightning-newaddr(7), lightning-fundchannel(7), lightning-withdraw(7), lightning-listtransactions(7)


πŸ”₯ RESOURCES πŸ”₯

Main web site: https://github.com/ElementsProject/lightning


πŸ’œ EXAMPLES πŸ’œ

Example 1:

Request:

$ lightning-cli listfunds
{
  "id": "example:listfunds#1",
  "method": "listfunds",
  "params": {}
}

Response:

{
  "outputs": [
    {
      "txid": "txid000010000100001000010000100001000010000100001000010000100001",
      "output": 2,
      "amount_msat": 26000000,
      "scriptpubkey": "scriptpubkey01010101010101010101010101010101010101010101010101010101",
      "address": "bcrt1p0004040404040404040404040404040404040404040404040404040404",
      "status": "confirmed",
      "blockheight": 160,
      "reserved": false
    },
    {
      "txid": "txid000020000200002000020000200002000020000200002000020000200002",
      "output": 3,
      "amount_msat": 27000000,
      "scriptpubkey": "scriptpubkey02020202020202020202020202020202020202020202020202020202",
      "address": "bcrt1p0004040404040404040404040404040404040404040404040404040404",
      "status": "confirmed",
      "blockheight": 160,
      "reserved": false
    },
    {
      "txid": "txid000030000300003000030000300003000030000300003000030000300003",
      "output": 4,
      "amount_msat": 28000000,
      "scriptpubkey": "scriptpubkey03030303030303030303030303030303030303030303030303030303",
      "address": "bcrt1p0004040404040404040404040404040404040404040404040404040404",
      "status": "confirmed",
      "blockheight": 160,
      "reserved": false
    }
  ],
  "channels": [
    {
      "peer_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
      "connected": true,
      "state": "CHANNELD_NORMAL",
      "channel_id": "channelid0120000120000120000120000120000120000120000120000120000",
      "short_channel_id": "109x1x1",
      "our_amount_msat": 36000000,
      "amount_msat": 11000000,
      "funding_txid": "txid010010100101001010010100101001010010100101001010010100101001",
      "funding_output": 1
    },
    {
      "peer_id": "nodeid050505050505050505050505050505050505050505050505050505050505",
      "connected": false,
      "state": "ONCHAIN",
      "channel_id": "channelid1300013000130001300013000130001300013000130001300013000",
      "our_amount_msat": 37000000,
      "amount_msat": 12000000,
      "funding_txid": "txid010020100201002010020100201002010020100201002010020100201002",
      "funding_output": 2
    },
    {
      "peer_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
      "connected": false,
      "state": "ONCHAIN",
      "channel_id": "channelid1100011000110001100011000110001100011000110001100011000",
      "our_amount_msat": 38000000,
      "amount_msat": 13000000,
      "funding_txid": "txid010030100301003010030100301003010030100301003010030100301003",
      "funding_output": 3
    }
  ]
}

okay that's the whole page bestie, u are now officially a listfunds understander πŸ’…βœ¨

this lil guide ships with Core Lightning v26.06.9 β€” go check ur bag, u earned it πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from