Bitcoin Optech Podcast

Bitcoin Optech #433: Core Lightning DoS, Bitcoin Core 31.3, and Testnet 5 Updates

1h 21m Listen to the original Episode page
Bitcoin CoreCore LightningLightning Development KitBTCPay ServerTestnet 5BIP EditorsSecurity Vulnerabilities

Summary

Speakers detail a denial-of-service vulnerability in Core Lightning versions 0.12 through 26.06.07 that crashes nodes via channel ID derivation bugs. Greg Sanders discloses a medium-severity vulnerability in Bitcoin Core prior to 30.5/31.3 involving duplicate orphan transaction announcements. The episode covers the release of Bitcoin Core 31.3 and 30.5, deprecation of the encrypt wallet RPC, and multiple bug fixes in LDK and LND. Speakers also discuss refreshing the BIP editor team, Testnet 5 ecosystem activity, and BTCPay Server updates for Core Lightning.

Episode sections

  1. 0:44 – 16:58

    DoS Vulnerability in Core Lightning

    Nishant Bansal details a denial-of-service vulnerability in Core Lightning (CLN) affecting versions 0.12 through 26.06.07. The bug allows an attacker to crash a node by exploiting channel ID derivation from funding outpoints, leading to conflicting channel daemons and assertion failures upon reconnection or restart.

  2. 16:58 – 25:56

    Medium-Severity Vulnerability in Bitcoin Core

    Greg Sanders disclosed a medium-severity vulnerability in Bitcoin Core affecting versions prior to 30.5 and 31.3. The issue allows a peer to stall a node temporarily by sending inventory messages with duplicate orphan transaction announcements, causing excessive processing time.

  3. 25:56 – 37:16

    Refreshing BIP Editors

    Mark 'Murch' Erhardt discusses a proposal to refresh the BIP editor team, aiming to increase active editors from two to three or four to prevent burnout and ensure continuity. He clarifies that BIP editors filter for relevance but do not dictate protocol adoption, which is an emergent ecosystem process.

  4. 37:16 – 41:53

    Discussion on refreshing BIP editors

    Speaker 2 advocates for refreshing the BIP editor group to include only those actively contributing daily to reduce the bystander effect. Speaker 0 clarifies that most BIP editor tasks are open to public contribution, with editors primarily handling number assignment and merge rights. Speaker 2 confirms the selection process is informal and consensus-based via the mailing list.

  5. 41:53 – 53:16

    Stack Exchange Q&A: Miniscript and Stack Data

    Speakers discuss a Miniscript policy that compiles in Rust but fails on the SIPA site due to inherent malleability and lack of signature when a pre-image is revealed. They also explain why Bitcoin opcodes do not push spending transaction data onto the stack, citing consensus safety and stack manipulation constraints in soft forks.

  6. 53:16 – 1:00:09

    Bitcoin Core 31.3 Release and Deprecation

    Bitcoin Core 31.3 and 30.5 are released to fix a DoS vulnerability. Pull request #36387 deprecates the `encrypt wallet` RPC because it generates a new seed without removing unencrypted key material from disk, risking exposure. Speakers recommend creating a new wallet instead of encrypting an existing one.

  7. 1:00:09 – 1:02:18

    Core Lightning Bug Fix

    Core Lightning PR #9718 fixes a bug where a failed RPC call to Bitcoin Core during channel cancellation was misinterpreted as an output being absent, causing the node to stop tracking a potentially broadcast channel. The fix ensures failed calls are reported as errors rather than empty responses.

  8. 1:02:18 – 1:08:59

    Lightning Dev Kit (LDK) Race Condition and Fee Issues

    LDK PR #5663 fixes a race condition where a node could lose funds if a channel force-closed before an HTLC pre-image was persisted to disk, preventing fee bumping of a claim transaction. LDK PR #5678 fixes an issue where penalty transactions did not use urgent fee rates if no HTLCs were present, risking theft during fee pressure.

  9. 1:08:59 – 1:14:03

    Lightning Network Daemon (LND) Fixes

    LND PR #11607 fixes weight estimation for penalty transactions spending HTLC outputs, preventing mempool rejection due to underestimated fees. LND PR #11247 fixes a cache bug in historical chain scans that could miss confirmations, requiring a restart with `--hiddenhintcachequerydisable`. LND PR #11268 fixes an unnecessary force close caused by missing persistence of fee updates.

  10. 1:14:03 – 1:15:23

    Software Development Commentary

    Speaker 2 comments that several recent Lightning bugs stem from premature optimization, advising developers to ensure correctness with simple implementations and robust test suites before attempting performance optimizations.

  11. 1:15:23 – 1:15:53

    Rust Bitcoin 7160 and Testnet 5 Support

    Speaker 3 explains that PR #7160 adds correct Testnet 5 support to Rust Bitcoin, replacing placeholder parameters from BIP 95 with values discussed in previous newsletters. This ensures the library implements Testnet 5 correctly.

  12. 1:15:53 – 1:16:29

    Testnet 5 Ecosystem Activity

    Speaker 2 notes that Testnet 5 has seen significant activity, with P2Pool v2 testing and Brandon Black's RBitcoin project already supporting it. Mining on Testnet 5 using RBitcoin indicates a strong initial launch.

  13. 1:16:29 – 1:18:01

    BTCPay Server PR #7846: CLN REST and Runes

    PR #7846 adds support for Core Lightning v24.11+ via a new CLN REST connection system using 'runes' (specific credentials). This restricts BTCPay Server permissions to actions like creating invoices, unlike previous full-permission RPC connections. It also changes certificate trust configuration to environment variables.

  14. 1:18:01 – 1:21:07

    Clarification on Runes vs Macaroons

    Speaker 2 asks if 'runes' are analogous to 'macaroons' (fancy cookies) used in LND. Speaker 3 confirms that runes are the equivalent credential system for Core Lightning.

Assets discussed

AssetKindStanceContext
BitcoinBTCcryptoneutralLast question from Stack Exchange. Why does no Bitcoin opcode push data about the spending transaction onto the stack?

“Stance” is how the speakers talked about the asset, not a recommendation.

Claims worth verifying

Speaker 2 prefers BIP editors to be only those contributing day-to-day to lower the bystander effect.

Speaker 3 ·37:16

How to verify: Check the Bitcoin BIP mailing list archives for discussions on BIP editor selection and activity levels. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

Speaker 0 estimates 99% of BIP editor tasks can be done by anyone.

Speaker 1 ·38:03

How to verify: Review the responsibilities of BIP editors as defined in BIP-1 and the Bitcoin Core developer documentation. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

Revealing a pre-image after 144 blocks makes funds 'up for grabs' by miners.

Unknown speaker ·43:15

How to verify: Analyze the Bitcoin script language specification regarding hash pre-image reveals and miner incentives. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

Re-indexing with a full blockchain copy and TX index takes hours, not days, on modern hardware.

Unknown speaker ·45:13

How to verify: Benchmark Bitcoin Core re-indexing performance on hardware with SSDs and modern CPUs using the `reindex` flag. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

Bitcoin Core 31.3 and 30.5 fix a DoS vulnerability.

Speaker 4 ·53:21

How to verify: Check the Bitcoin Core GitHub release notes for versions 31.3 and 30.5 for security advisories. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

The `encrypt wallet` RPC is deprecated because it does not remove unencrypted key material from disk.

Speaker 4 ·54:00

How to verify: Review Bitcoin Core PR #36387 and the associated rationale in the pull request discussion. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

Primary source

Core Lightning PR #9718 fixes a bug where failed RPC calls were misinterpreted as absent outputs.

Speaker 4 ·1:00:09

How to verify: Review Core Lightning PR #9718 for the bug description and fix details. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

Primary source

LND PR #11247 fixes a cache bug in historical chain scans that could miss confirmations.

Speaker 4 ·1:10:04

How to verify: Review LND PR #11247 for the cache behavior and the `--hiddenhintcachequerydisable` flag requirement. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

Primary source

Rust Bitcoin PR #7160 adds Testnet 5 support by replacing placeholder parameters from BIP 95 with correct values.

Speaker 4 ·1:15:23

How to verify: Check Rust Bitcoin repository PR #7160 and BIP 95 documentation for parameter definitions. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

P2Pool v2 is testing on Testnet 5.

Speaker 3 ·1:15:53

