A new pre-consensus innovation which may come soon to Bitcoin Cash seeks to provide instant and secure transactions, similar to Dash’s InstantSend.
In a recent Medium post, OpenBazaar lead backend developer and Bitcoin Cash advocate Chris Pacia detailed a new mechanism, named Avalanche, for increasing the security of zero-confirmation transactions:
“Avalanche is a new consensus protocol that was first introduced earlier this year. It provides a novel way for nodes on a network to choose between two conflicting transactions and come to a consensus about which one should be included in the next block.
Using avalanche in Bitcoin Cash for miner coordination provides a very elegant, decentralized coordination mechanism that can potentially prevent miners from accepting double spend bribes and, when combined with double spend notifications, make zeroconf transactions very secure.”
The system works as a defense against double-spends, where a malicious actor sends the same funds to two or more different destinations, attempting to defraud a merchant or user by sending them funds that end up somewhere else, for example back in the attacker’s wallet. Avalanche attempts to solve this conflict between two transactions by repeatedly polling participating nodes on which transaction is considered valid:
“Each node that is participating in the consensus process will pick a number of other nodes at random to query and ask them for their preference between A and B. Let’s say for this example each node picks eight random nodes.
If your node starts with an initial preference for transaction A (maybe A was first seen) and the majority of the nodes you query respond and say that they prefer A, then you keep your preference as transaction A. If the majority come back and say they prefer B, then you flip your preference to B. Every node in the network does the same thing.
This constitutes round 1. We are going to perform more rounds following exactly the same process. Each round we pick random nodes and either flip or don’t flip based on what the majority of the other nodes vote for.”
Going through several rounds of this polling would take about 3-5 seconds and would determine which transaction is valid, as well as protect against several forms of attack, including where a malicious transaction carries a much higher fee and is thus accepted by a minority of miners willing to take the “bribe” to prefer it over the “honest” transaction.
Avalanche shows similarities with InstantSend, but with a fundamentally different approach
Comparisons between the new Avalanche approach can be drawn with Dash’s InstantSend, which similarly improves the security of instant transactions. A key difference between the two being Bitcoin Cash’s lack of a masternode network, directing Avalanche to instead leverage miners to prevent sybil attacks where a bad actor can effortlessly spin up hundreds or thousands of nodes to attack the network, according to Pacia:
“Proof-of-work is used as the anti-sybil mechanism. The miners of the last 100 blocks form the consensus group and participate in avalanche. This is a rolling membership group. Each new block a new miner is added to the group and the miner who mined block n-100 gets booted.”
Dash uses a quorum of randomly-selected masternodes, which themselves are protected against sybil attacks by requiring proof of ownership of 1,000 Dash in order to run, to lock in a transaction. Several other important distinctions apply as well, and Dash developer Pasta shared a few initial thoughts on implementations of pre-consensus and its comparison to Dash’s approach:
“PreConsensus has a theoretical time of 3-5 seconds compared to Dash’s sub-2 second lock; PreConsensus is non-binding, if a Dash transaction is InstantSend locked it is guaranteed it won’t be conflicted, there is no such guarantee for the merchant under PreConsensus.”
Pasta added that comparisons between the two approaches may be premature since Avalanche has not been finalized or implemented yet, while InstantSend has been in effect for several years now:
“However, PreConsensus / Avalanche is not released, developed, or even fully formalized yet and as such is difficult to fully analyze and compare. Other attack vectors such as DOS or DDOS attacks could very well be possible by spamming double spend transactions, Dash’s InstantSend is proven to work.”
InstantSend is one of the many innovations Dash has made possible because of its masternode network. However, for coins based entirely on proof-of-work with a 100% miner block reward, solutions such as Avalanche may benefit security and user experience significantly.
As cryptocurrency advances, increased security becomes a must
As adoption of cryptocurrency continues to rise and more businesses and users explore it as an option for payments and storing wealth, enhancements to the technology’s security are made increasingly necessary. According to Dash Core developer Alexander Block, innovations such as InstantSend and Avalanche are necessary to ensure a smooth and safe experience necessary for commercial applications:
“Good to see that finding solutions to the double spending issues gets higher and higher priorities. Even though Bitcoin already solved it to some degree, the remaining uncertainty will always be a problem. You can’t explain to merchants that ‘there is a chance of double-spends, but it’s a non-issue because of miner incentives…but to be on the safe side, wait for 6 confirmations!’ Even if we as crypto insiders know that this is fine, you can’t expect others to feel safe with such statements. We need solutions like InstantSend or alternative solutions like Avalanche because only then we can explain ‘It’s ok, the protocol handles it.'”
To guard against network-wide attacks, Bitcoin Cash recently implemented improvements to checkpoints, a method of removing uncertainty in transaction history and preventing a hostile and powerful miner from rewriting the chain’s transaction history. Similarly, Dash plans to implement ChainLocks soon, which will leverage the masternode network to prevent a malicious actor from attacking the chain even if they have the majority of mining hashpower.