Skip to content

wallet: switch default optinrbf from true to false - #35405

Closed
rkrux wants to merge 2 commits into
bitcoin:masterfrom
rkrux:defaultrbf
Closed

rkrux wants to merge 2 commits into
bitcoin:masterfrom
rkrux:defaultrbf

Conversation

@rkrux

@rkrux rkrux commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Partially fixes #32661.

This follows up a point raised in a review of a previous PR here: #34917 (comment).

With nodes running fullrbf, wallet doesn't need to opt into RBF. This patch
switches the default of wallet rbf to false. Users still have the option to
optin RBF via the individual transaction (and PSBT) creation RPCs - for now.

@DrahtBot

DrahtBot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35405.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK polespinasa, xyzconstant

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #35442 (test: remove usages of MAX_BIP125_RBF_SEQUENCE constant from functional tests by rkrux)
  • #35433 (wallet: deprecate replaceable argument from transaction (and psbt) creation (and modification) RPCs by rkrux)
  • #35100 (rpc: Merge joinpsbts locktimes correctly by nervana21)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@rkrux

rkrux commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

https://github.com/bitcoin/bitcoin/actions/runs/26580689146/job/78312508574?pr=35405#step:9:8958

AssertionError: not(4294967293 == 4294967294)

This failing error would be fixed after #35381 is merged, putting this in draft until then.

@rkrux rkrux changed the title wallet: switch optinrbf from true to false wallet: switch default optinrbf from true to false May 28, 2026
achow101 added a commit that referenced this pull request May 28, 2026
f701cd1 doc: fix typo in release notes of #34917 (rkrux)
7bc39e3 wallet, test: add wallet_deprecated_rbf.py for walletrbf deprecated keys & options (rkrux)
2cbbcb5 wallet, test: remove -deprecatedrpc=bip125 from wallet_send.py (rkrux)
307134b wallet, test: remove -deprecatedrpc=bip125 from wallet_migration.py (rkrux)
3ec550d wallet, test: remove -deprecatedrpc=bip125 from wallet_basic.py (rkrux)
a52ea9b wallet, test: remove -walletrbf startup option from wallet_backwards_compatibility.py (rkrux)
4233092 wallet, test: remove -walletrbf startup option from wallet_backwards_compatibility.py (rkrux)
8cb6e40 wallet, test: remove -walletrbf startup option from wallet_listtransactions.py (rkrux)
0ee94b2 wallet, test: remove -deprecatedrpc=bip125 from wallet_listtransactions.py (rkrux)
5e833e0 wallet, test: -walletrbf startup option from wallet_bumpfee.py (rkrux)
a2a2b17 wallet, test: remove -walletrbf startup option from rpc_psbt.py (rkrux)
a3fe455 wallet: refactor to read -walletrbf only once instead of twice (rkrux)

Pull request description:

  Prerequisite to #35404 and #35405.

  All these changes address the points raised in the review of PR #34917
  here: #34917 (review).

  Essentially updating the existing wallet functional tests without using
  the -deprecatedrpc=bip125 and -walletrbf startup options. Instead,
  these two are added and tested via a singular new
  wallet_deprecated_rbf.py test that can be removed easily later when
  these startup options are completely removed from the wallet post
  deprecation.

ACKs for top commit:
  maflcko:
    review ACK f701cd1  🌄
  achow101:
    ACK f701cd1

Tree-SHA512: 700785062b5de8ee3b6c4f50570b769d56c6c4960f2b6e2a2e71be8085c6b51eaeb34fb158fae76f812fe82791aaa0c0277f964f0472cb0784b86caabe6d4ec9

@maflcko maflcko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, maybe the pull description can repeat some of the broader motivating factors?

Comment thread doc/release-notes-35405.md Resolved
Comment thread src/wallet/wallet.h Resolved
@DrahtBot

Copy link
Copy Markdown
Contributor