How to verify: Search P2Pool v2 release notes or GitHub activity for Testnet 5 mentions. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

BTCPay Server PR #7846 adds CLN REST support using 'runes' for Core Lightning v24.11+.

Speaker 4 ·1:16:29

How to verify: Check BTCPay Server repository PR #7846 for code changes related to CLN REST and runes. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

Runes are the Core Lightning equivalent of LND's macaroons.

Speaker 4 ·1:18:41

How to verify: Compare Core Lightning documentation on runes with LND documentation on macaroons. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

Primary source

BTCPay Server PRs #7850 and #7851 fix incorrect payout states in the LND Hub adapter.

Speaker 4 ·1:18:48

How to verify: Check BTCPay Server repository PRs #7850 and #7851 for code changes addressing payment error handling. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

Primary source

Previously, BTCPay Server treated HTTP 200 responses with payment errors as successful payments.

Unknown speaker ·1:19:13

How to verify: Review BTCPay Server code history or PR #7850/7851 commit messages describing the bug fix. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

LNBits uses the LND Hub adapter.

Speaker 4 ·1:19:08

How to verify: Check LNBits documentation or source code for LND Hub adapter integration. For recent events, verify 2026-09-02 through 2026-12-02. Use another period only when the speaker explicitly names it.

Primary source

Do your own research

  • Verify Core Lightning version against the range 0.12 through 26.06.07 for the DoS vulnerability.
  • Check Bitcoin Core version against 30.5 and 31.3 for the orphan transaction DoS vulnerability.
  • Review Bitcoin Core PR #36387 to understand the risks of the deprecated encrypt wallet RPC.
  • Examine LDK PR #5663 and #5678 for race conditions and fee rate issues in channel closures.
  • Review LND PR #11607, #11247, and #11268 for penalty transaction and cache bugs.
  • Verify BTCPay Server PR #7846 for new Core Lightning REST connection requirements using runes.
  • Check Testnet 5 support status in Rust Bitcoin PR #7160.
  • Review BIP editor selection process and mailing list consensus for protocol changes.
Full transcriptexpand

Voices are numbered in the order we told them apart; a name appears only when the episode itself identifies the speaker.

0:00Speaker 1: Welcome everyone to Bitcoin OpTech newsletter number 433. Recap. Today we're going to talk about a medium severity Bitcoin core vulnerability. There is a core lightning denial service disclosure.

0:13Unknown speaker: We

0:14Speaker 1: have our very own merch news item, call to action to refresh the BIP editor team. And then we have our monthly Stack Exchange segment followed by our weekly Notable Code and Release segments.

0:27Unknown speaker: This

0:27Speaker 1: week, Merch Gustavo and I are joined by one guest. Nishant, you want to introduce yourself?

0:33Speaker 2: Yeah, sure. Hey, I am Nishant and I work on fuzzing lightning implementations. Thanks for having me.

0:42Speaker 1: Awesome. Thanks for joining us again. And we're going to jump right into your news item: disclosure of a DOS vulnerability in CLN.

0:50Unknown speaker: So

0:50Speaker 1: we're a little bit out of order for listeners. But Nishant, you posted this one to Delving Bitcoin. This is a denial of service bug in core lightning. And it lets an attacker crash a victim's node over and over. And it it actually affects, if I'm understanding correctly, years of versions from 0.12 all the way through. this August, um, which is twenty-six dot zero six dot seven. And you get into a couple ways to trigger this, and I I know Eugene was involved as well, but maybe I'll let you walk through you know how you found it, what are these two ways to trigger it, and what is the end effect.

1:34Speaker 2: Yes. So in Lightning, when we open a channel specifically. the legacy V1 channel open, the both the channel peer do the channel negotiation, and then the opener creates the commitment and the funding transaction. And then it sends the commitment transaction signature to the acceptor via funding created and also the funding output with it. And the acceptor signs the commitment transaction. for the opener side and sends the commitment signature to the opener via funding signed message. So after this, the channel is identified by a channel ID, which is actually the ZOR of the funding TX ID and the output index which the opener has sent. So till this point, it's up to the opener whether it broadcasts. the transaction or whether the funding transaction it actually sent through the funding creator is actually real or it's just fake. So till uh so in the CLN, what happens is CLN assumes this channel ID is going to be unique for all this channel negotiation. So CLN has a multi-daemon architecture, and one of that daemon is connect daemon. which it used to actually connect to all those

2:54peers and then this connect daemon routes all those peer messages to the other sub daemons and the channel d uh channel d sub daemon is the one which handle all this channel related stuff so whatever uh message peers send and the connected connective will uh uh route that message to channel D via channel ID so now the the first variant of attack is attacker just has to fund the like channel maybe not actually the fund it can just send a fake funding outpoint for the two channel negotiation and what happens is CNN will accept that accept both negotiation it will send the uh funding created funding sign and stuff and after that what happens is since this channel ID now since uh CNN accepted this CNN has created two sub daemons two channel D sub daemon which are keyed by the same channel ID so now connect D is not able to distinguish between them so when the second channel D is started uh CNN is not able to distinguish so it just started starts the first channel daemon itself and it just uh discard the second one.

4:07Unknown speaker: Yeah,

4:07Speaker 2: much.

4:08Speaker 3: Let me try to recap. So when you create a new channel as the opener, oh I'm getting an echo from you. Um when you create a channel as the opener, you use the same utex out twice, and that is sufficient for CLN to create conflicting channels. channel IDs because they're derived directly from the outpoint. And then in the subsequent processing of the new channel requests, um it comes to to conflict. Is that right?

4:40Speaker 2: Yeah exactly. So both the channels are opened on the same funding UTXO. And in fact this as I said this doesn't have to be actual out outfit funding outp output itself, it could be fake as well. Because till the funding transaction is broadcast, it's just the best effort basis for the acceptor. Since acceptor is getting the inbound liquidity, it will just accept, and it isn't and the acceptor is not uh losing nothing, so it will accept that. And after that, if the commitment uh funding transaction is broadcasted, then at that point only the channel. becomes active. So in the issue issue is since these both channel demon are routed by the same channel ID, when the attacker tries to reconnect with the CLN, what connect T DMN has logic is when it tries to start the first DM, it will check that I started that, but until the I before I connect to the this channel D and Connect D, I need to ensure that these are not already connected. So they had an assert statement for that. So for the first channel, it's fine because it created that and then it connects. But for the second channel, when it tries to do that again, since this connect D daemon is looking up

5:57the channel D debate based on the channel ID, instead of uh getting the second channel, it gets the first. channel again, and because of which it trips this assertion where this first channel is already connected with the connect DML. So this is the reconnect variant of this issue, and this was actually fixed in uh version 26.6.6, and this issue this vulnerability abilities is uh like normally actually free for the attacker because it doesn't have to fund a real outpoint and uh the fix was to actually uh reject any channel which is reusing a funding outpoint of any known channel. Yes.

6:38Speaker 3: Sorry uh you said that if if what is connected are just the nodes talking to each other or is the channel open at this point?

6:48Unknown speaker: Because

6:48Speaker 3: if it were a fake output you couldn't open a channel of course.

6:52Speaker 2: So yeah, you definitely can't open a channel. So it will be stuck uh till like the CLN has sent the funding sign. And after two weeks, since the CLN has not seen that funding transaction being broadcast here or confirmed, it will effectively forget that channel. But before that also if you reconnect, since that logic is in the channel DML and CNN doesn't have to forget the channel because it has already sent the commitment signature for it. So it will try to remember that channel again. So it will start the channel DML again and that same assertion will fire. So so the this issue, uh so this vulnerability is effectively free. But the thing is uh the fix which CNN added was for only the live channel. So CLN stores both the live channel and closed channel also. So this issue was only with the case when the attacker is restarting with the live channel, so reusing the outpoint of a live channel. But in case the attacker you reuse the outpoint output of a some closed channel, then the fix which CLN added could be bypassed. So the second variant was that the attacker do the same uh channel negotiation again,

