2019-08-31 14:30:56 +02:00
lightning-fundchannel\_start -- Command for initiating channel establishment for a lightning channel
====================================================================================================
2019-08-10 01:54:18 +02:00
SYNOPSIS
--------
2024-01-02 13:01:37 +01:00
**fundchannel\_start** *id* *amount* [*feerate* *announce* *close\_to* *push\_msat* *channel\_type* ] *mindepth* *reserve* ]
2019-08-10 01:54:18 +02:00
DESCRIPTION
-----------
`fundchannel_start` is a lower level RPC command. It allows a user to
initiate channel establishment with a connected peer.
*id* is the node id of the remote peer.
2019-09-19 15:51:07 +08:00
*amount* is the satoshi value that the channel will be funded at. This
2019-08-10 01:54:18 +02:00
value MUST be accurate, otherwise the negotiated commitment transactions
will not encompass the correct channel value.
*feerate* is an optional field. Sets the feerate for subsequent
2023-06-26 08:41:21 +09:30
commitment transactions: see **fundchannel** . Note that this is ignored
for channels with *option\_anchors\_zero\_fee\_htlc\_tx* (we always use a low
commitment fee for these).
2019-08-10 01:54:18 +02:00
2019-08-21 15:55:49 +07:00
*announce* whether or not to announce this channel.
2022-11-10 20:44:56 -05:00
*close\_to* is a Bitcoin address to which the channel funds should be sent to
2019-10-15 11:38:33 +10:30
on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` .
Returns `close_to` set to closing script iff is negotiated.
2022-11-10 20:44:56 -05:00
*push\_msat* is the amount of millisatoshis to push to the channel peer at
2019-12-20 23:53:12 -06:00
open. Note that this is a gift to the peer -- these satoshis are
added to the initial balance of the peer at channel start and are largely
unrecoverable once pushed.
2024-01-29 10:04:17 +10:30
*channel\_type* *(added v24.02)* is an array of bit numbers, representing the explicit
channel type to request. BOLT 2 defines the following value types:
```
The currently defined basic types are:
- no features (no bits set) `[]`
- `option_static_remotekey` (`[12]` )
- `option_anchor_outputs` and `option_static_remotekey` (`[20, 12]` )
- `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` ([22, 12])
Each basic type has the following variations allowed:
- `option_scid_alias` ([46])
- `option_zeroconf` ([50])
```
2024-01-02 13:01:37 +01:00
*mindepth* is the number of confirmations before we accept the channel as
active.
*reserve* is the amount we want the peer to maintain on its side of the channel.
Default is 1% of the funding amount. 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* .
2019-08-21 15:55:49 +07:00
Note that the funding transaction MUST NOT be broadcast until after
channel establishment has been successfully completed by running
`fundchannel_complete` , as the commitment transactions for this channel
are not secured until the complete command succeeds. Broadcasting
transaction before that can lead to unrecoverable loss of funds.
2019-08-10 01:54:18 +02:00
RETURN VALUE
------------
doc/schemas: disableoffer, disconnect, feerates, fetchinvoice, fundchannel, fundchannel_cancel, fundchannel_complete, fundchannel_start, fundpsbt, getinfo, getlog, getroute.
We also add a test for getlog, since it was never called by the
testsuite.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-26 17:05:01 +09:30
[comment]: # (GENERATE-FROM-SCHEMA-START)
On success, an object is returned, containing:
2022-09-06 07:03:09 +09:30
2022-09-06 07:15:06 +09:30
- **funding\_address** (string): The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET.
doc/schemas: disableoffer, disconnect, feerates, fetchinvoice, fundchannel, fundchannel_cancel, fundchannel_complete, fundchannel_start, fundpsbt, getinfo, getlog, getroute.
We also add a test for getlog, since it was never called by the
testsuite.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-26 17:05:01 +09:30
- **scriptpubkey** (hex): The raw scriptPubkey for the address
2024-01-29 10:08:40 +10:30
- **channel\_type** (object): channel\_type as negotiated with peer *(added v24.02)* :
- **bits** (array of u32s): Each bit set in this channel\_type *(added v24.02)* :
- Bit number
- **names** (array of strings): Feature name for each bit set in this channel\_type *(added v24.02)* :
- Name of feature bit (one of "static\_remotekey/even", "anchor\_outputs/even", "anchors\_zero\_fee\_htlc\_tx/even", "scid\_alias/even", "zeroconf/even")
2022-11-10 21:03:13 -05:00
- **close\_to** (hex, optional): The raw scriptPubkey which mutual close will go to; only present if *close\_to* parameter was specified and peer supports `option_upfront_shutdown_script`
2021-09-03 19:37:59 +09:30
2022-03-20 16:07:48 +01:00
The following warnings may also be returned:
2022-09-06 07:03:09 +09:30
2022-09-06 07:15:06 +09:30
- **warning\_usage**: A warning not to prematurely broadcast the funding transaction (always present!)
2022-03-20 16:07:48 +01:00
doc/schemas: disableoffer, disconnect, feerates, fetchinvoice, fundchannel, fundchannel_cancel, fundchannel_complete, fundchannel_start, fundpsbt, getinfo, getlog, getroute.
We also add a test for getlog, since it was never called by the
testsuite.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-05-26 17:05:01 +09:30
[comment]: # (GENERATE-FROM-SCHEMA-END)
2019-08-10 01:54:18 +02:00
2020-01-05 16:40:17 +01:00
On error the returned object will contain `code` and `message` properties,
with `code` being one of the following:
- -32602: If the given parameters are wrong.
- -1: Catchall nonspecific error.
- 300: The amount exceeded the maximum configured funding amount.
- 301: The provided `push_msat` is greater than the provided `amount` .
- 304: Still syncing with bitcoin network
- 305: Peer is not connected.
2024-01-02 13:01:37 +01:00
- 306: Unknown peer id
- 312: Peer negotiated `option_dual_fund` , must use `openchannel_init` not `fundchannel_start` . (Only if ``experimental-dual-fund` is enabled)
2019-08-10 01:54:18 +02:00
AUTHOR
------
Lisa Neigut < < niftynei @gmail .com > > is mainly responsible.
SEE ALSO
--------
2021-03-09 15:14:08 -06:00
lightning-connect(7), lightning-fundchannel(7), lightning-multifundchannel(7),
2019-08-10 01:54:18 +02:00
lightning-fundchannel\_complete(7), lightning-fundchannel\_cancel(7)
2021-03-10 22:33:47 -06:00
lightning-openchannel\_init(7), lightning-openchannel\_update(7),
2021-03-09 15:14:08 -06:00
lightning-openchannel\_signed(7), lightning-openchannel\_bump(7),
lightning-openchannel\_abort(7)
2019-08-10 01:54:18 +02:00
RESOURCES
---------
Main web site: < https: / / github . com / ElementsProject / lightning >
2020-08-25 11:03:16 +09:30
2024-01-29 10:08:40 +10:30
[comment]: # ( SHA256STAMP:55a714d25c1e01c90076462f022ad814aad42bbf824ba44060d406d53ebcad0c)