-
Notifications
You must be signed in to change notification settings - Fork 866
TX Inputs to be RBF-enabled by default #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c4c094e to
1c85884
Compare
|
Concept ACK. There may be some short term privacy concerns, but in the long term as RBF adoption grows, the concerns would shift to the other side. |
|
I don't like this, the build is breaking and I think tons of tests will break. Anyway, choosing what is the default sequence to use is a work for the I am really not sure about this change, I think lot's of code out there have the underlying assumption hat the default sequence is 0xFFFFFFFF. It might not even be for RBF, but some stuff would definitively break. |
When creating an input, there was a need to explicitly use the Sequence property setter in order to enable RBF on it. Bitcoin Core has recently enabled RBF by default even from the GUI [1], so it should be safe to assume that this feature is stable enough to be enabled by default in NBitcoin too. The implementation to make this possible needs to use a Nullable type for the backing field because the C# compiler doesn't allow structs with parameterless ctors or default values to be assigned to their fields. [1] https://bitcoin.org/en/release/v0.16.0
|
Last time I checked, it was only one test failing (my bad for not running them before proposing this). Gonna fix soon. What's in your mind that would break, besides the RBF-by default test? |
|
It's green now, only 1 test changed. |
It's arguable if this will be enabled by default on upstream NBitcoin (my PR is being debated[1]) so I'll enable it from GWallet in the meantime. [1] MetacoSA/NBitcoin#355
|
|
|
Right, it's only used in assignments, and those keep working with Nullable. |
|
Ok so my worry is the following: Bob and Alice wants to sign a transaction in multi sig: For doing that what happen is that Alice and Bob need to be able to build exactly the same transaction given the same Coins. Now if Alice is using a new version of NBitcoin but not Bob, then they will be unable to generate the same transaction. I think this has better its place as a feature in the |
|
Mmm, I see where you're coming from. The solution to this would be to break API, so that if one wants to upgrade NBitcoin, that person should make an explicit decision about if supporting RBF by default or not at that moment. The way we could do it is mark Sequence type as private, create an ISequence interface, change all APIs to expose ISequence, and then create a SequenceFactory class that returns ISequence objects with overloads that explicitly define RbfEnabled or RbfDisabled as suffixes. Is that a good plan? If we never tackle this, people will keep creating non-RBF transactions with their wallets/solutions, and if we have high fees again soon, they will live in a world of pain. |
|
This seems pretty complicated, I would just like a boolean |
Sorry for the delay replying. The follow-up question about this proposal would be: would that boolean property be Another less complicated solution than my last proposal would be to make TransactionBuilder receive a bool parameter in its constructor called |
As discussed here, it'd be false. |
(As said in my previous comment,) then we would not have fixed anything. |
There's nothing to fix. This is a feature. |
Please read again the title of this PR :) And the first comment, to understand the motivations for this "fix". |
Actually, the last sentence of this comment is better: If we never tackle this, people will keep creating non-RBF transactions with their wallets/solutions, and if we have high fees again soon, they will live in a world of pain. |
|
Or another reason: when closing Lightning channels, having no RBF would be very dangerous (especially if there's a fraud/punishment transaction involved). |
|
Keep in mind RBF is not without issues.
Bitcoin Core is known for breaking userspace, quite the opposite, see 0.17.0 release mess. So my vote is on non-enabling it by default, but I don't feel that strongly about it, so I'm fine with any decision, just please provide me a way to turn it off. |
Places should not accept zero conf ever anyway. If they do, they have a bug. And it's not that I like bitPay, but at least this company provides an insurance that lets you accept 0-conf and they pay cover the bill in case the tx gets double-spent in a different place.
Well, there are 3 types of wallets: the ones that enable RBF in all transactions (a), the ones that don't enable it for any (b) and the ones that let the end-user choose (c). The only fingerprint this would leave is that you would know the user has not a wallet from the (b) category. Is that much of an issue?
Again there are so many wallets that fall into the (a) and (c) categories, compared to (b), that I don't see an issue here.
If we ever have QC vulnerabilities in bitcoin, we will know immediately: the first funds that would be stolen would be Satoshi's accounts where he was receiving funds via public key. Worrying about much smaller amounts than Satoshi's amounts, is a bit paranoid. If you really want to help on this matter, work on Lamport signatures IMO. Double-spends can still happen without RBF enabled AFAIU. |
Well, for them it's much harder to make their users be aware of the risks of upgrading, should they change the defaults. But NBitcoin is a library, if we make API changes, the developers need to explicitly change their code in order to upgrade, so our way of changing the defaults is easier than BitcoinCore. And I used bitcoin-core here as a reference-standard: if they did it, we shouldn't be ashamed of doing it either, especially when we can inform our users via the API. |
Take in account we have already discarded changing it to enabling it by default, because of Nicolas' concerns about mixing versions of NBitcoin when signing. What we're discussing here is to change the API so that the dev needs to explicitly set RBF true or false. This would be the only way to make it stop being disabled by default, while addressing Nicolas concern. |
But it's not enabled by default either: the developer is forced to make a decision if he wants to avoid the compile-time warnings. This way we avoid the potential problems that could have been caused by simply switching the default to be RFB-enabled, as discussed originally here: MetacoSA#355
|
Superseded by #686 |
But it's not enabled by default either: the developer is forced to make a decision if he wants to avoid the compile-time warnings. This way we avoid the potential problems that could have been caused by simply switching the default to be RFB-enabled, as discussed originally here: MetacoSA#355
But it's not enabled by default either: the developer is forced to make a decision if he wants to avoid the compile-time warnings. This way we avoid the potential problems that could have been caused by simply switching the default to be RFB-enabled, as discussed originally here: MetacoSA#355
But it's not enabled by default either: the developer is forced to make a decision if he wants to avoid the compile-time warnings. This way we avoid the potential problems that could have been caused by simply switching the default to be RFB-enabled, as discussed originally here: MetacoSA#355
But it's not enabled by default either: the developer is forced to make a decision if he wants to avoid the compile-time warnings. This way we avoid the potential problems that could have been caused by simply switching the default to be RFB-enabled, as discussed originally here: MetacoSA#355
But it's not enabled by default either: the developer is forced to make a decision if he wants to avoid the compile-time warnings. This way we avoid the potential problems that could have been caused by simply switching the default to be RFB-enabled, as discussed originally here: MetacoSA#355
When creating an input, there was a need to explicitly
use the Sequence property setter in order to enable RBF
on it.
Bitcoin Core has recently enabled RBF by default even
from the GUI [1], so it should be safe to assume that
this feature is stable enough to be enabled by default
in NBitcoin too.
The implementation to make this possible needs to use
a Nullable type for the backing field because the C#
compiler doesn't allow structs with parameterless ctors
or default values to be assigned to their fields.
[1] https://bitcoin.org/en/release/v0.16.0