8:09but this time in second negotiation, instead of using some fake funding outpoint, it will reuse the outpoint of a some already spent, already closed channel, which CLN CNN knows about. And in CLN, what CLN does is it tries to store all the channels which are closed in a closed channel map, which is a no dupe uh no duplicate hash table. And when CL uh when the attacker tries to close the second channel tool, uh CLN will put that same channel ID in that closed channel map and it will again crash the CNN node. So this was the second variant. So the second variant has also two. cases by which uh it could be exploited. The first case is uh for the second channel once uh attacker gets the funding sign from the uh CNN it can simply send the error message to CLN and CNN will think that there is something bad uh with this channel so it will just put that channel mark this chann uh channel as close and it will put that channel in the map and it will crash. But this is the normal variant where once the if CNN restart, attacker again has to reconnect and again has to trigger the same attack. But this more severe variant is where instead of

9:29sending the error for the second negotiation, attack what attacker could do is it it can just simply broadcast the commitment transaction of. the first channel actually. So when CLN sees that this funding transaction is already spent because of that commitment transaction is uh broadcasted, it will mark that channel as on-chain D in their database. And again, this on-chain daemon Mm of CLN will resolve that channel and put that into closed close map, and again it fires the assertion. But now in this case, since the state of the channel in the database is stored as on-chain. So now attacker doesn't have to reconnect. So it will when the CLN will restart again, the on-chain will see that the database state of this channel is on-chain. So it will tries to resolve that and when it tries to move that into close, it will fire the assertion Azer Channel again. So it will crash loop uh it uh without having. the attacker to restart. So this was fixed in twenty six dot six dot eight and this does require an attacker to have a real funding output because the first channel has to be uh real UTX, so which has to be spent later on. So the only attack cost for the attacker in this case would be the on-chain fees.

10:49Speaker 3: Okay, so basically the CLN had a couple issues that were due to the channel ID being only derived from a UTXO and it basically being free for an attacker to claim to use an existing or already spent UTXO twice or even make one up. And uh this could even lead to a crash loop where CLN would automatically crash each time when it restarted due to this conflict. Do you know how this was fixed?

11:24Speaker 2: Yeah, so the first variant I already told, like uh the first variant was fixed by rejecting any funding outpoint, which CLN is aware is already being reused. But this first uh fix was only done for live channel, and that time I wasn't aware that CNN has a separate thing. They have storing the closed channel in the separate map. So I wasn't aware about the complete fix. But later on, uh when I was writing the actual report of this, so I know there was one case which was missed, so I asked LLM agents agent to tell where uh to give. me the commit where actual fix was included so that I can put a complete report for the user to be aware of. But that time in there, but in that commit uh the uh CLN has put a message that this could crash loop. So I asked LLM agent to tell me like how this could crash loop and it gave me so so that time I got aware, okay. So there is a closed channel map. uh closed channel map, and if the attacker can reuse reuse that uh it will crash loop. So the fix was uh like

12:36carry forward of the fix which was done for the reconnect variant. That instead of only checking the live channel, check the closed channel as well. So that is just a normal fix of rejecting any output which seems CLN is already aware of.

12:53Speaker 1: And am I right to understand in the order of operations here that when you discovered the first one and the fix went in, I think it was Eugene said that something looked funny about the fix or something like that. And so he dug into it on the closed channel. Do they have that right?

13:09Speaker 2: Yeah. So the first fix was uh the thing is when I tried the reconnect issue. So the thing is, since the channel ID is uh made of the ZOR of funding TX ID and outpoint, uh, but the fix which CLN added in their reconnect variant was uh to only reject a funding reuse of the funding output. But the ZOR is ZOR can be done in such a way that even if the output is different, the ZOR could be the same. So Eugene pointed out that this isn't the complete fix. So instead of checking only the output, we should check the complete channel ID. So he pointed out that maybe he dig into that and he found that there is a bug by which even if we reuse the funding output of the closed channel, we can crash the CLM.

14:02Speaker 1: Going over sort of some of the timeline here as well, is it right that there was actually a public disclosure related to this? Um around it being just a spec violation and that there was actually no security impact?

14:19Speaker 2: Yeah, exactly. So when I found this issue, I searched search all this database state and stuff because since this channel

14:26Unknown speaker: is a very important thing.

14:27Speaker 2: ID could also be keyed by the database, so I thought maybe a malicious peer could try to corrupt the database. I did all this stuff, I did some experiment, but I that time I wasn't able to uh find any case. And since the second channel, even if the outpoint is uh not real because because the attacker is reusing that, the second channel would effectively be for. forecaught after two weeks because it's commit uh its funding transaction hasn't been confirmed. So I opened a public issue but later on I I just I was running the attack program and I messed something up because of which the CL uh my attack uh attacking program restarted. But but when it restarted I saw the CLN crashed. So that time I was able to find found okay. that there is some issue in the reconnect variant. So I reported that. And that is how I like kind of reach to this vulnerability.

15:23Speaker 1: Okay. When when you mentioned attacking program, is that SMITE or is that something different?

15:29Speaker 2: So yeah, it was with SMITE. So with SMITE, uh I wrote the normal basic flow which SMITE by which Smite actually triggered that issue. But during that time, Smite didn't have any reconnect, any ways to actually reconnect. But uh, since I just messed up the noise connection that time, so my noise connection failed. And when I restarted the CNN, it just crashed because the two uh two cham channel D DML already existed at that time. So restarting CNN just failed. So I that I when I tried that, I found that.

16:03Speaker 1: What else do you think we or our audience should know about this?

16:08Speaker 2: Yeah so this this issue, both issues were fixed in dot 8 release, but uh CNN has some more severe fixes done in dot nine and dot 10. So I would say upgrade to the latest CLN release or maybe any other lightning implementation. release uh you are using.

16:29Speaker 1: Merch Gustavo, any follow-up questions? All right. We appreciate your time. This is your third disclosure with us. We did the L and D gossip one in four eleven and CLN's channel announcement bug in four twenty-nine. So appreciate your time. Keep hunting. Hopefully you don't find anything else, but I have a feeling you might. Thanks for your time and work on this, Nishant.

16:56Speaker 2: Thanks, everyone.

16:58Speaker 1: Next news item: disclosure of a medium severity vulnerability in Bitcoin Core. This is back up to the first news item for those following along. This is Greg Sanders posting a Bitcoin Core security advisory to the mailing list, maybe in an a nutshell, a peer could temporarily stop your node from processing blocks and transactions. The affected versions here are each of the 29 releases, 30 releases before 30.5, and 31 before 31.3. 32.1 already had the fix and um maybe we can jump into what exactly happened here. Oh, maybe another note. This is also one of these sort of easy-to-find, fast lane fixes we talked about with Antoine a few weeks ago.

17:51Unknown speaker: And

17:51Speaker 1: this is around orphan transactions. So your node will sometimes receive a transaction before it's it's seeing seen that transaction's parents. That's what we call an orphan. And then the node holds on to that. orphan transaction and then asks peers, hey, do you have the parents? And since 29.0, each time a peer announced an orphan that the node already had, the node would actually walk through each one of that orphan's parents and check it against its mempool and its filters of recently seen transactions. But the issue here is that one invent. in message, and that's the announcement message, you can actually have 50,000 entries in it. And Bitcoin Core didn't skip any duplicates. So an attacker could have sent, could send one orphan with thousands of missing parents, and then that M message repeat, it can keep repeating that 50,000. fifty thousand, you know, over and over. And the estimates from the disclosure say that that, you know, depending on the the node um setup or configuration and operating system and capabilities and hardware could stall that node for over a dozen seconds. So obviously when it's stalled, it they can't do other things

19:11like process bl b other blocks, et cetera, et cetera. Um and then the fix is a small one. Just handle each announced transaction once per in message and don't allow that climbing of that fifty thousand max again. So Merch, I'll pause there.

19:28Speaker 3: Well now you've already said most of the things. But uh yeah, just maybe a small clarification. When a node offers an inventory message and um

19:41Unknown speaker: well,

19:41Speaker 3: when when a node announces a transaction to us that is an orphan, we assume that they must have the parents, because otherwise they wouldn't announce the orphan transaction to us. So we'll just ask that node for the, in this case, thousands of parents. And if they just repeat the same witness tx ID in the inventory. message 50,000 times, we would do that 50,000 times for each of the thousands of parents. So yeah, uh, that's where where this long delay comes back. And basically it's just uh they send us a pretty big inventory message with all these duplicates, and we keep asking them back about the same parents so often. So uh um that slows us down, but it also kind of just um

20:32Unknown speaker: yeah,

