lightning-multiwithdraw

lightning-multiwithdraw -- Command for withdrawing to multiple addresses

SYNOPSIS

multiwithdraw outputs [feerate] [minconf] [utxos]

DESCRIPTION

The multiwithdraw RPC command sends funds from Core Lightning's internal wallet to the addresses specified in outputs.

  • outputs (array of outputdescs): An array containing objects of the form {address: amount}. The amount may be the string all, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in sat, a whole number ending in 000msat, or a number with 1 to 8 decimal places ending in btc.:
    • (outputdesc, optional)
  • feerate (feerate, optional): Feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values. The default is normal.
  • minconf (u32, optional): Minimum number of confirmations that used outputs should have. The default is 1.
  • utxos (array of outpoints, optional):
    • (outpoint, optional): Utxos to be used to be withdrawn from, as an array of txid:vout. These must be drawn from the node's available UTXO set.

RETURN VALUE

On success, an object is returned, containing:

  • tx (hex): The raw transaction which was sent.
  • txid (txid): The txid of the tx.

ERRORS

On failure, an error is reported and the withdrawal transaction is not created.

  • -1: Catchall nonspecific error.
  • 301: There are not enough funds in the internal wallet (including fees) to create the transaction.
  • 302: The dust limit is not met.

AUTHOR

ZmnSCPxj <[email protected]> is mainly responsible.

SEE ALSO

lightning-listfunds(7), lightning-fundchannel(7), lightning-newaddr(7), lightning-txprepare(7), lightning-withdraw(7)

RESOURCES

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

EXAMPLES

Example 1:

Request:

lightning-cli multiwithdraw -k "outputs"='[{"bcrt1q84payf4ucfcpnt0994arm3f20tqmu29cna738w": "2222000msat"}, {"bcrt1q64wyjwvrmdj3uyz8w32mr4qgcv08a833zepjm3": "3333000msat"}]'
{
  "id": "example:multiwithdraw#1",
  "method": "multiwithdraw",
  "params": {
    "outputs": [
      {
        "bcrt1q84payf4ucfcpnt0994arm3f20tqmu29cna738w": "2222000msat"
      },
      {
        "bcrt1q64wyjwvrmdj3uyz8w32mr4qgcv08a833zepjm3": "3333000msat"
      }
    ]
  }
}

Response:

{
  "tx": "02000000000155multiw55000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000",
  "txid": "txid5500055000550005500055000550005500055000550005500055000"
}

Example 2:

Request:

lightning-cli multiwithdraw -k "outputs"='[{"bcrt1p97zrhgxgm6wscsdx8gjafj4jyqetunat7fynrk4cyg2rz6lzrr9q6dlrp2": 1000}, {"bcrt1qm7k64cvd2ljw758ptwrrm8ny30u67ea3cfkxpn": 1000}, {"bcrt1qdgvytwcw58uwlf3lqrej2eqaku6smn2mdvkycp": 1000}, {"bcrt1q68wfpfam8tu3a457jv7u8r64tdvqltgfs0kj84": 1000}, {"bcrt1qq7g9ccvfcxhg4lcj2e4s8u6l75tdzl5y7krmtl": 1000}, {"bcrt1pp9uw53lnrtt9v8vkemhpf6z3jfex2dkyu8je6z0jzlem2a3tqccqvseg2y": 1000}, {"bcrt1q5sacyx5hjrugpcgn5w2mw9aq7d2tnkwxmmjp06": 1000}]'
{
  "id": "example:multiwithdraw#2",
  "method": "multiwithdraw",
  "params": {
    "outputs": [
      {
        "bcrt1p97zrhgxgm6wscsdx8gjafj4jyqetunat7fynrk4cyg2rz6lzrr9q6dlrp2": 1000
      },
      {
        "bcrt1qm7k64cvd2ljw758ptwrrm8ny30u67ea3cfkxpn": 1000
      },
      {
        "bcrt1qdgvytwcw58uwlf3lqrej2eqaku6smn2mdvkycp": 1000
      },
      {
        "bcrt1q68wfpfam8tu3a457jv7u8r64tdvqltgfs0kj84": 1000
      },
      {
        "bcrt1qq7g9ccvfcxhg4lcj2e4s8u6l75tdzl5y7krmtl": 1000
      },
      {
        "bcrt1pp9uw53lnrtt9v8vkemhpf6z3jfex2dkyu8je6z0jzlem2a3tqccqvseg2y": 1000
      },
      {
        "bcrt1q5sacyx5hjrugpcgn5w2mw9aq7d2tnkwxmmjp06": 1000
      }
    ]
  }
}

Response:

{
  "tx": "02000000000155multiw56000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000",
  "txid": "txid5600056000560005600056000560005600056000560005600056000"
}

Core Lightning (previously c-lightning) is a lightweight, highly customizable and standard compliant implementation of the Lightning Network protocol.

© 2023 Core Lightning
All rights reserved.

Discussion Forum

The official Core Lightning forum is hosted at discuss.corelightning.org

BuildonL2 Community

The official BuildOnL2 community lives at community.corelightning.org. Join us and build the future of bitcoin on lightning.

Mailing List

For general discussions about CLN implementation, use [email protected]. For the Lightning Network, use [email protected]

Telegram

Community-driven telegram group where most of the node operators hang out. Go to https://t.me/lightningd to join.

Discord

Community-driven discord server where the devs flock together. Go to https://discord.gg/w27fMFESMN to join.

Internet Relay Chat

Don't hesitate to reach out to us on IRC at #lightning-dev @ libera.chat, #c-lightning @ libera.chat.