Open Lightning Channel
API-v2lightning::channels::open_channel
The lightning::channels::open_channel
method opens a new channel with a remote node.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
coin | string | ✓ | - | The ticker of the coin you would like to open a channel for. |
node_address | string | ✓ | - | Lightning node addresses always have a format of node_pubkey @ip_address :port . |
amount | object | ✓ | - | A standard LightningChannelAmount object. |
push_msat | integer | ✗ | 0 | The amount in millisatoshi to push to the counterparty while opening, to create inbound liquidity for the channel. Using the push_msat parameter avoids having to send funds in a separate request later. Please note that the funds given using push_msat is given unconditionally, meaning that there is no proof of payment in a preimage as with paying an invoice. |
channel_options | object | ✗ | - | A standard LightningChannelOptions object. |
channel_configs | object | ✗ | - | A standard LightningChannelConfig object. |
Parameter | Type | Description |
---|---|---|
uuid | string | The unique identifier for the opened channel. |
node_address | string | The node address of the remote node. |
id | int | Request identifier. |
Open Channel (Exact Amount)
POST
open_channel{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "lightning::channels::open_channel",
"params": {
"coin": "tBTC-lightning",
"node_address": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9@203.132.94.196:9735",
"amount": {
"type": "Exact",
"value": 0.004
}
},
"id": 22
}
Open Channel (Max Amount with Options)
POST
open_channel{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "lightning::channels::open_channel",
"params": {
"coin": "tBTC-lightning",
"node_address": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9@203.132.94.196:9735",
"amount": {
"type": "Max"
},
"push_msat": 0,
"channel_options": {
"proportional_fee_in_millionths_sats": 0,
"base_fee_msat": 1000,
"cltv_expiry_delta": 72,
"max_dust_htlc_exposure_msat": 5000000,
"force_close_avoidance_max_fee_satoshis": 1000
},
"channel_configs": {
"counterparty_locktime": 144,
"our_htlc_minimum_msat": 1,
"negotiate_scid_privacy": false,
"max_inbound_in_flight_htlc_percent": 10,
"commit_upfront_shutdown_pubkey": true,
"inbound_channels_confirmations": 3,
"their_channel_reserve_sats": 10000
}
},
"id": null
}