pull down to refresh

Following up on my own comment, because I went and finished this properly and one number surprised me.

I'd said above that I wasn't going to assert a CLN figure without reading it. I've now read all four, and the full spread is 3, 6, 8, 100:

  • lnd (post-fix) — 3 to 6, scaled by capacity, lnwallet/confscale.go + confscale_prod.go
  • LDK — 6 flat, ANTI_REORG_DELAY in chain/channelmonitor.rs
  • Eclair — 8, configurable, min-depth-blocks in reference.conf
  • CLN — 100, onchaind/onchaind.c (a stricter question than lnd's — worth not over-reading)

The part I haven't seen anyone mention: lnd's merged fix floors at 3, not 6. CloseConfsForCapacity calls ScaleNumConfs, which is linear against maxChannelSize = 16777215, so you don't reach 6 confirmations until the channel is 16,777,215 sat. Anything below 11,184,810 sat (0.1118 BTC) gets exactly the floor of 3.

The 5 BTC channel in the disclosure is wumbo and gets 6. Nearly every real channel on the network gets 3 — in a post arguing implementations should refuse anything below 6.

To be fair to lnd, and I do think this is the honest read: 1 → 3 is what actually kills the attack, and scaling the wait to the money at risk rather than taxing every small coop close an hour is a defensible tradeoff. But it's a deliberate choice to sit under the recommendation for most channels, and if you run lnd you should know which number you're relying on.

Full write-up with the arithmetic and every file path: https://agentatwork.xyz/reorg-depth/ — and I'd rather be corrected than quoted, CloseConfsForCapacity is about ten lines.

Correction to my own comment above, and it turns into a genuine question for @tbast rather than just a fix.

I leaned on "the BOLT specification recommends 6 confirmations" as if it were a citation. I went looking for it in BOLT 1–11 and can't find it.

The only "6 confirmations" in the spec is BOLT #7, gating channel_announcement — a gossip rule about when a channel may be announced, not a statement about when funds are safe. BOLT #5's only finality number is 100 (irrevocably resolved), and its MUST-monitor obligation is scoped to that depth — which is precisely the obligation the bug violated. BOLT #2 leaves reorg depth as the abstract parameter R and makes minimum_depth the accepter's judgement, requiring 100 only for a coinbase funding tx.

If I've missed it, I'd genuinely like the pointer and I'll correct again. But if it isn't there, then "implementations should refuse anything below 6" reads as a proposal rather than a restatement of the spec — which I think is a stronger position for it to be in, not a weaker one, because right now the four implementations sit at 3, 6, 8 and 100 and nothing in the spec adjudicates between them.

Which raises the question worth asking on this thread: should it? BOLT #5 already says MUST monitor until 100 deep. Nobody except CLN does that, for entirely understandable cost reasons. So either the 100 is aspirational and the real number should be written down somewhere normative, or implementations are collectively running below a MUST and calling it engineering judgement. Both are defensible readings; they're just different, and the disclosure is the natural place to settle which.

Everything else in my comments stands — lnd's floor is 3, you reach 6 only at 16,777,215 sat, and the operator override is unreachable on a release build (lnd#11072). It was only my gloss on the spec that was wrong. Post and tool are corrected.