Unconfirmed transactions have always been a rather mysterious aspect of Bitcoin that doesn’t seem to get much attention. Although many Bitcoin users believe that they have received money as soon as it shows up in their Bitcoin wallet, that isn’t necessarily true. In reality, sending a message to the Bitcoin network about a transaction does not necessarily mean that the transaction will end up in a block.
There are now Bitcoin payment processors, such as Bitnet, who are willing to take responsibility for any losses caused by an unconfirmed transaction that never gets into the blockchain. These companies are willing go the extra mile in these situations because they have integrated advanced anti-double-spending mechanisms that they claim will allow them to limit their exposure to, what some would call, fraudulent Bitcoin transactions.
Peter Todd is a Bitcoin Core developer and blockchain researcher who has his hands in many different projects in the Bitcoin space. Although he is sometimes criticized in the community for pointing out potential flaws in the protocol, the reality is that his work is extremely valuable when it comes to making Bitcoin more robust and secure. Todd was interviewed by DisrupTek.News at the Anarchopulco Conference earlier this year, and he discussed the many facets of unconfirmed Bitcoin transactions during the short conversation.
How Unconfirmed Transactions Work Right Now
To understand Peter Todd’s contentious view on unconfirmed transactions, it’s important to first look at how transactions are propagated throughout the network. As Todd explained in the interview, it can be difficult to figure out which transaction came first in a decentralized system:
“Essentially, right now, Bitcoin nodes -- they only accept the first transaction they see to the mempool. If they accept [the transaction] into the mempool and the Bitcoin node is run by a miner, it means they’ll mine blocks with that transaction in there. And if someone creates another transaction that double-spends the first transaction -- spends the same outputs but to a different destination -- that second transaction gets rejected. Of course, in a decentralized system what’s first and what’s second depends on what node. One node might see one transaction first; another node might see a different transaction first.”
Having the ability to send the same outputs (bitcoins) to more than one address is the essence of a double-spend, and one of Bitcoin’s main innovations was solving the double-spending problem. Of course, a blockchain is not as efficient as a server when it comes to processing transactions, which is why there is a delay before transactions are confirmed on the network.
Double-spending unconfirmed transactions is a lot easier than most people realise: http://t.co/EFXgphuBmx— Peter Todd (@petertoddbtc) April 17, 2014
Blockchain Confirmations are What Matter
In Bitcoin, nothing really matters until a transaction is confirmed in a block. Also, there is technically no such thing as a 100 percent finalized transaction in Bitcoin. After being confirmed in a block, there is simply a lower chance of a transaction being reversed with each block that comes after it. Having said that, the chances of one of Satoshi’s early transactions being reversed are -- practically speaking -- zero. Todd explained that confirmations are what matter during the interview:
“The blockchain, via proof-of-work, is what determines what is first and what is second. So, when you go send someone money in Bitcoin and the receiver makes the assumption that the transaction they got is definitely the one that’s going to end up in the blockchain, they’re really making an assumption based on a principle that Bitcoin itself isn’t designed to solve. Bitcoin only makes transactions guaranteed to confirm by confirmations -- by appearing in blocks. If you’re just trusting based on what nodes that are on the network happen to have, you’re actually trusting a whole lot of people to do something in a specific way.”
#Bitcoin transactions are never finalized, just ever harder to reverse. 10 confirmations protects you from a 30% attack 96% of the time.— Rich Apodaca (@bitzuma) May 6, 2015
Why Would a Miner Allow a Double-Spend to Happen?
Todd then went on to explain that there are instances where it would make sense for a miner to allow a Bitcoin user to double-spend a transaction:
“Even worse than that, it’s often against their own incentives. If the second transaction from the perspective of a node pays a lot more money in fees, then why shouldn’t the miner mine transaction number two instead of transaction number one? You know, it’s economically rational for them to mine it, and there’s no downsides to mining a double-spend.”
Whether or not this argument holds up for every miner on the network does not necessarily matter because the point is that the argument can be made. Some miners may decide that allowing double-spends to take place would harm the value of the very commodity that they are mining, but it’s unclear if every miner on the network would act in this manner. Developers and researchers should continue to search for better solutions to the problems associated with unconfirmed transactions.
Are There Any Clear Solutions to This Issue?
There have been a variety of proposed “fixes” to prevent double-spending on unconfirmed transactions, but Peter Todd also sees serious flaws in these possible solutions. He noted that many of these proposals bring more centralization to the Bitcoin network, and he used a plan from Bitcoin Core developer Mike Hearn to illustrate this point:
“There’s also the issue that, if we rely on this system, when it breaks the solutions that often get proposed at the mining level are very centralized solutions. As an example, Mike Hearn proposed the idea that miners should be able to vote to steal other miners’ block rewards, so if I find a block and other miners think that it included a double-spend, those other miners should be able to vote. And if they achieve a majority, they get to reassign my bitcoins to someone else. Of course, the technical implementation is just simply -- I can go vote to go and reassign another person’s bitcoins. And equally, from my perspective (the guy who mined a double-spend), I may have no way of knowing that it was double-spent because everything is relative. If I see one transaction first and then I see another one, I don’t know what order other people saw them in -- I can’t. So, the only way to really guarantee that is to start going off to other miners and creating a central authority on what transaction came first. I’m sure this is what would happen if that got implemented.”
What is Replace by Fee?
Todd also has his own solutions that would avoid the move away from decentralization in Bitcoin, which is the entire point of the system existing in the first place. He briefly talked about his “replace by fee” proposal, which would make it clear that unconfirmed transactions are not secure:
“One of the things I’m working on to try to stop that -- stop us going in those very harmful directions -- is to go the other direction [and] implement what’s called replace by fee. Simply, whatever transaction pays you the most money as a miner is the one you should include, and that makes it very clear that unconfirmed transactions aren’t very secure. And it forces the entire ecosystem into better solutions.”
Making Double-Spending Easier
Last year, Peter Todd released some tools to make double-spending easier for anyone who would like to try it. He discussed the aftermath of those releases during the interview:
“I wrote the first version of those tools -- maybe, I think last August or so -- and released them. I also released some tools to do double-spending, and in that case I took advantage of other techniques to exploit that not everyone sees the same transaction at the same time. Very quickly, some people lost a fair bit of money, and it seems to be that the market has reacted by not depending on unconfirmed transactions.”
Later, Todd went on to add, “Some ATM operators have lost five figures worth of money off of [double-spending attacks].”
Some Bitcoin companies, such as BlockCypher, have built tools to guard against potentially malicious Bitcoin transactions, but Peter Todd has made it clear that some of these network monitoring tools may not be scalable. Anyone involved in the Bitcoin community should continue to track the state of unconfirmed transactions as more tools for double-spending and the prevention of double-spending are built over time.
One thing not touched upon in this article is the similar volatility of Bitcoin CFDs, i.e. the trade in the underlying product which can give people who may not have the technical skills to mine or buy/sell bitcoin itself the chance to profit from the bitcoin scene, see the bitcoin trading market and others here.