Pages:
Author

Topic: RBF transactions to be enabled at the next core update (Read 4404 times)

legendary
Activity: 1176
Merit: 1134
CSV doesnt exist yet, but isnt there a BIP for it that is pending with high likelihood it will get adopted?
There is a BIP... and no released software that implements it, no implementation of the soft-fork for it yet, etc.  (as you may note, the deployment section of the BIP is empty.)

Quote
I didnt see anywhere in the CSV BIP that you can only use it with RBF enabled.
Without replacement, someone could announce a inferior sequenced spend first and block the superior sequence spend; undermining the intended operation. The op_code would still "work" but wouldn't achieve the intended effect as reliably.

Quote
It just feels very lopsided to forever prevent any other sequenceids without RBF.
I think there might be misunderstanding on this point.  Opt-in replacement is just local node policy-- virtually every release of Bitcoin Core has twiddled policy in some way or another, local policy is invisible to the blockchain, and there is nothing forever about it in any way.

Quote
As I understand it, if things go live as it is,
It's already "live"; in that there appears to be a non-totally negligible amount of hashpower running it. There is no activation or enforcement of it-- it's inherently unenforceable as it is purely local policy.

Quote
then to maintain backward compatibility we would be stuck with RBF enabled for anything but -1 and -2
No-- policy can, and is, pretty liberally changed between versions. It's generally more compatible and more safe to have things go from replaceable to non-replaceable; and every proposed usage of the sequence field (short of ones that turn stuff totally unrelated data into it) seen so far involves some kind of replacement (if not exactly the BIP125 kind).

Thanks, makes sense. I had some cases of wanting to store some arbitrary data in the sequenceid field, but it sounds like that is a bad idea

James
staff
Activity: 4284
Merit: 8808
CSV doesnt exist yet, but isnt there a BIP for it that is pending with high likelihood it will get adopted?
There is a BIP... and no released software that implements it, no implementation of the soft-fork for it yet, etc.  (as you may note, the deployment section of the BIP is empty.)

Quote
I didnt see anywhere in the CSV BIP that you can only use it with RBF enabled.
Without replacement, someone could announce a inferior sequenced spend first and block the superior sequence spend; undermining the intended operation. The op_code would still "work" but wouldn't achieve the intended effect as reliably.

Quote
It just feels very lopsided to forever prevent any other sequenceids without RBF.
I think there might be misunderstanding on this point.  Opt-in replacement is just local node policy-- virtually every release of Bitcoin Core has twiddled policy in some way or another, local policy is invisible to the blockchain, and there is nothing forever about it in any way.

Quote
As I understand it, if things go live as it is,
It's already "live"; in that there appears to be a non-totally negligible amount of hashpower running it. There is no activation or enforcement of it-- it's inherently unenforceable as it is purely local policy.

Quote
then to maintain backward compatibility we would be stuck with RBF enabled for anything but -1 and -2
No-- policy can, and is, pretty liberally changed between versions. It's generally more compatible and more safe to have things go from replaceable to non-replaceable; and every proposed usage of the sequence field (short of ones that turn stuff totally unrelated data into it) seen so far involves some kind of replacement (if not exactly the BIP125 kind).
legendary
Activity: 1176
Merit: 1134
what about CHECKSEQUENCEVERIFY? That appears to be broken by this as there is no dynamic range available for different sequence values. And relative block addressing is also broken [or forced to use RBF, which is same as broken to many]
CSV doesn't exist yet; but sequence locks generally _require_ replacement in order to be usable: Otherwise someone could race with a less mature sequence and mempool preclude the more mature sequence.

I believe the rational in the design is that any transaction which is not marked _final_ will ultimately be subject to some kind of replacement. The conservative behavior for wallets that don't understand the details is that they should consider anything non-final ... as... non-final.  As other use cases come up the policy could be further restricted to specify what kinds of replacement should happen in what cases. BIP125 is very generic, which means that further changes to limit it's behavior are less likely to create surprise exposure for anyone.