🚧 At least one of the CI tasks failed.
Task lint: https://github.com/bitcoin/bitcoin/actions/runs/26635795262/job/78495886583
LLM reason (✨ experimental): CI failed due to a trailing_whitespace lint error in doc/release-notes-35405.md (trailing space on line 6).

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

@rkrux

rkrux commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

maybe the pull description can repeat some of the broader motivating factors?

Yes, updated it.

Comment thread doc/release-notes-34917.md Resolved
sedited added a commit that referenced this pull request Jun 2, 2026
… relying on RBF default

9c1fcac wallet, test: fix sendall anti-fee-sniping when locktime is not specified (rkrux)
8877eec wallet: allow anti-fee-sniping in sendall RPC while not relying on RBF default (rkrux)

Pull request description:

  Partially fixes #32661.
  Prerequisite to #35405.

  The test change in the second commit would fail without the presence
  of the first commit.

ACKs for top commit:
  maflcko:
    review ACK 9c1fcac 🍅
  xyzconstant:
    Tested ACK 9c1fcac
  polespinasa:
    code review ACK 9c1fcac
  sedited:
    ACK 9c1fcac

Tree-SHA512: 048c1a6c64c104f8c27053e4dea139fb8740f30096f4d85daf23aa53a9ad21f0120151a7d1d6ea19b12d174976999335b3f9ac863800629774d8030b7f34918f
With the nodes running fullrbf, wallet doesn't need to opt into RBF. This patch
switches the default of wallet rbf to false. Users still have the option to
optin RBF via the individual transaction (and PSBT) creation RPCs - for now.
@rkrux
rkrux marked this pull request as ready for review June 2, 2026 10:07
Comment thread doc/release-notes-34917.md Resolved
Comment thread doc/release-notes-34917.md Resolved
@DrahtBot DrahtBot removed the CI failed label Jun 2, 2026

@polespinasa polespinasa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 073a4d1

tested with the GUI

@nullfail

nullfail commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

ACK 073a4d1

Looks good to me

@achow101

achow101 commented Jun 3, 2026

Copy link
Copy Markdown
Member

I don't see why the option needs to be changed to default to false before it is removed. This has an actual effect on tranasctions and contradicts the end state of every transaction still using MAX_BIP125_RBF_SEQUENCE once the options are gone.

@rkrux

rkrux commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

This has an actual effect on tranasctions and contradicts the end state of every transaction...

I don't fully understand this^ comment.

There was a discussion in the previous deprecation PR #34917 around changing this default: #34917 (comment). It makes sense to me to stop signalling because of nodes being fullrbf.

@achow101

achow101 commented Jun 5, 2026

Copy link
Copy Markdown
Member

There was a discussion in the previous deprecation PR #34917 around changing this default: #34917 (comment). It makes sense to me to stop signalling because of nodes being fullrbf.

#32661 states:

Always use sequence number MAX - 2 when creating transactions.

Furthermore, I think the default that is used should be something that the wider wallet developer community should agree on for a best practice. We want to choose a sequence that reduces the risk of fingerprinting our user's transactions, not just revert it for the sake of reverting. Given that ~78% of current txs signal replacement, it may make sense to continue to use the signaling sequence even when it is meaningless.

@polespinasa

Copy link
Copy Markdown
Member

Furthermore, I think the default that is used should be something that the wider wallet developer community should agree on for a best practice. We want to choose a sequence that reduces the risk of fingerprinting our user's transactions, not just revert it for the sake of reverting. Given that ~78% of current txs signal replacement, it may make sense to continue to use the signaling sequence even when it is meaningless.

For context, this was also discussed here #34917 (comment)

@maflcko

maflcko commented Jun 8, 2026

Copy link
Copy Markdown
Member

For context, this was also discussed here #34917 (comment)

Maybe it could make sense to include that as motivation in this pull request, so that the motivation is self-contained and reviewers don't need to scroll down 22 comments into a thread and then follow links to find more about it.

(IIRC there was an earlier comment with the same point in an earlier thread years ago, but I think GH search is broken, so trying to find it is tedious)