20:33Speaker 3: it's pointless. Uh I wanted to also point out uh this problem is present in 29.x in the major release uh and 29.x is end of life, so it will not receive a fix. Uh it's fixed in the 30 dot uh major version series f 30, 31, and 32 in the latest versions of those, but it will not be fixed in twenty-nine.

21:01Speaker 1: So we mentioned that the effect that an attacker can get here is that

21:06Unknown speaker: the

21:07Speaker 1: attacker can stall the node. And the advisory describes it as a temporary stall, so this isn't a crash, this isn't a loss of funds vulnerability. It's a a stall of the node.

21:18Speaker 3: Also, it will not propagate. So this will only affect a single peer that you do it to, because peers will not propagate any orphan transactions unless they know all the then later learn about all the parents and put it in their mempool. We will only propagate transactions that we have in our own mempool that we know are topologically consistent.

21:38Speaker 1: This was found by Project Loop. This is this that's the spiral initiative that does LLM scannings across a bunch of different Bitcoin-related projects. Um Greg Sanders was the one that validated it and brought it to the Bitcoin Core security team and got that fix in. Also notable, um, Stu TXO independently reported the the same bug a little while later. Um around the time that the fix got put in. So some acknowledgments to responsible disclosure folks that chain of responsible disclosure there, and we want to thank them for that. And again, I think we, you know, I mentioned this briefly, but this is one of these easily discoverable ones. So something, something you can have a fairly generic prompt uh against an LLM. in it and it can find it. So it follows that um quicker disclosure policy that we talked about with Antoine back in 429.

22:36Speaker 3: Maybe um one comment on the timeline here. So this was reported in July 1st. It was fixed in the master branch in August, so about almost four months ago now. But um while it was fixed in 32.1 with the release, uh it was not fixed in in the um previous ma main sorry, in the previous major branches. And um so I think the timing here was such that once it was fixed in all of the current not end end-of-life, of life, the currently main maintained major branches, it was disclosed as an easily discoverable issue. So uh

23:23Unknown speaker: I

23:23Speaker 3: don't know exactly what the I'm not on the security list. I don't know exactly what the conversation here was, but presumably it was because we disclose easily discoverable issues once they're fixed in all maintained versions, not once they are fixed in a single maintained version. Otherwise, it should have been disclosed after 32.1 came out in October. But um I I mean that makes sense to me. I

23:53Unknown speaker: I

23:53Speaker 3: don't know exactly why it why these uh smaller f uh maintenance releases release is followed three weeks later. Uh I guess this is when we got to it or either way. I

24:06Unknown speaker: could also just

24:21Speaker 3: with the recent release, just around the release, right? So that would have been what, five weeks ago? So presumably does this is a follow-up to the policy change.

24:34Speaker 1: I haven't seen any chatter from the BNOC folks, B10C, and some of the monitoring folks who would probably see this sort of weird behavior if some attacker was trying to do this, at least against their particular monitoring nodes. So unclear uh if this has been attempted in in the wild.

24:58Speaker 3: Yeah, again, it it can only be done against peers that you're connected to and you have to target it specifically. You have to create that orphan transaction and then inventory it specifically to one peer. Your node wouldn't um or uh inventory a orphan that you don't actually have the parents for. Uh so this is custom software, but it is pretty easy to pull off. You can just make up UTXOs, create orphans uh that spend UTXOs that never existed. And um you can even reuse nine 900 hundred uh well, almost all of them, you just change. a single input, it'll have a new TXID, and then you can just do it again. So uh this is this is very easy to do to slow down your node if you're still running a vulnerable version. Um, but it has to be targeted specifically to your node.

25:56Speaker 1: Our last news item this week: discussion on refreshing BIP editors.

26:02Unknown speaker: No

26:03Speaker 1: outside guess on this one because we have the author here, Merch. Merch, um, you posted to the mailing list, sort of revisited your proposal from April to refresh the BIP editor team. I'm not sure that we covered that April post. So maybe you can provide some quick background for folks, and maybe even earlier than that, like where where are you coming from here?

26:25Speaker 3: Yeah. Okay. So in April 2024, we added a few new BIP editors because the BIP process had basically stalled out. And uh these new BIP editors have now been working on the repository for two and a half years as the well, new new is maybe the wrong word after two and a half years. So um throughout that I I've seen that well our

26:56Unknown speaker: uh

26:56Speaker 3: I guess that's not been super publicly known, but we we sort of had a agreement that some of us are gonna do the day-to-day work and some are gonna be more in an advisory role. But we basically had two bib web editors that were doing most of the work. and uh like the day to day, the reading of the bibs, the writing comments, the updating bibs to new statuses when that is warranted, and uh reviewing all of the LLM fixes that are coming in lately and so forth. So what I've been observing is that when one of those two bib BIP editors has other priorities or cannot allocate as much time for some period, it's all on a single set of shoulders, and that can feel like a lot of work. So I've I've been thinking quite a bit about what the right count of BIP editors would be. And my my preference would be to have three

27:56or maybe even four active editors that um look at the repository regularly. and uh contribute to the daily work on the repository because then if even if one falls off uh for some period because they have they're they're taking a break or uh have other priorities for some time, or just are too busy, whatever, uh there are two left that can share the work. And it it's not just all hanging on a single person. I had seen that occasionally there were periods when when either one or both of us were very busy that things just were sitting for quite some time and um more editors would help. On the other side I have the concern that if there are too many editors you sort of get a bystander effect. If there is uh are some people that that just um do a lot less than others, then people can get the feeling why should I do more if if others aren't? And and you sort of get uh maybe

29:05again a very different distribution of activity among the active web BIP editors. So I I came to the conclusion. that probably three would be a good count, and that's why I propose that we add uh one more BIP editor. Now we actually got several people that stepped up and were interested in taking on the role for some time. There's been quite a few people responding and supporting some of the candidates. I was on vacation last week for Thanksgiving. Hope you had a happy Thanksgiving if you celebrate. And uh I'll I'll be getting back in that discussion, but I'm pretty excited that more people are are interested in contributing. And to be honest, after two and a half years, we we had a pretty good run, but I don't need to do this for eight years like some other people. So um maybe if these new BIP editors ramp up and

30:05want to take a stronger role, at some point I can focus on other things too. Because as I've been writing, it's been about 30% of my work time, and that's a huge chunk of my focus.

30:19Speaker 1: Maybe to address potential common misconceptions. BIP editors, they are the gatekeepers. of the Bitcoin protocol. They control what goes into all the Bitcoin software and what the future of protocol changes, right?

30:34Unknown speaker: Or

30:34Speaker 1: wait,

30:34Unknown speaker: what do BIP editors do?

30:38Speaker 3: The

30:39Speaker 1: transcript won't go well for me on that one.

30:41Speaker 3: Yeah. uh it It's probably a good point to reiterate what the BIPS repository is. So the BIPS repository

30:50Unknown speaker: is a very important thing.

30:51Speaker 3: is a central place where you can publish um some proposals, documents, things of interest to the broader Bitcoin ecosystem. And the point of having BIP editors is A to yes, gatekeep in a sense, um to filter a little bit so that only things that actually add value and and should um generate some interest get published. We don't want it to to be overrun by by slop or irrelevant things or things about um topics that are not pertinent to Bitcoin. we have the idea that we want to make sure that the things that get published there are relevant to the Bitcoin ecosystem. On the other hand, BIP editors are not trying to decide for the community what gets

31:52published or adopted. What gets adopted is an ecosystem-wide emergent process as proposals mature. and get comprehensive enough to be implemented, once any Bitcoin implementations adopt it and start using it on mainnet, it moves to deployed. And if it gets broadly adopted by several projects, that is what the ecosystem has adopted. Now, of course, with with soft fork or hard fork proposals. proposals, it is more clearly distinguishable whether something has been adopted because either it is part of Bitcoin or it's not. But for most of the other BIPs that are more application based, it's just emergent and depends on what implementations uh like Bitcoin implementations adopt. Um anyway, we we're doing it better. a best effort of sort of walking that middle path between being somewhat selective and not publishing everything that gets uh submitted

33:01as pull requests because we we feel that um once things get published in the repository, they tend to get some attention, and we don't want to waste attention with things that are just not useful. But on the other hand, we want to try to make everything available that we see has gotten a bunch of effort and is a reasonable idea, technically sound and comprehensively written up. So the BIPS repository is basically a service to the ecosystem to have one place to look for proposals that is trying to be as inclusive as possible, but also selective enough that we're not wasting everyone's time.

33:46Speaker 1: Some numbers that go into this from your April post, which I think was two years in on the revamped editors. 4100 comments, almost 600 six hundred pull requests, with about 400 four hundred merged, and 42. forty-two BIPS published. I assume all of those are six months ish, uh you know, the bigger numbers now. Um and you also estimated, I think in at some point in one of the threads, five to ten hours a week for a BIP editor. Are are those numbers r all roughly correct? Any any notable trends the

34:25Unknown speaker: last six months?

34:26Speaker 3: I think um

34:28Unknown speaker: well

34:28Speaker 3: I don't I don't have the actual numbers right now how many BIPs there were, but in April there were 180 BIPs in total, and forty of those had been published in the last two years, right? So you can see that the the um

34:43Unknown speaker: at

34:43Speaker 3: least the number of published bips is was much higher in those two years compared to the BIPS repository existing for

34:50Unknown speaker: I think.

34:51Speaker 3: 15 years now. And there being 180 published in total. I think the pace has been pretty high in the last half year, too. Yeah. And then also it's gotten easier for people to write higher quality text. LLMs have gotten much better. So actually stuff that has been written up by LLMs is not completely. obvious crap at first glance anymore necessarily. You actually have to read them and and realize, oh yeah, I guess that actually can't work, or

35:25Unknown speaker: uh

35:26Speaker 3: that that can sometimes eat an hour or two to to find just to pinpoint where exactly uh proposals and ideas don't make sense. Um

35:37Unknown speaker: Yeah.

35:38Speaker 3: But

35:38Speaker 1: they can also

35:39Unknown speaker: I

35:39Speaker 1: mean people can also have a good idea and use LLM to write

35:43Unknown speaker: a bit bizarre. I mean

35:44Speaker 3: we don't forbid use of LLMs, please don't uh interpret me that way. Uh we take a similar approach as Bitcoin Core, where the people that submit proposals are responsible for the entire content of the proposal. What tools they use to produce them is up to them. But they should make sure that it's high quality, makes sense, is an actual improvement, addresses an issue that needs uh improvement, and so forth.

36:17Speaker 1: Now

36:18Unknown speaker: there

36:19Speaker 1: are five BIP editors today. Rose P said in the thread, I think he's stepping down. So what happened? hap and you want three active editors. So what happens with the seats that aren't active?

36:31Speaker 3: Well um while we sometimes also have to put a little pressure to uh vacate seats, I I think generally the idea is if people don't misuse their power, it's not that much of a problem. But I would generally like to apply D. the principle of least authority. When people don't use their authority, uh there's not or people get um elevated authority or privileges in order to perform a service. So when people don't actually um exercise those privileges at all, I think the general idea is that they should um return those privileges and return to normal user status. So my preference would be that we only have the bib editors that are actually contributing day-to-day. We can still have a chat with more people in it that advise the BIP editors for if that were interesting to people. And th that group could even be bigger than the current BIP editors.

37:44But ultimately I I would prefer that we lowered or refreshed the group to the people that actually do the work every week, because then the expectations are clearer and we might have less of a bystander effect.

38:03Speaker 1: And maybe just to note, the things that a BIP editor does, 99%, I'll just throw out that number, can be done by anybody. Um so if you're listening and you think, oh, that'd be cool, but that's um, you know, ivory tower type position, you can you can do it for one BIP, you can do it for many bips, you can essentially have all of the sort of responsibilities without without the title or the obligation to to have the pressure to do this. So folks can contribute. I I think it's maybe something that people think, oh those people do that, and no one else can do that.

38:41Speaker 3: Right. Yeah. So when someone writes a new email to the mailing list propo uh proposing their idea for a BIP, you are free to respond to that. Please make it constructive and useful. Um but that is not only uh something BIP editors can do. Anyone can can respond to new ideas for BIPs. Uh similarly, for pull requests, if you have expertise for a BIP that is being proposed, we would love you to. review it and leave comments, uh improve it and um even say that it's ready to go or whatever. The only thing that only bib editors can do is assign numbers and merge pull requests, obviously. But review especially is something that anyone can contribute to and we would appreciate more contributions to

39:42review.

39:43Speaker 1: Is there an idea of what the next steps are? Or is there a deadline? Or I I see some people putting their hat in the ring and getting some endorsements. Um is there

39:55Unknown speaker: is

39:55Speaker 1: there like a timeline, or is it just maybe a couple people get onboarded and and then it maybe later others do? Or how should people think? about what the next steps might be? Obviously we'll cover them in OpTech, but um it may be interesting for people to think looking forward.

40:11Speaker 3: Yeah, so interestingly, nobody has ever specified e process, how bib editors get selected. And um so far what we've been doing is just having open conversations in public on the mailing list where anyone that has an email account can contribute to the conversation. I assume that this will go similarly as people um put their hat in the ring, other people can say that they support or um maybe have have doubts about candidates um and and just contribute to the this conversation, I I expect that at some point someone will propose a next step and people will will um either agree or disagree with that too. But if there seems to be some sort of strong consensus or uh doubts have been raised and addressed and and we we seem to come to an agreement in this conversation. We'll probably add some new Bib editors. That would be at least my my tentative, hopeful outcome.

41:25Speaker 1: All right. Anything else you want folks to know, March?

41:27Speaker 3: Well, uh, please let us know what you think about the candidates so far, and if you uh Um agree with the the idea or not. Um

41:37Unknown speaker: just

41:38Speaker 3: participate. in the process if you're interested in participating.

41:43Speaker 1: Merch, we appreciate your time. But you and you know I know you have important things to do, but you have to stay.

41:51Speaker 3: I see. That's

41:52Unknown speaker: how it is.

41:53Speaker 1: We're going to the monthly stack exchange segment. First question: why does a policy that is valid with Rust Miniscript throw a compile error on the SIPA? site?

42:03Unknown speaker: The

42:04Speaker 1: SIPA site being Peter Wool's interactive website where you can put in miniscripty stuff. And it was one of the early ways that people messed around with it. And so where the person asking this question is coming from is that they wrote a spending policy and it has three ways to spend. There's a main key they can spend, or a two of three set of backup keys they can spend, or a third way, anyone who reveals this secret hash pre-image can spend after 144 blocks about a day. And their Rust code was using Rust Miniscript, which took that policy with no issue. And then they put the same policy into Peter's SIPA miniscript site and got a compile error. And then Peter himself actually responded with a couple different issues. One is that that third branch could be satisfied by just revealing that pre-image after the 144 blocks, which was the intent, I believe, of the person prototyping this. And there would be no signature involved. And Peter calls that inherently malleable. Um, And he doesn't,

43:13Unknown speaker: I

43:13Speaker 1: guess, accept that on the side. site.

43:15Unknown speaker: Not

43:15Speaker 3: just inherently malleable, but also up for grabs. As soon as you publish that pre-image, anyone can take those funds. Which means uh essentially if the miners are paying attention, you're turning this into a donation.

43:29Speaker 1: Yes, exactly. So technically valid, but probably not what people want to be doing, probably not seeing

43:37Unknown speaker: that. Yeah,

43:38Speaker 3: sorry, for derailing. a little bit. Um but so I would heavily advise against a script like this, because 144 blocks is not that long. And if you get if it is sufficient money, you could incentivize a cabal of miners to just um uh censor this transaction until it expires. and then you can they can take it after 144 blocks if they're aware of this um setup.

44:11Speaker 1: Um so that that was one reason, but there was a separate issue in that SIPA's site only accepts symbolic names for keys, not for Or hash pre pre-images. images. Um and so that was the second, I guess, violation or um thing that he would reject his site would reject these things for. Anything else we should note on this one, Merch?

44:36Unknown speaker: No?

44:37Speaker 1: Next question. How can I repair corrupted undo data without a full re-index? And the person asking this question has their node synced and invalidating validating new blocks. Everything's going just fine. But there's six old blocks in a row that can't be read. And Git block stats fails with can't read undo data from disk. I think they have a block explorer backend that just keeps trying forever. And so the usual advice is full reindex, which might take days depending on your setup. Merch says no, maybe

45:13Unknown speaker: days depending on your setup.

45:21Speaker 3: Um re-index should be pretty fast. Often for computers, the bottleneck is now downloading the block uh the the blockchain. But in this case, you have already a full copy of the blockchain. You even have a TX index already. So a re-index is only um blocked by your CPU speed and your disk read-write speed. So either this is an extremely slow CPU or this is maybe an external hard drive. I I'd say maybe a

45:55Unknown speaker: if

45:55Speaker 3: you had a Raspberry Pi with an external hard drive, I could see how it takes days. But um if it were a more powerful computer with an internal hard drive, um preferably an SSD, then this should take a few hours at most. So the the days here that threw me a little bit.

46:16Speaker 1: Um the solution, which is uh the person answering this was the same person asking this, P22, actually wrote a script that rebuilt those records. Um since with TX index, each one of the um spent outputs can be looked up again. So if you're if you're trying to rebuild groups of spent, you can look, you know, which is what the undo files are, then you can actually reconstitute that. But uh maybe asterisk, this is obviously this person's script and this is not a, you know, a recommended way to do it, but you could. Yeah merch.

46:51Speaker 3: Yeah, maybe just to clarify what the issue here is. So you need to undo data in order to restore UTXOs that were spent by a block when you roll back the block. And you don't readily have that available because in an input, we only reference the previous t transaction output's outpoint. So the TXID TX ID plus vout V out number, but we don't actually have this. the script and the amount. They only live in the previous transaction. And that might be

47:22Unknown speaker: in

47:22Speaker 3: the last block or thousands of blocks ago. And you don't necessarily know the height either. So you wouldn't just be able to get that block either. You you literally have to scan the whole blockchain to find where that transaction um created the UTXO, unless you have a TX index. With a TX index, you know exactly where each transaction appears, and that makes it so much faster. So what the script does is it looks up all of the previous outpoints that were spent in a block by looking at the block data, uh just the transaction inputs of that block. And then it can look up all the transactions from the TX index, get the amounts and output scripts that were re of the spent UTXOs, and thereby reconstitute the undo data for that block. So uh the user said that they found that some of their undo data had been nulled out.

48:27and um that uh it happened due to a block uh sorry, their node crashing or or something, and thereby something getting overwritten with zeros and their script fixed. And so that's a cool way of doing this more quickly if you have a similar situation. But for m the most part, I think if you if you're not in a situation where you have a uh HDD or external hard drive or rather th small CPU, just doing a reindex should work fine for you.

49:03Speaker 1: Last question from Stack Exchange. Why does no Bitcoin opcode push data about the spending transaction onto the stack?

49:12Unknown speaker: The

49:12Speaker 1: person asking this was reading the Bitcoin question core code, and notice that each opcode that looks at the spending transaction only ever gets back a yes or a no. So this is things like signature checks, CLTV, CSV. The node checks it against the spending transaction and answers, but nothing about the transaction itself actually gets on the stack. So they asked, you know, was this a design principle or is that just how the code grew up? And they noticed the covenant proposals sort of split along that line. I think it's CTV only checks, TX hash, template hash, push a value. And so that was the question. And then the answer from Learn Bitcoin has to do with how script. could be upgraded, the different upgrade paths, which I think we've talked about a bit here. Um, but a soft fork that uses an op not opcode can only make scripts fail.

50:14Um and so that's why the proposed uh op C T V, for example, only verifies yeah, merch I see you itching.

50:22Speaker 3: Yeah, um I I see that this answer was just added last week. but I actually feel that the crux is a little different.

50:33Unknown speaker: So

50:33Speaker 3: an op nop oh opcode means um no operation. No operation means just remove the opcode from the stack and don't do anything else. So when you give this opn knob up a new consensus meaning. um the uh stack manipulation cannot change. If you start adding things to the stack, a node that is not upgraded and gets to the op knob will just remove that op knob and then continue with the rest of the script. And an upgraded node that gets a value back at this point will have a different stack and use the remaining script on a different stack. So they'll get a different consensus outcome, or they can get a different result in that in the evaluation of that transaction, and we can get a consensus split. So

51:35um this is basically what was fixed. with the upgrade hooks in TabScript, where we get the um what are they called? Uh

51:49Unknown speaker: up success. The up

51:50Speaker 3: success of codes.

51:52Unknown speaker: And

51:52Speaker 3: once an op success gets hit by an old node, it always succeeds. So now a restriction on that behavior can do anything because any restriction is uh to everything succeeds whenever this upcode is present at all, uh is

52:11Unknown speaker: all

52:12Speaker 3: behavior. On an up nob to have a restriction of the behavior, the easiest way to get there is okay, sometimes this will fail now instead of just ignoring it. That's a clean restriction on on the uh evaluation of the script. So the easiest way of using opnops is to just have a um semantic in it that can sometimes m now make the script fail, where it previously just ignored the opcode. I think that's the the main crux. Up Opnops nops are just um much more restricted and and less powerful than op success because they cannot put new items on they they cannot change what is on the stack after evaluating um between a updated node and a non-updated node.

53:04Speaker 1: Thank you, March. That wraps up the stack exchange segment for this week weekslash slash month. And we can move to releases and release candidates. And Gustavo, I guess you got kind of an easy one with the releases this week.

53:21Speaker 4: Yes, a very short one this week. Thank you. Thank you guys for uh for the for the starting the newsletter. So this week we got Bitcoin core version 31.3 and 30.5. Uh as discussed earlier in the news section both of these releases uh fix a deal uh denial of service vulnerability. So users are recommended to upgrade to these new maintenance releases. We jump in into the notable code and documentation changes section. Uh first we have one item from the Bitcoin Core repo, 36,387. So this is about the an RPC called encrypt wallet, which allows you to encrypt. an existing unencrypted wallet. This one gets deprecated with this pull request. And uh this can still be used if someone starts Bitcoin Core with uh the flag deprecated RPC equals encrypt wallet. And the reasons uh or the rationale described in the pull request uh discussion are that first, uh encrypting an existing wallet never guarantees.

54:27that the removal of unencrypted private key material from disk specifically, it's described as no efforts are made to ensure that remnants of unencrypted key material are not left on the user's disk. And the second reason is that the fact that when you generate a new, when you encrypt a wallet, it generates a new seats. seed. So earlier backups may not be able to recover funds uh sent to new addresses. Yes, merch?

54:55Speaker 3: Earlier backups will generally not be able to recreate the updated wallet. So every time you encrypt a wallet, you generate a complete new seed for the encrypted wallet. Because anything that w would be based on the unencrypted wallet would probably uh be considered public information uh if you have access to the disk, because someone might have made a backup of the wallet on the same disk. Or um there there could be multiple copies in other ways. Either way, the unencrypted wallet, if you're assuming that someone would ever get access to this disk, must be considered compromised. So a completely new seed is generated for the encrypted portion of the wallet. So you still have to keep the old unencrypted wallet. You store that in the encrypted wallet as seed material. So if someone sends to old addresses, you still receive those funds. You s can still spend from

55:59UTXOs from the old wallet. But really the the encrypted new seed that you use for new receive addresses is completely fresh. And if you did an encrypt wallet call again, you would get a separate s new seed, a second one that is completely independent. So you actually have to make a new backup when you do encrypt wallet. And I don't think that was as clear as we wanted it to be. So we're deprecating it and instead recommending that you create a new wallet, a complete new wallet. You keep the unencrypted wallet around. You should always keep backups of prior wallets. But we we recommend that you instead actually make a new wallet so that it's very clear to you that you need to make a new. backup of the new wallet. But functionally you're doing exactly the same thing. You're creating a new seed that is the basis for all the new descriptors and uh where you will be receiving your future

57:04funds too. But it's maybe a little clearer now.

57:09Speaker 4: Great

57:09Speaker 1: And also to t be clear, existing encrypted wallets are still supported, right? So it's this is just that transition.

57:16Speaker 3: Yeah. So unencrypted wallets were only created, I think, by default from Bitcoin Core versions before twenty thirteen, I wanna say. So uh hopefully there are not too many unencrypted wallets that still need to be encrypted. And really, if you have an unencrypted wallet floating around from twenty 2013, thirteen, probably you wanna want to make a new wallet. make some backups of that, and update your process and send all your funds to a wallet that was born encrypted rather than a wallet that was born unencrypted on your disk. Especially with all the

57:54Unknown speaker: well,

57:54Speaker 3: every day is zero day now, so um having having stuff encrypted on on your disk just seems very risky. reasonable at this point.

58:05Speaker 4: Thank you. Thank you merch for that extra context. The next item uh comes from the Bitch repository, pull request number 2301. This one uh merges the draft uh of BIP333, which uh is a protocol for that allows peers using the version two 2 peer-to-peer transport protocol to choose their own one-byte message. type IDs for outgoing messages. So instead of uh consuming uh 12 bytes for a full name of a message, you could uh assign one-byte ID uh to that specific message so you don't have to uh always send the 12-byte uh the 12 bytes. So you can always save uh space when communicating uh with this new message. Uh Also important to clear. to specify that BIP324 currently assigns one byte IDs through a fixed table for specific messages. But if you were to propose uh a new message, then that one is not necessarily covered

59:05from that fixed table, which is the use case uh of this new uh protocol.

59:11Speaker 3: Basically it just this allows nodes to uh communicate an alias on a single peer-to-peer connection. And if they continuously use a message over and over again, they can now save eleven bytes every time they use that peer-to-peer message, only ad hoc on that peer-to-peer connection. And that way it doesn't need a um relay network protocol update in order to have everybody agree on a new fixed table allias, but peers can just create them ad hoc on their connections. So if there were any features that are only used by a subset of nodes, those nodes could just talk to each other and say, hey, by the way, let's use this one-byte allias for this message that we keep using all the time. And um just uh for the lifetime of that connection, they save eleven bytes for these messages every

1:00:08Unknown speaker: time.

1:00:09Speaker 4: Great. Next item. Now we jump into the lining repo. So core lining ninety-seven eighteen. Uh this is a specific bug where when core lining was calling Bitcoin Core the RPC call get transaction out, which uh basically what it does is that it checks whether a specific transaction output uh is currently unspent. So here the issue was that if um the the call, let's say the Bitcoin core was unreachable or still starting up, uh if the call would fail, core length could inter misinterpret this as an output an output being spent or absent, right? So it if there was no response, Corelan core could lining uh could uh interpret it as if the response had been an empty valid response. And this specifically happens when a user of core lining is opening a channel using the externally funded channel opening flow. And that user wants to cancel that process. So uh the user initiates the fund channel cancel RPC card. call, but that call will first check if the output exists because if the funding transaction has already been broadcast, uh you could you shouldn't be canceling the the fund channel uh

1:01:28initiation. So but however, in this specific case, if Bitcoin Core isn't reachable, then core lining interprets uh the the failed RPC. call response as if the output uh didn't exist and it would stop uh tracking this channel. However, uh the funding channel could have been broadcasted and you could have been in a situation where you're you're no longer tracking a channel that actually uh has uh has opened. Uh so now the the plugin retries uh when there's a temporary connection or on startup failures and only reports unsuccessful calls and reports unsuccessful calls as errors, not exactly as if they were valid empty responses. The next item comes from the LDK repo. We have two items from that. The first one is 5663. So this is a special. specific case where there's a race condition between different multiple steps. So the first this re- and what's the risk here? The risk is for you to pay an outgoing H H HTLC and lose the incoming payment. This is a case we've covered so many times over the past few weeks. uh, And it's like

1:02:48sort of the the main case of how a lightning node can lose funds uh in this new wave of exploits. So this requires first for a an incoming channel peer to force close a channel, and also uh for uh an an update uh that is supposed to record an HTLC to when you're trying, excuse me, when you're trying to to save or record an HTLC in uh in memory, um, excuse me, you do record it in memory, but when you're trying to save it in disk, uh that's when an error happens. Because when because you're trying to save the HTLC of a channel that is being forced closed. So there's two specific calls that happen. The first one is um for the tracking the channel that is getting closed. and persisting to disk the pre-image. However, because uh there's an error because the channel is already getting force closed, you stop tracking the persistence to disk of the pre-image. So if the channel force closes first and your node crashes, the second right write is not tracked, so the pre-image on restart doesn't get saved. And

1:04:08the specific issue here is that uh LDK had actually already broadcasted a claim transaction for the incoming HTLC. Uh however, if let's say it underpaid in fees, uh that transaction wouldn't get confirmed. Usually, LDK would simply fee bump that transaction uh before the expiry so that the other peer cannot claim the HTLC. However, in this case, because it was never able to save the pre-image to this, it cannot fee bump the transaction, which means that the claim transaction could fail to confirm before its expiry, which allows the peer to claim the HTLC.

1:04:49Unknown speaker: Yes,

1:04:49Speaker 4: Marcus? Mark?

1:04:50Speaker 3: Sorry, let me try to talk that one back to you.

1:04:53Speaker 4: Yes.

1:04:53Speaker 3: It sounds to me like there was a race condition between storing an HTLC pre-image and closing a channel. And if the channel closure happened at exactly the right time and a HTLC pre-image Image write failed to write to disk, you could lose funds because the channel closure would allow you to forget about the channel, but you hadn't actually saved the pre-image yet. And thereby you would forget about the HTLC and not claim the funds.

1:05:25Speaker 4: Well, actually, in this, you almost got it exactly right. But in this case, LDK had already broadcasted a claim transaction for the incoming HTLC. Uh and but the transaction failed to confirm before expiring. expiry, probably because it underpaid

1:05:40Unknown speaker: in

1:05:41Speaker 4: fees. But LDK could not intervene and fee bump because it had not saved the PMS.

1:05:47Speaker 3: Okay. So did it tries to take the HTLC. The HTLC transaction must time out, and then at the wrong time it uh failed to write and would uh the channel would get closed. It it tries to claim the funds, but it didn't write the pre image out, so it can't reclaim the funds a second time because they had and then I guess the counterparty can take the funds because the HDLC claim timed out.

1:06:15Speaker 4: Exactly. That's exactly right.

1:06:17Speaker 3: Okay. Yeah.

1:06:18Speaker 4: Yeah, many, many steps required for it to happen.

1:06:22Speaker 3: Does anyone else notice that we are talking a lot about lightning bugs lately?

1:06:27Speaker 4: Yeah, of course.

1:06:36Speaker 3: Again.

1:06:37Speaker 4: Yeah, tell tell me about it. Um next item also from the LDK repo 5678. Uh so this is an issue that was pre-existent in LDK. Uh where LDK would only select an urgent target fee rate if the commitment transaction contained pending HTLCs, which meant that for a penalty transaction, it would not uh target an urgent fee rate. Uh right, so under sustained fee pressure, the penalty could the penalty transaction could remain unconfirmed. despite uh fee bumps uh until the peer's time lock expire, which would enable the peer to spend the revoked funds, right? So LDK here is trying to penalize uh to reply to uh a revoked transaction that a peer broadcasts, but it doesn't use an urgent fee rate. So it allows the peer's um uh re time log to expire.

1:07:37Speaker 3: So concrete. concretely, this could happen, for example, if there were two channel states that both did not have any HTLCs. So an HTLC had been sent, so a payment was made and then the channel uh it it went through completely and the channel was updated. So the the counterparty is trying to close with an old state that was completely settled, and you're trying to actually broadcast the newest state that was also completely settled. And there were no HTLCs attached, and it would just use a low fee rate.

1:08:12Speaker 4: Exactly. That's exactly right. The fix is now for LDK to use the urgent fee target whenever it identifies whenever it it broadcasts a penalty transaction.

1:08:34Speaker 3: This incentivizes stealing and cheating and so forth. Yet we only see like penalty transactions whenever people are testing something. I don't think

1:08:46Unknown speaker: uh

1:08:47Speaker 3: has anyone ever identified situations in which people actually were trying to cheat at Lightning? Ever?

1:08:54Speaker 4: That's a great question.

1:08:55Speaker 1: I think the next item is also another penalty.

1:08:58Speaker 4: Yeah, the next item comes from another repo, LND. Uh it's uh pull request number 11,607. So here the issue was about weight estimation of a penalty transaction uh that spent HTLC output. So contrary to the previous one, in this case, there are HTLC outputs being spent in that penalty transaction. The issue was that it was underestimating the weight of the transaction because it was correctly building the penalty witness, but it was estimating its size as if it was spending an HTLC from its own commitment transaction. However, it was actually spending an output from the peer's Pierce commitment transaction. which made the HTLC script larger. So the weight could be underestimated, right? And if you were specifically targeting minimum relay fee rates, this could produce insufficient fees and mempo rejection. Now the the fix is simple, and LND then this simply matches uh the weight

