docs: add BatchOpenChannel to PSBT doc and release notes

This commit is contained in:
Oliver Gugger 2021-08-24 11:21:59 +02:00
parent 7a9ee48cf1
commit 180fba056f
No known key found for this signature in database
GPG key ID: 8E4256593F177720
2 changed files with 60 additions and 0 deletions

View file

@ -582,6 +582,22 @@ signature from peer 2 to spend the funds now locked in a 2-of-2 multisig, the
fund are lost (unless peer 2 cooperates in a complicated, manual recovery fund are lost (unless peer 2 cooperates in a complicated, manual recovery
process). process).
### Privacy considerations when batch opening channels
Opening private (non-announced) channels within a transaction that also contains
public channels that are announced to the network it is plausible for an outside
observer to assume that the non-announced P2WSH output might also be a channel
originating from the same node as the public channel. It is therefore
recommended to not mix public/private channels within the same batch
transaction.
Batching multiple channels with the same state of the `private` flag can be
beneficial for privacy though. Such a transaction can't easily be distinguished
from a batch created by Pool or Loop for example. Also, because of the PSBT
funding flow, it is also not guaranteed that all channels within such a batch
transaction are actually being created for the same node. It is possible to
create coin join transactions that create channels for multiple different nodes.
### Use --no_publish for batch transactions ### Use --no_publish for batch transactions
To mitigate the problem described in the section above, when open multiple To mitigate the problem described in the section above, when open multiple
@ -589,3 +605,38 @@ channels in one batch transaction, it is **imperative to use the
`--no_publish`** flag for each channel but the very last. This prevents the `--no_publish`** flag for each channel but the very last. This prevents the
full batch transaction to be published before each and every single channel has full batch transaction to be published before each and every single channel has
fully completed its funding negotiation. fully completed its funding negotiation.
### Use the BatchOpenChannel RPC for safe batch channel funding
If `lnd`'s internal wallet should fund the batch channel open transaction then
the safest option is the `BatchOpenChannel` RPC (and its
`lncli batchopenchannel` counterpart).
The `BatchOpenChannel` RPC accepts a list of node pubkeys and amounts and will
try to atomically open channels in a single transaction to all of the nodes. If
any of the individual channel negotiations fails (for example because of a
minimum channel size not being met) then the whole batch is aborted and
lingering reservations/intents/pending channels are cleaned up.
**Example using the CLI**:
```shell
⛰ lncli batchopenchannel --sat_per_vbyte=5 '[{
"node_pubkey": "02c95fd94d2a40e483e8a14be1625ad8a82263b37b6a32162170d8d4c13080bedb",
"local_funding_amount": 500000,
"private": true,
"close_address": "2NCJnjD4CZ5JvmkEo1D3QfDM57GX62LUbep"
}, {
"node_pubkey": "032d57116b92b5f64f022271ebd5e9e23826c0f34ff5ae3e742ad329e0dc5ddff8",
"local_funding_amount": 600000,
"remote_csv_delay": 288
}, {
"node_pubkey": "03475f7b07f79672b9a1fd2a3a2350bc444980fe06eb3ae38b132c6f43f958947b",
"local_funding_amount": 700000
}, {
"node_pubkey": "027f013b5cf6b7035744fd8d7d756e05675bf6e829bb75a80be5b9e8e641d20562",
"local_funding_amount": 800000
}]'
```
**NOTE**: You must be connected to each of the nodes you want to open channels
to before you run the command.

View file

@ -68,6 +68,15 @@ proposed channel type is used.
avoid misleading error messages from dependent services if they use `After` avoid misleading error messages from dependent services if they use `After`
systemd option. systemd option.
### Batched channel funding
[Multiple channels can now be opened in a single
transaction](https://github.com/lightningnetwork/lnd/pull/5356) in a safer and
more straightforward way by using the `BatchOpenChannel` RPC or the command line
version of that RPC called `lncli batchopenchannel`. More information can be
found in the [PSBT
documentation](../psbt.md#use-the-batchopenchannel-rpc-for-safe-batch-channel-funding).
## Wallet ## Wallet
* It is now possible to fund a psbt [without specifying any * It is now possible to fund a psbt [without specifying any