Also, to extend that motivation, to remove the risk of this fingerprinting vector, either MAX_SEQUENCE_NONFINAL or MAX_BIP125_RBF_SEQUENCE will have to be fully removed from the codebase. Otherwise there is the risk that one function/RPC is picking MAX_BIP125_RBF_SEQUENCE while the other RPC is picking the basically equivalent MAX_SEQUENCE_NONFINAL (after fullrbf). There has already been a similar bug where SEQUENCE_FINAL was incorrectly picked, thus disabling anti-fee-sniping (see 255f7c7).

Generally, I think the number of possible finger-print vectors should be reduced, and the clearest way long-term seems to me to remove the vector that is the most temporary one and the most confusing one.

Furthermore, I think the default that is used should be something that the wider wallet developer community should agree on for a best practice. We want to choose a sequence that reduces the risk of fingerprinting our user's transactions, not just revert it for the sake of reverting. Given that ~78% of current txs signal replacement, it may make sense to continue to use the signaling sequence even when it is meaningless.

I agree that this should be something that ~everyone agrees on eventually. I presume OpTech (and other places) would pick this up after merge, so that the everyone has a chance to consider it.

I understand that the recent ~70+% figure may point to a path that looks easy (get 70% to 100%), but I think wallets that recently upgraded to MAX_BIP125_RBF_SEQUENCE are likely more active and willing to revert (#34917 (comment)). At least more likely than wallets that still haven't upgraded to MAX_BIP125_RBF_SEQUENCE after more than a decade. So zooming out, hopefully after ~3 years and the latest ~10 years, ~everyone has removed the MAX_BIP125_RBF_SEQUENCE fingerprint.

Moreover, imagine a new developer reading wallet code (or writing a new wallet) in a decade or so, and them having to think about which sequence number to use, where two sequence numbers have the exact same meaning in practise. The risk of them introducing a new fingerprint by accident seems smaller if MAX_BIP125_RBF_SEQUENCE didn't exist, and they wouldn't have to read up on a now-irrelevant BIP.

@rkrux

rkrux commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Maybe it could make sense to include that as motivation in this pull request, so that the motivation is self-contained and reviewers don't need to scroll down 22 comments into a thread and then follow links to find more about it.

Done.

@achow101

Copy link
Copy Markdown
Member

they wouldn't have to read up on a now-irrelevant BIP.

A relevant BIP should be written that documents a recommended sequence number.

but I think wallets that recently upgraded to MAX_BIP125_RBF_SEQUENCE are likely more active and willing to revert

While going forward, software may revert if that is the recommendation, this change raises a fingerprint for those using software that already exists.

In general, I don't think we should move forward with changing the default without first establishing what other wallets are going/likely to do. This seems like the kind of thing that should be discussed on the mailing list or delving first, and ideally, an informational BIP should be written as well.

@rkrux

rkrux commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

This seems like the kind of thing that should be discussed on the mailing list or delving first

I've posted on the mailing list (pending approval).

@polespinasa

Copy link
Copy Markdown
Member

Another option is to "randomly" signal or not signal, until all wallets agree on a specific setting, this would avoid fingerprint Core. Similar to what we do with backdating the locktime to avoid leaking on which block the tx was created..

@maflcko maflcko added this to the 32.0 milestone Jun 11, 2026
@rkrux

rkrux commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Another option is to "randomly" signal or not signal

This option did come to my mind earlier but I decided against it because it doesn't help with the other motivation this PR has - which is to clean up the wallet codebase by removing the occurrences of this BIP 125 signalling constant and related variables in coin control, which makes the code longer and harder to reason about imo. In fact, adding the randomness flow might just make the wallet code flow more confusing.

Related to this clean up, a follow-up PR (to this and to #35433) is to clean up the functional tests: #35442.

@maflcko

maflcko commented Jun 11, 2026

Copy link
Copy Markdown
Member

This seems like the kind of thing that should be discussed on the mailing list or delving first

I've posted on the mailing list (pending approval).

Thx. Assinged the 32.x milestone, because it makes sense to first figure out what the overall goal should be before deprecation happens. So if this pull isn't merged or closed before 32.x, we should probably revert 34917 as well for now. The correct order to me seems to be: (1) Decide whether to use MAX_BIP125_RBF_SEQUENCE or not, then (2) move towards that, then (3) possibly at the same time with (2), "deprecate" the "wrong" sequence number, so that it isn't available in the source code as a fingerprinting vector.

@rkrux

rkrux commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Assinged the 32.x milestone

Thanks, this is helpful.

@rkrux

rkrux commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor Author

it makes sense to first figure out what the overall goal should be before deprecation happens. So if this pull isn't merged or closed before 32.x, we should probably revert 34917 as well for now.

Correct me if I misunderstood your comment here but I believe deprecating the walletrbf option (#34917) and the replaceable argument in the wallet RPCs (#35433) are not dependent on this PR. The fingerprinting concern was raised in this PR because of changing the default but the rationale for deprecating still holds. Users still will have the option to signal for RBF by using the deprecatedrpc option but because the signalling is redundant now, it does make sense to deprecate it so that the users know that this signalling is not needed anymore.

@maflcko

maflcko commented Jun 11, 2026

Copy link
Copy Markdown
Member

sure, they don't depend on each other code-wise. However, conceptually it feels a bit cleaner (and easier for users to follow) to first agree on the end-goal and then move toward that end-goal as reference goal.

Let's recall the goal here is not to just deprecate things, because they can be deprecated. As I see it, the main motivation to deprecate it would be to reduce fingerprinting. (Sure there is some minimal maintenance overhead and confusion to keep the toggle, but outside of fingerprinting I don't see that as a large downside of keeping the toggle). So I think conceptually it makes more sense to first figure out fingerprinting and then do everything else afterwards under that umbrella.

@rkrux

rkrux commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor Author

So if this pull isn't merged or closed before 32.x, we should probably revert 34917 as well for now.

Ok, I will raise a revert PR later* if this PR is not merged before the cut-off for v32.

@rkrux

rkrux commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Let's recall the goal here is not to just deprecate things, because they can be deprecated. As I see it, the main motivation to deprecate it would be to reduce fingerprinting. (Sure there is some minimal maintenance overhead and confusion to keep the toggle, but outside of fingerprinting I don't see that as a large downside of keeping the toggle). So I think conceptually it makes more sense to first figure out fingerprinting and then do everything else afterwards under that umbrella.

I have a slightly different view on this.

When I raised the PR, I didn't think that the main motivation was to reduce fingerprinting, although it is a good motivation. My main motivation was to improve user experience because I believe via deprecating it simplifies the overall flow of transaction creation for the user. Generally, I find it better if the user has to deal with fewer stuff while going through a workflow. It's an added advantage that the deprecation improves code readability and maintainability as well.

@rkrux

rkrux commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

I've posted on the mailing list (pending approval).

Based on the responses in the ML from wallet developers in the community, I can see there is a preference of MAX-2 as the input sequence number in the transaction, even though it's not necessary.

So if this pull isn't merged or closed before 32.x, we should probably revert 34917 as well for now.

Ok, I will raise a revert PR later* if this PR is not merged before the cut-off for v32.

I don't think I should do this. I feel that the flow of providing the replaceable option to the user should still be deprecated (and removed later). The MAX-2 as the input sequence number can stay in the codebase but I feel it doesn't need to be associated with the concept of the transaction being replaceable. I will rework the draft PR #35442 in order to achieve this. Meanwhile, I look forward to reviews on #35433.

@rkrux

rkrux commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Closing this PR now after getting community feedback on ML.
Moving to the next part in #35433.

@rkrux rkrux closed this Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wallet, node: Redundant opt-in RBF wallet config and RPC parameters

6 participants