Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: matthewh3 on January 17, 2016, 01:33:50 PM



Title: RBF transactions to be enabled at the next core update
Post by: matthewh3 on January 17, 2016, 01:33:50 PM
Can anyone tell the major benefits of this update apart from what I understand is to help induce a free market for transaction fees.  Won't it break the ability to accept zero confirmation transactions?  As there are currently methods to do so with great certainty that a zero confirmation transaction will go through the next block.  And also doesn't this break the core ethos of bitcoin being a pure push system only.  I've read the RBF transactions update is being merged into bitcoin core at the next update.  Isn't that a little hasty for such a drastic change to the protocol to be brought in so quickly.  After it took us a good several months to agree on re-increasing the blocksize.


Title: Re: RBF transactions to be enabled at the next core update
Post by: shorena on January 17, 2016, 02:12:15 PM
Can anyone tell the major benefits of this update apart from what I understand is to help induce a free market for transaction fees.  Won't it break the ability to accept zero confirmation transactions?  As there are currently methods to do so with great certainty that a zero confirmation transaction will go through the next block.  And also doesn't this break the core ethos of bitcoin being a pure push system only.  I've read the RBF transactions update is being merged into bitcoin core at the next update.  Isn't that a little hasty for such a drastic change to the protocol to be brought in so quickly.  After it took us a good several months to agree on re-increasing the blocksize.

My limited understanding is that the first transaction needs to raise a flag in order to allow RBF. Merchants that accept 0-conf TX could scan for the flag and wait to deliver their part if it is set. On the other hand I am not sure how ready merchants or even regular wallet implementations are.



Title: Re: RBF transactions to be enabled at the next core update
Post by: achow101 on January 17, 2016, 03:34:04 PM
Can anyone tell the major benefits of this update apart from what I understand is to help induce a free market for transaction fees.  Won't it break the ability to accept zero confirmation transactions? 
Nope. Those transactions are opt-in, meaning that if the transaction doesn't opt-in to use RBF, then it can't be Replaced later.

As there are currently methods to do so with great certainty that a zero confirmation transaction will go through the next block.
Not really. The currently consist of CPFP, waiting for the transaction to disappear, or attempting an RBF transaction without really having RBF enabled anywhere. All of them take a while and are rather difficult to do.

And also doesn't this break the core ethos of bitcoin being a pure push system only.
How does this break that?

I've read the RBF transactions update is being merged into bitcoin core at the next update. 
Already merged in.

Isn't that a little hasty for such a drastic change to the protocol to be brought in so quickly. 
It isn't a protocol change, it is a node policy change. This change is something that only nodes will decide whether they want to accept the transaction into their mempool or not. It has nothing to do with consensus or protocol.

After it took us a good several months to agree on re-increasing the blocksize.
That is because this is a node policy change, not consensus or protocol. Consensus changes and protocol like increasing the block size limit require a fork, hard fork in the case of block size and soft fork in others like OP_CLTV. Forks require consensus and agreement since those can fork the blockchain. Node policy changes don't since it is specific to individual nodes, not the entire network nor the blockchain. Since this is just a node policy change, nothing is being affected on the network, just whether nodes want to accept or reject RBF transactions.

If you think that this change was too hasty, I'm here to tell you it is not. The subject of RBF has been discussed for years already. Peter Todd has had the code implemented in a fork for a while and this code has been tested and tested and discussed for ages. In fact, the idea of replacing transactions is not original. It was originally implemented by Satoshi but removed due to DoS concerns, which have been fixed by requiring that the fee be raised. Hence Replace-By-Fee.


Title: Re: RBF transactions to be enabled at the next core update
Post by: xdrpx on January 17, 2016, 04:15:28 PM
I'm sorry if I'm wrong, but I'd love someone to correct me if I am. What I've understood is an RBF Opt-in enables a user who has made a payment to find the lowest possible amount he needs to negotiate or bid for the transaction fee that he has to pay, so that his payment transaction is sure to be completed when a block is full and his wallet.