1:09:59estimation to the scripts, to the actual script being spent. The next item LND 11247. So this is another bug in lightning specifically about historical chain scans that could miss confirmations or spends. So for example, if a transaction that closes a channel gets confirmed in uh block uh 890,000, 8 uh 90 000 for example, the first scan. uh for example starts at 900,000 so it obviously misses the the transaction uh in the blockchain right but however a second scan starts at an earlier height that the transaction uh gets confirmed that so it's supposed to to to find the transaction however the the bug here is that LND uses a cash cache system system for for the its chain scans so the second uh the second uh scan actually doesn't uh include the blocks that we're missing um

1:11:01simply because of of the cash system right so now uh in this case um the uh it would it would simply skip and miss the transaction uh that it's looking for so and and it would it would sort of leave these uh the channels channel in a in an unmonitored state, right? Because it cannot, it never spotted that the trans that the channel closed. Um the the fix is for the this cache to not apply to the starting height, right? So that you can actually start from an earlier height in a second run. Uh how and this uh if a user upgrades to a new version of L LND and D that includes this fix, uh they would still need to start LND once with a specific option flag uh called hide hint cache query disable, uh which disables the caches so that it can find the transactions that that a previous uh scan missed.

1:11:57Speaker 3: So if you are missing any transactions, you should definitely restart your LND L and D with the new flag here. But maybe you should do it once just in case. It doesn't seem to hurt except for maybe some bandwidth and CPU.

1:12:12Speaker 4: Totally. The next item uh okay, so this is from the LND repo again, eleven thousand two hundred and sixty-eight. Um so this is a uh situation where an unnecessary force close happens. if your node disconnects at the wrong time. Okay, so this is this happens on a fresh, it has to be a fresh channel. And your node, uh, which is the initiator node, sends a fee update to the to the peer. The peer acknowledges the fee update uh and sends uh the revoke and an act message, which revokes. the previous uh state uh but before the peer can actually send the new commitment transaction with the new fee rate uh well his signature with for the new commitment transaction with the new fee rate your LND node disconnects and reconnects the problem there is that if a a specific um the the the you your node never wrote that the fee got updated. It simply sent the message and acknowledged and

1:13:21received the acknowledgement, but it never persisted the fact that the fee updates happened, which meant that on the net on restart, your peer would send you his commitment signature that applies the fee update, uh, but your node would simply not remember. that fee update and would force close the channel. So now uh the fix is uh to remove an early return in the database update that's kept saving the acknowledged local updates.

1:13:52Speaker 3: I I don't know if this is fair, but it just came to mind for a couple of these items already. But it seems that a few of these are um optimizations that uh introduced bugs. Uh so the the old adage uh holds premature optimization is the root of all evil. Um most of the time doing the dumb simple thing uh only costs you a little more bandwidth or CPU and is much easier to correctly do. And then once you uh do that and add tests and so forth, I'm not saying that this is a

1:14:36Unknown speaker: well,

1:14:36Speaker 3: I haven't worked on Lightning. I can't really speak to to these in detail. This is just general um software development process. Um

1:14:48Unknown speaker: most

1:14:49Speaker 3: of the time simple uh first always make sure that something is working correctly before you try to optimize it and make sure that you build a strong test core set for the thing that is working correctly before you try to optimize it. And then when you optimize it it should pass all those tests, right? So uh yeah optimizing too to early where they can very easily introduce bugs.

1:15:16Speaker 4: Well you're totally right. Particularly the the cash bug uh is is a great example of that, right? The next item is Rust Bitcoin 7160. This uh adds testnet 5 support uh to rust Bitcoin uh it uh it does include the the right values in and in Genesis blocks uh and parameters that were covered in newsletter 400. four hundred thirty two uh that were added that that replaced the placeholder parameters uh in the in the in BIP ninety five so RossBitcoin now does the the correct implementation of testnet five.

1:15:51Unknown speaker: The

1:15:51Speaker 4: next two items, yes merch?

1:15:53Speaker 3: Yeah it it's it's kind of fun. Testnet five has been popping up in news uh quite a bit in the last couple weeks. So we we've seen uh P2P P2Pool two. v2 uh test a lot on testnet five. Um there was some mention that uh um R Bitcoin Britain, uh Brandon Black's project has already support for Testnet 5, and a bunch of people were mining on Testnet 5 using R Bitcoin. Uh so it it sounds like the Testnet 5 five launch that seemed to come out of nowhere actually has uh put down a foot quite well already.

1:16:29Speaker 4: Right. Great. Uh so the next two items are come from the BTC based server repo. The first one seventy eight forty six. Um so this adds support for connecting uh to core lining tw version twenty four dot eleven and later to through a new s uh connection system called CLN REST uh that uses runes, which are specific credentials that restrict permitted commands. So previously, when you're connecting a core lining node with a BTC-based server instance, it would give all full permissions to BTC-based server. However, this new credential system allows it to simply restrict the permissions to, for example, uh create and monitor invoices without permission. to send payments. Um however, existent uh direct connections to the RPC interface remain supported. There's also another breaking change in this uh in this pull request, which is that uh some uh

1:17:29options that were used for self-signed certificates are now ignored. So if you are using a lining node, uh usually it will have some self-signed certificates. And now if you want to integrate it or connect it to BTCP server, you have to configure the trust in those self-signed certificates directly in the environment running B2C Pay Server. This is no longer configurable via the BTCP server user interface.

1:17:58Speaker 3: I I have a meta comment here. So what are runes in the context of credentials? Is that um so I I know macarunes were sort of fancy cookies that were that I first heard about in the context of L and D. So cookies are are just um client side identifiers Requires for uh server client interactions, I guess. And macarunes macaroons are fancy cookies. So I know that's where macarons come from. Is runes now sort of taking the the latter part of macarons and and using that for a new type of credential system that I've never heard of before?

1:18:41Speaker 4: Right. It's

1:18:41Unknown speaker: the

1:18:41Speaker 4: equivalent of uh macaroones, but for core lightning, basically.

1:18:45Speaker 3: I see. Okay.

1:18:48Speaker 4: Yeah. Um and the next and final idea. item combines two pull requests, 7850 and 7851. This is about fixing incorrect lining payout states. So the first one applies specifically to a system called LND Hub uh adapter. So I believe LNBits, for example, uses this. Uh and the issue here was that previously if you had um

1:19:13Unknown speaker: if

1:19:13Speaker 4: you had a a correct uh HTTP 200 response uh but with some payment errors, BTCP server would actually consider it as uh if the payment uh had succeeded. So uh as and the payment errors were simply discarded. Uh this was obviously a mistake because uh there was no guarantee that the payment had succeeded. So if uh now what the pull request fixes. is that if an error is known, it will simply map it uh to uh let's say if if the paym if the error was known, such as for example when the call sent nothing, well it's simply reported as a failure. But if there's an ambiguous outcome, it remains unknown. However, BitSpace Server will re-sched rescale and try to obtain the final state of the payment. Uh So even if at first is unknown, it could later get updated to success or fail. The main difference here is that if uh if there's a payment error, they don't just get discarded as they would previously. And in the second case, it marks a payout complete when a payment lookup confirms success after the sent operation returned an error. And it preserves the payment proof. What does this mean? It means that previously, if the first uh operation returned an error,

1:20:33uh Bitspay server might might have not made further payment lookups. Uh so now it makes further payment lookups and it can update the status to complete, even if previously it had been set as uh failed. felt and that's the final item and completes the newsletter. Thank you.

1:20:55Unknown speaker: Thanks

1:20:55Speaker 1: Gustavo. Thanks Merch for co-hosting as well and we want to thank Nishan for joining us and for you all for listening and we will hear you next week. Cheers.

1:21:05Speaker 3: Cheers

This page was produced automatically: the audio was transcribed with parakeet-tdt-0.6b-v3+sortformer-v2.1 and interpreted by Qwen3.6-35B-A3B. Transcription and interpretation can contain errors; always confirm against the original episode. Nothing here is investment advice.
All insights