lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.61k stars 2.06k forks source link

[question]: does taproot channel require reserved funds? #8020

Closed starius closed 11 months ago

starius commented 11 months ago

Background

I used LND version v0.17.0-beta.rc3 and opened a taproot channel on testnet. I discovered that I have no reserved funds after that. Is it a expected behavior for a taproot channel? If yes, how does it work in case reserved funds would be needed for an old channel?

Your environment

Command line of LND:

lnd \
        --accept-keysend \
        --bitcoin.active \
        --bitcoin.testnet \
        --debuglevel=info \
        --bitcoin.node=neutrino \
        --neutrino.addpeer btcd-testnet.lightning.computer \
        --neutrino.addpeer lnd.bitrefill.com:18333 \
        --neutrino.addpeer faucet.lightning.community \
        --neutrino.addpeer testnet1-btcd.zaphq.io \
        --neutrino.addpeer testnet2-btcd.zaphq.io \
        --neutrino.addpeer testnet3-btcd.zaphq.io \
        --neutrino.addpeer testnet4-btcd.zaphq.io \
        --neutrino.feeurl https://nodes.lightning.computer/fees/v1/btctestnet-fee-estimates.json \
        --listen=0.0.0.0:9735 \
        --externalip=1.2.3.4 \
        --db.bolt.auto-compact \
        --maxpendingchannels=3 \
        --protocol.simple-taproot-chans \
        --protocol.wumbo-channels

Steps to reproduce

lncli openchannel --fundmax --channel_type taproot --private --node_key <another peer's node ID>
lncli walletbalance
...
"reserved_balance_anchor_chan": "0",
...

Expected behaviour

I thought 10k sats should had left onchain to use in case the node needs them to bump force close transaction. At least, that happened in mainnet for regular channels.

Actual behaviour

No funds left onchain.

alexbosworth commented 11 months ago

private channels are exempt

starius commented 11 months ago

Can you elaborate on that, please? Why are private channels exempt?

alexbosworth commented 11 months ago
Since private channels (most likely) won't be
used for routing other than the last hop, they bear a smaller
risk that we must force close them in order to resolve a HTLC
up/downstream. Hence we exclude them from the count of anchor
channels
starius commented 11 months ago

Thank you!

Private channels don't provide anchors, do they?

alexbosworth commented 11 months ago

they do

starius commented 11 months ago

How such anchors would be used in absence of reserve funds?

alexbosworth commented 11 months ago

Without any on chain funds the anchors can't be used because the child tx couldn't be formed to do CPFP

guggero commented 11 months ago

The reserve is there to make sure the node can react in a timely manner without user interaction when urgent (as mentioned above when needing to resolve up/downstream HTLCs). For confirming the funds of a force close without HTLCs (or non-urgent ones) the user would still need to add on-chain funds, but that wouldn't be as time critical. Or you rely on the other side to CPFP with their anchor.

To summarize: when it comes to anchor outputs, taproot channels don't behave any differently than the previous anchor output channel type.