Confused...

CSV doesnt exist yet, but isnt there a BIP for it that is pending with high likelihood it will get adopted?

I didnt see anywhere in the CSV BIP that you can only use it with RBF enabled.

Is there any way to reserve more than just -1 and -2 as exempt from RBF. There is already a special case needed in the code, so there could be a constant you compare against

#define RBF_DISABLED_RANGE -65536

It just feels very lopsided to forever prevent any other sequenceids without RBF. maybe that is the intent? Even with 16 bits at the top, that provids some amount of flexibility. As I understand it, if things go live as it is, then to maintain backward compatibility we would be stuck with RBF enabled for anything but -1 and -2.

James
staff
Activity: 4284
Merit: 8808
what about CHECKSEQUENCEVERIFY? That appears to be broken by this as there is no dynamic range available for different sequence values. And relative block addressing is also broken [or forced to use RBF, which is same as broken to many]
CSV doesn't exist yet; but sequence locks generally _require_ replacement in order to be usable: Otherwise someone could race with a less mature sequence and mempool preclude the more mature sequence.

I believe the rational in the design is that any transaction which is not marked _final_ will ultimately be subject to some kind of replacement. The conservative behavior for wallets that don't understand the details is that they should consider anything non-final ... as... non-final.  As other use cases come up the policy could be further restricted to specify what kinds of replacement should happen in what cases. BIP125 is very generic, which means that further changes to limit it's behavior are less likely to create surprise exposure for anyone.

legendary
Activity: 1176
Merit: 1134
Does this mean that transactions that need to change nSequence so they can use CHECKLOCKTIMEVERIFY will be forced to enable RBF?

No, the special sequence value UINT_MAX-1 disables RBF but also allows CLTV. UINT_MAX disables both.
what about CHECKSEQUENCEVERIFY? That appears to be broken by this as there is no dynamic range available for different sequence values. And relative block addressing is also broken [or forced to use RBF, which is same as broken to many]

Why does it make sense to give RBF such a large range?

What about micropayment protocols that track transactions with sequenceid, or any other use of sequenceid.

I would suggest using the LSB as the RBF flag, so it only uses one bit, which would only cause issues for sequenceid used for relative blocks for small intervals (though that can be fixed by dividing the sequenceid by two for relative block addressing). its usage as timestamp wont suffer much being limited to just the even numbered timestamps.

It also says that if ANY of the inputs has such a sequenceid, the RBF is enabled. Does that mean for all outputs? What if it is signed as SIGHASH_SINGLE? If so, why does an unrelated input/output affect the others. Even if this case isnt broken, having any input affect all of them could break some coinshuffle protocols where the inputs and outputs are pretty independent.

RBF sounds like a nice option to have, but by it using up 2^32-2 out of 2^32 values, basically we are saying sequenceid is for use by RBF and it will override other uses of sequenceid.

James
administrator
Activity: 5222
Merit: 13032
Does this mean that transactions that need to change nSequence so they can use CHECKLOCKTIMEVERIFY will be forced to enable RBF?

No, the special sequence value UINT_MAX-1 disables RBF but also allows CLTV. UINT_MAX disables both.
legendary
Activity: 1176
Merit: 1134
So this means that when a transaction is broadcasted it has a flag saying that RBF can be enabled, or that it can't?

If all of the inputs of a transaction have nSequence = UINT_MAX or UINT_MAX-1, then they have RBF disabled. Sending transactions with nSequence = UINT_MAX is the default for ~all wallets.
Does this mean that transactions that need to change nSequence so they can use CHECKLOCKTIMEVERIFY will be forced to enable RBF?

James
legendary
Activity: 1260
Merit: 1116
I do not see the problem with RBF. Almost nobody is going to abuse it for low value transactions (like Starbucks). The economic incentive is not high enough to cheat for very small transactions.  For large transactions merchants can just demand multiple confirmations which they should be doing anyway regardless of the introduction of RBF.

