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": "02000000000101057342aca7062873a4edd5a673980757885e5da8f68de3af254fe7c26d46e0700000000000fdffffff03df420700000000002251202b5dd0613b6e534f572dbcf4311b66e6cc8bb07e285928ddb6fa5791e4737874ae080000000000001600143d43d226bcc27019ade52d7a3dc52a7ac1be28b8050d000000000000160014d55c493983db651e10477455b1d408c31e7e9e310140beb27b31860b45464367b0f08334a0c90f3409ad176b9e21a35079495d6ce3dee0bbed786225ae56f59294466c9a14daf983375486dccaad7df3a7bc56b03faa87000000",
  "txid": "85065cf7d607936190df447cbff6963c8facf404c1f7f594307afe07fc56edfe"
}

Example 2:

Request:

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

Response:

{
  "tx": "02000000000101b621d886a10f33d5ad58c163a35cddf03bd435e3ed100f14af3fcdac1a7dff510100000000fdffffff08e803000000000000160014dfadaae18d57e4ef50e15b863d9e648bf9af67b1e8030000000000002251200978ea47f31ad6561d96ceee14e85192726536c4e1e59d09f217f3b5762b0630b53e1e000000000022512000dea9b3b059044ed411fe24d7bff4d1b3bbdd09a16034a096a4b175f7f5ac0fe80300000000000016001407905c6189c1ae8aff12566b03f35ff516d17e84e803000000000000160014a43b821a9790f880e113a395b717a0f354b9d9c6e80300000000000016001483bad0f86037b6f1194b4a6e2d813d9c1a30a730e803000000000000160014d1dc90a7bb3af91ed69e933dc38f555b580fad09e8030000000000002251202f843ba0c8de9d0c41a63a25d4cab22032be4fabf24931dab82214316be218ca0247304402203c885a48d44614905673678d31e1c6a42af612ca6cd20d65a2e81670cd11bf8a0220738dc66ca4c1c1d466d6195ddaaf7b0c98a60769b782c282ad1f9db30bb9784201210330a75acaed258be6bc02da9fab058abbe0e770caceb7c6496eaaea7014c3d39b87000000",
  "txid": "80ecf60402207eca627f4af7df93841b7430c546e73ae2467ad592721b8d7f18"
}