Improve defenses against malicious bitcoin RPC endpoint - #3343
Open
t-bast wants to merge 7 commits into
Open
Conversation
When using Bitcoin Core RPC, we now validate that the returned transaction matches the request. This is part of a defense-in-depth strategy in case our batching client messes up the order of RPC responses.
We previously only relied on the order of requests to match responses that we receive from bitcoind, but there is no guarantee that the order will be preserved. In practice it seems to be the case, but we should be resilient if that changes. We now use unique request IDs and match the corresponding response using this ID instead of relying on position only.
We verify that the amount contributed by our Bitcoin Core wallet matches what we requested. A malicious Bitcoin Core may underfund or overfund, which in both cases is undesirable behavior.
sstone
reviewed
Aug 11, 2026
t-bast
commented
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains three independent commits that improve security in case the bitcoin RPC endpoint is malicious. Note that this isn't foolproof: a fully compromised Bitcoin Core client is hard to protect against, and eclair isn't yet fully secure if that happens. But we're taking steps towards that goal with incremental improvements.
Reported by AI scanning from @Rob1Ham 🙏