2018-05-03 16:54:39 +02:00
LIGHTNING-FUNDCHANNEL(7)
========================
:doctype: manpage
NAME
----
lightning-fundchannel - Command for establishing a lightning channel.
SYNOPSIS
--------
2019-06-08 15:56:40 +02:00
*fundchannel* 'id' 'satoshi' ['feerate' 'announce'] ['minconf'] ['utxos']
2018-05-03 16:54:39 +02:00
DESCRIPTION
-----------
2018-09-07 16:47:47 +02:00
The *fundchannel* RPC command opens a payment channel with a peer by committing
2018-05-03 16:54:39 +02:00
a funding transaction to the blockchain as defined in BOLT #2.
*fundchannel* by itself does not attempt to open a connection.
A connection must first be established using *connect*.
Once the transaction is confirmed, normal channel operations may begin.
Readiness is indicated by *listpeers* reporting a 'state' of CHANNELD_NORMAL
for the channel.
'id' is the peer id obtained from *connect*.
'satoshi' is the amount in satoshis taken from the internal wallet to fund the channel.
2018-07-29 07:51:38 +02:00
The string 'all' can be used to specify all available funds (or 16777215 satoshi if more is available).
2019-02-23 02:05:51 +01:00
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'.
2018-07-29 07:51:38 +02:00
The value cannot be less than the dust limit, currently set to 546, nor more
than 16777215 satoshi.
2018-05-03 16:54:39 +02:00
2019-02-15 20:00:16 +01:00
'feerate' is an optional feerate used for the opening transaction and as initial feerate for
commitment and HTLC transactions. It can be one of the strings
2019-05-24 22:01:17 +02:00
'urgent' (aim for next block), 'normal' (next 4 blocks or so) or 'slow' (next
100 blocks or so) to use lightningd's internal estimates:
2018-08-28 22:46:34 +02:00
'normal' is the default.
2018-12-08 00:40:14 +01:00
'announce' is an optional flag that triggers whether to announce
this channel or not. Defaults to `true`. An unannounced channel
is considered private.
2018-08-28 22:46:34 +02:00
Otherwise, 'feerate' is a number, with an optional suffix:
2018-08-28 22:46:32 +02:00
'perkw' means the number is interpreted as satoshi-per-kilosipa
(weight), and 'perkb' means it is interpreted bitcoind-style as
satoshi-per-kilobyte. Omitting the suffix is equivalent to 'perkb'.
2018-08-27 07:13:57 +02:00
2019-04-08 16:20:49 +02:00
'minconf' specifies the minimum number of confirmations that used outputs should have. Default is 1.
2019-06-08 15:56:40 +02:00
'utxos' specifies the utxos to be used to fund the channel, as an array of "txid:vout".
2018-05-03 16:54:39 +02:00
RETURN VALUE
------------
On success, the 'tx' and 'txid' of the transaction is returned, as well as the
'channel_id' of the newly created channel.
On failure, an error is reported and the channel is not funded.
The following error codes may occur:
2018-06-15 18:45:06 +02:00
* -1. Catchall nonspecific error.
* 300. The maximum allowed funding amount is exceeded.
* 301. There are not enough funds in the internal wallet (including fees) to
create the transaction.
2018-06-17 06:48:12 +02:00
* 302. The output amount is too small, and would be considered dust.
2019-01-16 14:24:30 +01:00
* 303. Broadcasting of the funding transaction failed, the internal call to
bitcoin-cli returned with an error.
2018-05-03 16:54:39 +02:00
Failure may also occur if *lightningd* and the peer cannot agree on channel
parameters (funding limits, channel reserves, fees, etc.).
SEE ALSO
--------
lightning-connect(7), lightning-listfunds(), lightning-listpeers(7)
RESOURCES
---------
Main web site: https://github.com/ElementsProject/lightning