Christian Decker [ARCHIVE] on Nostr: 📅 Original date posted:2018-06-13 📝 Original message:Kulpreet Singh via ...
📅 Original date posted:2018-06-13
📝 Original message:Kulpreet Singh via bitcoin-dev <bitcoin-dev at lists.linuxfoundation.org>
writes:
> But if I understand correctly, lightning nodes need to check if a
> counterparty is broadcasting an old channel state and in response
> broadcast a penalty/justice transaction. Does that mean lightning
> nodes only need to watch for transactions that come after the funding
> transaction? Is that the only reason lightning needs to run bitcoind
> with txindex?
Yes, Lightning nodes need to monitor the network for transactions that
they need to react to. This is basically tailing the blockchain and
looking for anything suspicious. The `bitcoind` sitting next to the
lightning node however does not need to keep an index of the
transactions, at least for c-lightning, because we just ask for the full
block that then gets scanned for transactions of interest and then we
discard the rest of the block. We never ask for a specific transaction
from `bitcoind` and therefore we don't need to run with `-txindex`.
> If that is the case, and a lightning node only needs to query
> transactions broadcast after the funding transaction, then a pruned
> bitcoind instance with txindex might be a bit handy.
Pruned nodes should work, as long as the current blockchain head that
the lightning node has seen does not fall into the pruned range, since
in that case it won't be able to fetch and process the blocks anymore.
> Also from [1] it seems that indexing pruned nodes is not supported
> because it doesn't make sense, not that it was infeasible. Now with
> the lightning requirements, does an indexed pruned node start to make
> sense?
I don't think we should ever require `-txindex` to run a lightning node
(I know some implementations did in the past), since that'd be a very
onerous requirement to run a lightning node. Tailing the blockchain is
more than sufficient to get the necessary data, and hopefully we can get
our reliance on `bitcoind` down to a minimum in the future.
> Once again, please forgive my naive understanding of some of the issues
> involved and thanks for your patience.
Absolutely no problem, it is a common misconception that `-txindex` is
required to run a lightning node in all cases :-)
Cheers,
Christian
Published at
2023-06-07 18:13:00Event JSON
{
"id": "763650dc80211e1e769197d11f78ebaf469f6cc7b22ca0543a7e7d046e4e4195",
"pubkey": "72cd40332ec782dd0a7f63acb03e3b6fdafa6d91bd1b6125cd8b7117a1bb8057",
"created_at": 1686161580,
"kind": 1,
"tags": [
[
"e",
"c2331da544243a5990bc730e9a7e309d1e4089ae98deca285d0dbc4110aabe22",
"",
"root"
],
[
"e",
"a077de9e5946d984ebc809dc183c75284bba6e73a1ad49e1f7c23ed7ef1773e8",
"",
"reply"
],
[
"p",
"b749a3dc826d2b504141de353c527b1837062b0a5645e3df5a2b9c2dff7d7130"
]
],
"content": "📅 Original date posted:2018-06-13\n📝 Original message:Kulpreet Singh via bitcoin-dev \u003cbitcoin-dev at lists.linuxfoundation.org\u003e\nwrites:\n\u003e But if I understand correctly, lightning nodes need to check if a\n\u003e counterparty is broadcasting an old channel state and in response\n\u003e broadcast a penalty/justice transaction. Does that mean lightning\n\u003e nodes only need to watch for transactions that come after the funding\n\u003e transaction? Is that the only reason lightning needs to run bitcoind\n\u003e with txindex?\n\nYes, Lightning nodes need to monitor the network for transactions that\nthey need to react to. This is basically tailing the blockchain and\nlooking for anything suspicious. The `bitcoind` sitting next to the\nlightning node however does not need to keep an index of the\ntransactions, at least for c-lightning, because we just ask for the full\nblock that then gets scanned for transactions of interest and then we\ndiscard the rest of the block. We never ask for a specific transaction\nfrom `bitcoind` and therefore we don't need to run with `-txindex`.\n\n\u003e If that is the case, and a lightning node only needs to query\n\u003e transactions broadcast after the funding transaction, then a pruned\n\u003e bitcoind instance with txindex might be a bit handy.\n\nPruned nodes should work, as long as the current blockchain head that\nthe lightning node has seen does not fall into the pruned range, since\nin that case it won't be able to fetch and process the blocks anymore.\n\n\u003e Also from [1] it seems that indexing pruned nodes is not supported\n\u003e because it doesn't make sense, not that it was infeasible. Now with\n\u003e the lightning requirements, does an indexed pruned node start to make\n\u003e sense?\n\nI don't think we should ever require `-txindex` to run a lightning node\n(I know some implementations did in the past), since that'd be a very\nonerous requirement to run a lightning node. Tailing the blockchain is\nmore than sufficient to get the necessary data, and hopefully we can get\nour reliance on `bitcoind` down to a minimum in the future.\n\n\u003e Once again, please forgive my naive understanding of some of the issues\n\u003e involved and thanks for your patience.\n\nAbsolutely no problem, it is a common misconception that `-txindex` is\nrequired to run a lightning node in all cases :-)\n\nCheers,\nChristian",
"sig": "01f061bb917386adceffe581a5f612018e2ba6ab8c1f2e97a9deeb351eee977d9e256cbba168217ab42e76446a1bf1d6d94b8ee8d0f3f53e8699f54c769cdf1a"
}