|Replace By Fee - Bitcoin Modifications|
|Written by Mike James|
|Thursday, 02 April 2015|
When we think of the Bitcoin algorithm, we tend to concentrate on the proof of work and how it allows the block chain to be built in a decentralised way. However, the algorithm is so much more and as people find alternative ways of working with Bitcoin, there might be a need to change it.
Before you can appreciate the idea of Replace by Fee you need to understand a phenomenon that has been growing for some time. In principle, Bitcoin is an algorithm that keeps track of validated transactions. When you want to spend a Bitcoin a transaction is created and transmitted over the network. It is then placed in the transaction pool where miners extract transactions and build potential blocks to be Incorporated into the block chain.
Until a transaction is part of a mined block then it is said to have zero confirmations. When it is first mined it is the latest block on the block chain and hence is said to have 1 confirmation. Each block that is added after this adds one to its confirmation. You might think that as soon as a block was added to the chain, i.e. has 1 confirmation, it would be safe to regard it as fixed for ever. This isn't the case because of block chain forks. Until the entire network has time to confirm that the block chain that it is part of is the accepted block chain by the majority of miners then it could just be dropped. Generally, it takes the addition of five or so blocks after the block in question has been added to make the probability that a different longer valid block chain exists very small. Thus most merchants will wait for a confirmation of 6 before shipping goods.
Waiting for 6 blocks to be added to the block chain can take an hour or more and if you pay for your coffee with Bitcoin you probably don't want to wait an hour before getting it. So many merchants will accept zero confirmation transactions as proof of payment. The reason is that even a zero confirmation transaction has been checked as valid by every peer and mining node it has passed through. This makes it very likely that it will be confirmed in good time unless something very odd or dishonest occurs.
The problem is that zero confirmation transactions are subject to the possibility of double spending. If you can issue another transaction returning the Bitcoin you might get another miner to add your second spend to the Block Chain. However, it would probably have to be a mining node that hadn't seen the first transaction as there is an accepted rule that miners will always take the first transaction to build a block. This reduces the probability that second spend will work.
This is where Replace by Fee enters the picture. It is proposed that zero confirmation is a bad thing and to eliminate it a new rule is introduced that changes the 'first come first included in the block' rule to 'block with the highest mining fee included in the block'. This means that an initial zero confirmation transaction could be replaced by a later one that has a higher fee.
You can see that this makes zero confirmation very risky because it is much easier to double spend them. You basically could have an undo button in a wallet that erases a transaction by issuing a transaction with a higher fee. Great for correcting mistakes before the block is mined, but equally great for sending the Bitcoin back to your own wallet.
This also leads to an escalating war. Merchants might notice that the transaction has been overruled by the one with the higher fee and could issue their own transactions to transfer the Bitcoin to their wallets with a slightly higher fee. This continues until all of the transaction is converted into a fee. Miners win, the fraudster has the goods and the merchant loses. Clearly there is scope her for miners to collaborate with fraudsters to get more Bitcoin.
The bottom line is that zero confirmation transactions cannot be used any longer.
It is also argued that miners are free to adopt replace by fee because the well established first seen rule isn't enforceable. Any miner can simply use replace by fee and maximize its profit.
The software for replace by fee is available to use but no client wallet implementations exist. There is at least one double spend tool - gangsta - that will let you try your hand at a double spend if you can find enough miners using the replace by fee software.
What is interesting about this development in Bitcoin is that it is in a part of the algorithm that isn't enforceable. Bitcoin miners have been using the first seen rule since the start, but there is nothing that enforces it and any miner can opt to run the replace by fee software and build a block chain that makes zero confirmation transactions completely unsafe and unacceptable. This isn't good for Bitcoin, but it is difficult to see how the algorithm can be tweaked to make replace by fee unusable.
Bitcoin Course Offered Free Online
Bitcoin Isn't As Anonymous As You Might Hope
Chain Easy Bitcoin Development
Bitcore For Developing Bitcoin Apps
UPDATE 2: Is Bitcoin Broken - A Response And A Conference
Inside Bitcoin - virtual currency
Mastering Bitcoin (book review)
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Thursday, 09 April 2015 )|