If that's right, should his Wallet client remind the user after a couple of hours that in order for his transaction to be recognized earlier for him to determine via an RBF Opt-in the best possible fee? Will the user have to keep monitoring his transaction for a long period of time? 


Title: Re: RBF transactions to be enabled at the next core update
Post by: letsplayagame on January 18, 2016, 09:59:09 PM
Can anyone tell the major benefits of this update apart from what I understand is to help induce a free market for transaction fees.  Won't it break the ability to accept zero confirmation transactions?  As there are currently methods to do so with great certainty that a zero confirmation transaction will go through the next block.  And also doesn't this break the core ethos of bitcoin being a pure push system only.  I've read the RBF transactions update is being merged into bitcoin core at the next update.  Isn't that a little hasty for such a drastic change to the protocol to be brought in so quickly.  After it took us a good several months to agree on re-increasing the blocksize.

My limited understanding is that the first transaction needs to raise a flag in order to allow RBF. Merchants that accept 0-conf TX could scan for the flag and wait to deliver their part if it is set. On the other hand I am not sure how ready merchants or even regular wallet implementations are.



If this is correct then what is the disadvantage of RBF? The free market for transactions fees is created and merchants that want to keep allowing 0 conf transactions without risk can just exclude those who use the RBF flag.


Title: Re: RBF transactions to be enabled at the next core update
Post by: achow101 on January 18, 2016, 10:15:06 PM
If this is correct then what is the disadvantage of RBF? The free market for transactions fees is created and merchants that want to keep allowing 0 conf transactions without risk can just exclude those who use the RBF flag.
There is no disadvantage, but people don't realize this. All they do is spread FUD about this and not understand what it is actually doing.


Title: Re: RBF transactions to be enabled at the next core update
Post by: spiderbrain on January 18, 2016, 10:51:50 PM
That is because this is a node policy change, not consensus or protocol. Consensus changes and protocol like increasing the block size limit require a fork, hard fork in the case of block size and soft fork in others like OP_CLTV. Forks require consensus and agreement since those can fork the blockchain. Node policy changes don't since it is specific to individual nodes, not the entire network nor the blockchain. Since this is just a node policy change, nothing is being affected on the network, just whether nodes want to accept or reject RBF transactions.

If you think that this change was too hasty, I'm here to tell you it is not. The subject of RBF has been discussed for years already. Peter Todd has had the code implemented in a fork for a while and this code has been tested and tested and discussed for ages. In fact, the idea of replacing transactions is not original. It was originally implemented by Satoshi but removed due to DoS concerns, which have been fixed by requiring that the fee be raised. Hence Replace-By-Fee.
Really good summary, thanks.


Title: Re: RBF transactions to be enabled at the next core update
Post by: unamis76 on January 18, 2016, 11:17:36 PM
My limited understanding is that the first transaction needs to raise a flag in order to allow RBF. Merchants that accept 0-conf TX could scan for the flag and wait to deliver their part if it is set. On the other hand I am not sure how ready merchants or even regular wallet implementations are.

Can anyone tell the major benefits of this update apart from what I understand is to help induce a free market for transaction fees.  Won't it break the ability to accept zero confirmation transactions? 
Nope. Those transactions are opt-in, meaning that if the transaction doesn't opt-in to use RBF, then it can't be Replaced later.

So this means that when a transaction is broadcasted it has a flag saying that RBF can be enabled, or that it can't?


Title: Re: RBF transactions to be enabled at the next core update
Post by: theymos on January 18, 2016, 11:29:49 PM
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.


Title: Re: RBF transactions to be enabled at the next core update
Post by: BlindMayorBitcorn on January 18, 2016, 11:36:32 PM
Ok I know this isn't a technical question, but: What do businesses that regularly deal with Bitcoin have to say about this? And wallet developers? It still seems like a strange new feature.

This is from Reddit:

Separate but related question: I'm happy to use core, but I don't want my fullnode forwarding or honoring RBF. I would like to treat them as doublespends.

Is there a setting or compile option for this behavior ?

Also, Ill be setting up wallet software to ignore any non-final transaction, regardless of confirmations. It will be up to the sender to use their RBF feature to take back their transaction, if they are silly enough to send it RBF.



Title: Re: RBF transactions to be enabled at the next core update
Post by: theymos on January 18, 2016, 11:47:03 PM
Ok I know this isn't a technical question, but: What do businesses that regularly deal with Bitcoin have to say about this? And wallet developers? It still seems like a strange new feature.

As Peter Todd demonstrated with his Coinbase double-spend, it is (and always has been) very easy to double-spend 0-conf transactions even without RBF. In most cases, it is only slightly less difficult to double-spend with RBF compared to non-RBF.

I think that it's always been a hopeless effort, but some services try to predict when 0-conf transactions are high-risk using a number of network nodes listening for double-spends and other such things. For these, it's a simple matter to check for the RBF opt-in and treat these transactions as automatically high-risk.

I feel like most people are imagining that with RBF there's going to be a button in wallets that says "take back this money", but that's very unlikely. Right now you have to use createrawtransaction to send a RBF-enabled transaction, and in the future there will be a button to increase fees (or something), but I really doubt Core is ever going to provide an easy UI for fraudulently double-spending. As is the case today, 0-conf transactions will often work despite being totally insecure because a large percentage of people are honest, and of those who are dishonest, a large percentage of them haven't bothered to figure out how to double-spend.


Title: Re: RBF transactions to be enabled at the next core update
Post by: BlindMayorBitcorn on January 18, 2016, 11:57:46 PM
Seems harmless enough. Thanks! :)


Title: Re: RBF transactions to be enabled at the next core update
Post by: BlindMayorBitcorn on January 19, 2016, 12:07:49 AM
Who would use it and why?


Title: Re: RBF transactions to be enabled at the next core update
Post by: theymos on January 19, 2016, 12:17:43 AM
Who would use it and why?

The idea is that eventually most people will use it most of the time.

I don't know if this is actually exactly how it's planned, but how I imagine it working in the future is:
- By default, you'll send transactions with RBF. Then if the transaction doesn't confirm after a long time, RBF will allow you to easily increase the fee. You'll be taking responsibility for the transaction
- If a merchant requests that you not use RBF, you won't. Likely this request will be done via the Bitcoin Payment protocol (ie. bitcoin: URIs). So when you click "pay this" (or whatever it says) on a BitPay page, your wallet will automatically send the transaction without RBF. Then the merchant is taking responsibility for the payment, and they can adjust the fee later if necessary using the child-pays-for-parent (CPFP) mechanism. I'd expect most payment processors like BitPay to do this so that customers don't have to worry about fees and they can try to do fraud detection on 0-conf transactions.


Title: Re: RBF transactions to be enabled at the next core update
Post by: unamis76 on January 19, 2016, 12:24:47 AM
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.

Thank you, I was not aware of that.


Title: Re: RBF transactions to be enabled at the next core update
Post by: Jet Cash on January 19, 2016, 03:55:09 AM
So can we avoid all this just by saying "only accept confirmed payments" ?


Title: Re: RBF transactions to be enabled at the next core update
Post by: achow101 on January 19, 2016, 04:00:35 AM
So can we avoid all this just by saying "only accept confirmed payments" ?
Yup


Title: Re: RBF transactions to be enabled at the next core update
Post by: Quickseller on January 19, 2016, 04:28:04 AM
Ok I know this isn't a technical question, but: What do businesses that regularly deal with Bitcoin have to say about this? And wallet developers? It still seems like a strange new feature.

As Peter Todd demonstrated with his Coinbase double-spend, it is (and always has been) very easy to double-spend 0-conf transactions even without RBF. In most cases, it is only slightly less difficult to double-spend with RBF compared to non-RBF.
I would disagree with this. 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. In order for the above to be true, you generally will need to create a transaction with a very low fee, and/or otherwise be non-standard. Companies that accept 0/unconfirmed transactions need to filter out the above types of transactions until they have at least one confirmation (or more) in order to prevent financial losses to themselves. When the spam attacks were taking place over the summer, luckybi.it was the victim of several double spend attacks, and they made adjustments accordingly, the same (https://bitcointalk.org/index.php?topic=1128950.0) is true for PocketDice, and in light of Peter Todd's double spend, the same will likely be true for coinbase.

If a transaction has been seen by the majority of the network, has no reason to not be relayed by most nodes, has a sufficient transaction fee to get quickly confirmed, and some amount of time has elapsed (generally <10 seconds), then it is very difficult to double spend a 0/unconfirmed transaction if you do not have any influence in any mining hardware/pool.


I think that it's always been a hopeless effort, but some services try to predict when 0-conf transactions are high-risk using a number of network nodes listening for double-spends and other such things. For these, it's a simple matter to check for the RBF opt-in and treat these transactions as automatically high-risk.

I feel like most people are imagining that with RBF there's going to be a button in wallets that says "take back this money", but that's very unlikely. Right now you have to use createrawtransaction to send a RBF-enabled transaction, and in the future there will be a button to increase fees (or something), but I really doubt Core is ever going to provide an easy UI for fraudulently double-spending. As is the case today, 0-conf transactions will often work despite being totally insecure because a large percentage of people are honest, and of those who are dishonest, a large percentage of them haven't bothered to figure out how to double-spend.
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.

Quote from: theymos
I really doubt Core is ever going to provide an easy UI for fraudulently double-spending
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.



From what I understand RBF is similar to CPFP in a sense that both share the same goal of getting a transaction to confirm that would probably not otherwise confirm. However there are potentially fraudulent uses for RBF while there are not (that I am aware of) for CPFP. Additionally CPFP puts the "burden" of the cost of getting a transaction confirmed on the receiver, which is generally the status quo for retail transactions (especially those involving credit cards), which consumers are used to, and often demand.

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).   
 


Title: Re: RBF transactions to be enabled at the next core update
Post by: achow101 on January 19, 2016, 04:40:45 AM
I think that it's always been a hopeless effort, but some services try to predict when 0-conf transactions are high-risk using a number of network nodes listening for double-spends and other such things. For these, it's a simple matter to check for the RBF opt-in and treat these transactions as automatically high-risk.

I feel like most people are imagining that with RBF there's going to be a button in wallets that says "take back this money", but that's very unlikely. Right now you have to use createrawtransaction to send a RBF-enabled transaction, and in the future there will be a button to increase fees (or something), but I really doubt Core is ever going to provide an easy UI for fraudulently double-spending. As is the case today, 0-conf transactions will often work despite being totally insecure because a large percentage of people are honest, and of those who are dishonest, a large percentage of them haven't bothered to figure out how to double-spend.
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.
What's the point of broadcasting the conflicting transaction? Since the network would have already seen the first one with RBF enabled, if the conflicting transaction doesn't have RBF enabled, then AFAIK it will be rejected as a double spend.

Quote from: theymos
I really doubt Core is ever going to provide an easy UI for fraudulently double-spending
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.



From what I understand RBF is similar to CPFP in a sense that both share the same goal of getting a transaction to confirm that would probably not otherwise confirm. However there are potentially fraudulent uses for RBF while there are not (that I am aware of) for CPFP. Additionally CPFP puts the "burden" of the cost of getting a transaction confirmed on the receiver, which is generally the status quo for retail transactions (especially those involving credit cards), which consumers are used to, and often demand.

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).   
In most cases, what I have seen is that the sender usually wants the transaction to confirm, not the receiver although both do happen somewhat frequently. Many times the receiver doesn't care about the transaction as it might just be a deposit which the sender wants done quickly. With CPFP, there may not be any change addresses for the sender to use to attempt a CPFP. RBF allows that.

Also, CPFP adds additional transactions to the blockchain and to mempools while RBF will not thus helping to reduce blockchain bloat.


Title: Re: RBF transactions to be enabled at the next core update
Post by: Quickseller on January 19, 2016, 04:56:21 AM
I think that it's always been a hopeless effort, but some services try to predict when 0-conf transactions are high-risk using a number of network nodes listening for double-spends and other such things. For these, it's a simple matter to check for the RBF opt-in and treat these transactions as automatically high-risk.

I feel like most people are imagining that with RBF there's going to be a button in wallets that says "take back this money", but that's very unlikely. Right now you have to use createrawtransaction to send a RBF-enabled transaction, and in the future there will be a button to increase fees (or something), but I really doubt Core is ever going to provide an easy UI for fraudulently double-spending. As is the case today, 0-conf transactions will often work despite being totally insecure because a large percentage of people are honest, and of those who are dishonest, a large percentage of them haven't bothered to figure out how to double-spend.
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.
What's the point of broadcasting the conflicting transaction? Since the network would have already seen the first one with RBF enabled, if the conflicting transaction doesn't have RBF enabled, then AFAIK it will be rejected as a double spend.
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.
Quote from: theymos
I really doubt Core is ever going to provide an easy UI for fraudulently double-spending
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.



From what I understand RBF is similar to CPFP in a sense that both share the same goal of getting a transaction to confirm that would probably not otherwise confirm. However there are potentially fraudulent uses for RBF while there are not (that I am aware of) for CPFP. Additionally CPFP puts the "burden" of the cost of getting a transaction confirmed on the receiver, which is generally the status quo for retail transactions (especially those involving credit cards), which consumers are used to, and often demand.

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).   
In most cases, what I have seen is that the sender usually wants the transaction to confirm, not the receiver although both do happen somewhat frequently. Many times the receiver doesn't care about the transaction as it might just be a deposit which the sender wants done quickly. With CPFP, there may not be any change addresses for the sender to use to attempt a CPFP. RBF allows that.
If the sender is making a deposit to, say coinbase, then the sender can notify coinbase they are willing to have x deducted from their deposit if coinbase broadcasts a CPFP transaction that contains a fee of x.

Today when someone buys a cup of coffee from Starbucks with their credit card, it is Starbucks that bears the costs of accepting the Credit Card. I don't see why it should be any different with Bitcoin, so Starbucks could receive a payment with a very low/no fee and then could use a CPFP transaction with a sufficiently high fee to get both transactions to confirm.
Also, CPFP adds additional transactions to the blockchain and to mempools while RBF will not thus helping to reduce blockchain bloat.
Many/most bitcoin related services will spend deposits/payments to another internal address/wallet after one confirmation anyway for a various number of reasons. It will often go deposit address --> internal hot wallet address --> possibly more hot wallet addresses/transactions --> unrelated withdrawal and/or transaction to cold wallet. Often each transaction waits for one confirmation until the next transaction is broadcast.


Title: Re: RBF transactions to be enabled at the next core update
Post by: shorena on January 19, 2016, 08:36:03 AM
-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.

-snip-
Today when someone buys a cup of coffee from Starbucks with their credit card, it is Starbucks that bears the costs of accepting the Credit Card. I don't see why it should be any different with Bitcoin, so Starbucks could receive a payment with a very low/no fee and then could use a CPFP transaction with a sufficiently high fee to get both transactions to confirm.

CPFP is still possible. RBF does not change this.


Title: Re: RBF transactions to be enabled at the next core update
Post by: achow101 on January 19, 2016, 12:37:21 PM
Today when someone buys a cup of coffee from Starbucks with their credit card, it is Starbucks that bears the costs of accepting the Credit Card. I don't see why it should be any different with Bitcoin, so Starbucks could receive a payment with a very low/no fee and then could use a CPFP transaction with a sufficiently high fee to get both transactions to confirm.
Credit cards are a pull system where the merchant is taking money rather than giving them money. Bitcoin is a push system where you give merchants the money. Bitcoin puts the onus of sending transactions and getting then confirmed on the sender, not the receiver. Thus it stands to reason that bitcoin continue with that idea and put the burden on the sender and not the receiver.

However, I am not averse to CPFP transactions. I think it would be better if we had both RBF and CPFP enabled so that both senders and receivers can do something to get their transactions confirmed.


Title: Re: RBF transactions to be enabled at the next core update
Post by: Quickseller on January 19, 2016, 05:10:50 PM
-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

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


Title: Re: RBF transactions to be enabled at the next core update
Post by: shorena on January 19, 2016, 06:49:47 PM
-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.


Title: Re: RBF transactions to be enabled at the next core update
Post by: achow101 on January 19, 2016, 07:46:08 PM
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.


Title: Re: RBF transactions to be enabled at the next core update
Post by: theymos on January 19, 2016, 10:53:39 PM
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.


Title: Re: RBF transactions to be enabled at the next core update
Post by: BlindMayorBitcorn on January 28, 2016, 02:38:57 AM
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 (https://www.reddit.com/r/btc/comments/42va11/reminder_jgarzik_already_proposed_a_correct_and/)

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
:-\


Title: Re: RBF transactions to be enabled at the next core update
Post by: letsplayagame on January 28, 2016, 09:09:50 AM
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 (https://www.reddit.com/r/btc/comments/42va11/reminder_jgarzik_already_proposed_a_correct_and/)

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
:-\

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.


Title: Re: RBF transactions to be enabled at the next core update
Post by: piotr_n on February 17, 2016, 07:31:14 PM
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?


Title: Re: RBF transactions to be enabled at the next core update
Post by: gmaxwell on February 18, 2016, 01:36:40 AM
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 (https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki). 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).





Title: Re: RBF transactions to be enabled at the next core update
Post by: piotr_n on February 18, 2016, 07:29:19 AM
Won't read the spec (https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki). 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.


Title: Re: RBF transactions to be enabled at the next core update
Post by: Jet Cash on February 19, 2016, 04:47:37 PM
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? ).


Title: Re: RBF transactions to be enabled at the next core update
Post by: theymos on February 19, 2016, 05:01:49 PM
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.


Title: Re: RBF transactions to be enabled at the next core update
Post by: BlindMayorBitcorn on February 19, 2016, 05:10:04 PM
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! :)


Title: Re: RBF transactions to be enabled at the next core update
Post by: letsplayagame on February 19, 2016, 07:08:19 PM
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?


Title: Re: RBF transactions to be enabled at the next core update
Post by: BlindMayorBitcorn on February 19, 2016, 07:15:27 PM
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.


Title: Re: RBF transactions to be enabled at the next core update
Post by: jl777 on February 19, 2016, 08:02:28 PM
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


Title: Re: RBF transactions to be enabled at the next core update
Post by: theymos on February 19, 2016, 08:26:51 PM
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.


Title: Re: RBF transactions to be enabled at the next core update
Post by: jl777 on February 19, 2016, 08:43:02 PM
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


Title: Re: RBF transactions to be enabled at the next core update
Post by: gmaxwell on February 19, 2016, 10:45:42 PM
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.



Title: Re: RBF transactions to be enabled at the next core update
Post by: jl777 on February 20, 2016, 12:15:54 AM
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


Title: Re: RBF transactions to be enabled at the next core update
Post by: gmaxwell on February 20, 2016, 12:29:58 AM
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).


Title: Re: RBF transactions to be enabled at the next core update
Post by: jl777 on February 20, 2016, 12:54:14 AM
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