Having said that is the drawback of allowing both RBF and CPFP?

AFAIK CPFP isn't ruled out for Core. It's in Luke's fork. I'm not sure why it's not in Core. Maybe there are some performance problems with the existing code or something.

I see them as being complementary. If the sender is taking responsibility for confirmation, then he should use RBF; otherwise, if the recipient is taking responsibility then the recipient can use CPFP and the sender can opt out of RBF.
sr. member
Activity: 308
Merit: 250
I do not see the problem with RBF. Almost nobody is going to abuse it for low value transactions (like Starbucks). The economic incentive is not high enough to cheat for very small transactions.  For large transactions merchants can just demand multiple confirmations which they should be doing anyway regardless of the introduction of RBF.

Having said that is the drawback of allowing both RBF and CPFP?
legendary
Activity: 1260
Merit: 1116
Another nice thing about 0.12 in this area is that mempool transactions will by default expire after 72 hours. Previously they'd stick around until the node was restarted, which made it difficult to predict when the network had forgotten about the unconfirmed transaction and it was time to resend it or create a conflicting one with a higher fee.

Bonus points! Smiley
administrator
Activity: 5222
Merit: 13032
Another nice thing about 0.12 in this area is that mempool transactions will by default expire after 72 hours. Previously they'd stick around until the node was restarted, which made it difficult to predict when the network had forgotten about the unconfirmed transaction and it was time to resend it or create a conflicting one with a higher fee.
legendary
Activity: 2814
Merit: 2472
https://JetCash.com
I was anti-RBF when I  first read about it, but as it is an opt-in feature, I think it is handy to include it in the system. I want to start accepting Bitcoin donations on behalf of a charitty, and I want to convert them to fiat currency myself. I already send them Sterling at no cost to either of us, and it would be nice if I could move the Bitcoins at no cost as well. Time isn't important, so I wondered if I could send the coins at zero-fee, and if it looked as if they weren't going to confirm, then I could add a fee. Of course, the other alternative is to wait until it dies, and then re-send it.

There is another posibility. I could sell a domain name as an agent for another person. If I accepted a Bitcoin payment with a time-lock, then I could wait until the name has transferred, and then use RBF to re-route the payment to the owner. ( will that be possibnle? ).
legendary
Activity: 2053
Merit: 1356
aka tonikt
Won't read the spec. Won't read the code. ... why would anyone expect you to read an answer here?  Next time try offering money when you want to demand one on one spoon-feeding.

Until then you get copy-pasta:

[...]
Thank you, that's what I needed.
Yes, I have read it. It's clear and prompt, so very helpful.

Sharing is caring, my friend.
Many people like helping other people, just because it feels nice.
Others may have different, less generous reasons, but I don't mind, as long as I get what I asked for.
So thank you for helping me, whatever reason you had.
staff
Activity: 4284
Merit: 8808
Sorry, I'd like to start kind of a different thread as I am actually interested in the machinery of it.
I know it's in the specs, but I hate reading those, mostly because they are too often useless.
And I really care to know it.
Won't read the spec. Won't read the code. ... why would anyone expect you to read an answer here?  Next time try offering money when you want to demand one on one spoon-feeding.

Until then you get copy-pasta:


Summary

This policy specifies two ways a transaction can signal that it is replaceable.

    Explicit signaling: A transaction is considered to have opted in to allowing replacement of itself if any of its inputs have an nSequence number less than (0xffffffff - 1).
    Inherited signaling: Transactions that don't explicitly signal replaceability are replaceable under this policy for as long as any one of their ancestors signals replaceability and remains unconfirmed.

Implementation Details

The initial implementation expected in Bitcoin Core 0.12.0 uses the following rules:

One or more transactions currently in the mempool (original transactions) will be replaced by a new transaction (replacement transaction) that spends one or more of the same inputs if,

    The original transactions signal replaceability explicitly or through inheritance as described in the above Summary section.
    The replacement transaction pays an absolute higher fee than the sum paid by the original transactions.
    The replacement transaction does not contain any new unconfirmed inputs that did not previously appear in the mempool. (Unconfirmed inputs are inputs spending outputs from currently unconfirmed transactions.)
    The replacement transaction must pay for its own bandwidth in addition to the amount paid by the original transactions at or above the rate set by the node's minimum relay fee setting. For example, if the minimum relay fee is 1 satoshi/byte and the replacement transaction is 500 bytes total, then the replacement must pay a fee at least 500 satoshis higher than the sum of the originals.
    The number of original transactions to be replaced and their descendant transactions which will be evicted from the mempool must not exceed a total of 100 transactions.

The initial implementation may be seen in Bitcoin Core PR#6871 and specifically the master branch commits from 5891f870d68d90408aa5ce5b597fb574f2d2cbca to 16a2f93629f75d182871f288f0396afe6cdc8504 (inclusive).



legendary
Activity: 2053
Merit: 1356
aka tonikt
Sorry, I'd like to start kind of a different thread as I am actually interested in the machinery of it.
I know it's in the specs, but I hate reading those, mostly because they are too often useless.
And I really care to know it.

Can anyone please explain how it actually works that a transaction gets replaced in the memory pool?
What is the algorithm of recognizing that it is a replace-fee transaction, and not just some other shit?
How do you e.g. deal a new tx that would try/suppose to replace two (of more) txs in the existing memory pool?
sr. member
Activity: 308
Merit: 250
Jeff Garzik already proposed a correct and clean solution for the (infrequent and unimportant) so-called "problem" of "stuck transactions", which was way simpler than Peter Todd's massively unpopular and needlessly complicated RBF: Simply allow "stuck transactions" to time-out after 72 hours

Quote
RBF also doesn't solve the problem of "ensuring a quick confirmation".

    If there are only 20 seats on the bus and 25 people that want to ride, there is no ticket price where everyone gets a seat. Capacity problems can't be fixed with a "fee market", they are fixed by adding seats, which in this case means raising the blocksize cap. – /u/Vibr8gKiwi
Undecided

Not everyone will care about a quick confirmation and only a small percentage of the transactions in each block will decide to use the RBF "fee market".

We are a long time away from a situation where everyone who wants to use RBF will generally not be able to do so. The seats on the RBF bus will remain mostly empty for a long time.

Maybe an airplane would make a better analogy. Pretend RBF passengers are first class. They make up a small percentage of the plane occupants. If first class fills up and someone is willing to pay enough to fly (RBF), they are still given a seat. Someone from coach will be bumped to the next flight either voluntarily or voluntarily. They flight makes room for RBF passengers.
legendary
Activity: 1260
Merit: 1116
Jeff Garzik already proposed a correct and clean solution for the (infrequent and unimportant) so-called "problem" of "stuck transactions", which was way simpler than Peter Todd's massively unpopular and needlessly complicated RBF: Simply allow "stuck transactions" to time-out after 72 hours

Quote
RBF also doesn't solve the problem of "ensuring a quick confirmation".

    If there are only 20 seats on the bus and 25 people that want to ride, there is no ticket price where everyone gets a seat. Capacity problems can't be fixed with a "fee market", they are fixed by adding seats, which in this case means raising the blocksize cap. – /u/Vibr8gKiwi
Undecided
administrator
Activity: 5222
Merit: 13032
In order for a 0-confirmation transaction to get double spent (assuming you have zero influence on any amount of mining hardware/pool) without RBF, as a general rule most of the network needs to have not seen the transaction, AND the transaction needs to either not have been seen by the miners' nodes or not be a transaction that the miners will generally confirm.

Exploiting policy differences is the easiest way, and I'm not sure that you can ever really eliminate it because people will always have different policies. But there are other ways:

I think that you'll have a pretty good success ratio if you send the transaction directly to the merchant and simultaneously send the double-spend directly to some miners. The merchant and the peers around him will have one version, but miners will have the other. If the merchant is not running several nodes, then he probably won't even see the the double-spend until it gets into a block, since his surrounding peers won't relay a transaction that they view as a double-spend.

And there's always the Finney attack. If you're a miner, you can (for no additional cost) continuously try to double-spend your 0-conf transactions. If you happen to mine a block while the transaction still has 0 confirmations, then you double-spend it, and nothing can stop this.

Quote
Wouldn't it be possible for someone to sign a transaction that relies on input x, and has a "high" fee, save this transaction to a text file (or wherever), then sign a separate transaction that also relies on input x and has a "low" fee, and has the appropriate flags that "enable" RBF, and broadcast this transaction. Then they could simply use "sendrawtransaction' (which is significantly easier to use then "createrawtransaction" imo) to broadcast the conflicting transaction.

The Core GUI won't let you create conflicting transactions like that. You could do it by messing around with wallet backups or something, but again, it takes a fair bit of extra effort.

With Core's implementation of opt-in RBF, you can't (from the perspective of any given network node) replace an RBF-disabled transaction with an RBF-enabled transaction, and you can't replace a transaction with one having a lower fee. You can replace an RBF-enabled transaction with an RBF-disabled transaction.

Quote
This doesn't mean that others will not write guides on how to fraudulently double spend transactions, and that people will not design wallets/programs to help people fraudulently double spend transactions.

Probably, but that can happen with non-RBF transactions as well.

Quote
I am having difficulty finding reasons why RBF is better then CPFP and/or RBF is being implemented in core while CPFP is not supported (for the most part).

AFAIK CPFP isn't ruled out for Core. It's in Luke's fork. I'm not sure why it's not in Core. Maybe there are some performance problems with the existing code or something.

I see them as being complementary. If the sender is taking responsibility for confirmation, then he should use RBF; otherwise, if the recipient is taking responsibility then the recipient can use CPFP and the sender can opt out of RBF.
staff
Activity: 3458
Merit: 6793
Just writing some code
Quote from: shorena
CPFP is still possible. RBF does not change this.
Right, however it appears to me that the core devs are pushing RBF much stronger then CPFP. I am questioning why it is not the opposite

As I dont belong to that group I can only guess, but my guess is that - similar to what knightdk wrote - its not in the spirit of bitcoin and thus has less priority. AFAIK its mainly a miner side implementation anyway. From what I read about "SPV Mining" most miners run custom code, so developing code for CFPF in core might be seen as a waste of time.
Also they are making a feature that satoshi originally had actually work well. Satoshi originally had a feature to replace transactions but it had a DoS problem. The solution was to require a fee increase, thus RBF, which they are only now implementing.
copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
-snip-
Maybe I have misspoke in some way due to my lack of technical understanding of RBF. I guess the conflicting transaction would also have RBF enabled, allowing it to be accepted by the nodes.

By enabling RBF you would essentially announce "this can be double spend", which would significantly reduce your chance to use this maliciously.
I was responding to theymos's comment that was implying it would be necessary to have some level of technological knowledge to perform a malicious double spend with RBF
Quote from: theymos
I really doubt Core is ever going to provide an easy UI for fraudulently double-spending

It might still allow an easy way to do RBF, e.g. by using the exact same inputs (or more if needed) and only allowing you to increase the fee, but not allowing you to change the non-change outputs. If the only long term change is a different relay policy it will not change much for the majority of users.

Quote from: shorena
CPFP is still possible. RBF does not change this.
Right, however it appears to me that the core devs are pushing RBF much stronger then CPFP. I am questioning why it is not the opposite

As I dont belong to that group I can only guess, but my guess is that - similar to what knightdk wrote - its not in the spirit of bitcoin and thus has less priority. AFAIK its mainly a miner side implementation anyway. From what I read about "SPV Mining" most miners run custom code, so developing code for CFPF in core might be seen as a waste of time.
Pages:
Jump to: