The so-called algorithm “selection of coins” in the bitcoin blockchain, which directly affects transaction costs user planned optimizirovat, writes coindesk.com.
“THE SELECTION ALGORITHM OF COINS IN BITCOIN CORE, IN FACT, YOU NEED TO SERIOUSLY REFINED, ESPECIALLY IN RELATION TO TRANSACTIONAL COMMISSIONS. IT is INEFFICIENT AND TO CALCULATE the required NUMBER of CHARGES IT CREATES a WEIRD CYCLE,” SAID ONE of the DEVELOPERS OF BITCOIN CORE ANDREW CHOW mark Erhardt, an engineer of the client for the cryptocurrency wallet BitGo, agrees that the algorithm is “confused.”
As explained Erhardt, the current algorithm is almost always automatically creates “outputs for delivery” in which there is no need and it takes up the space of blocks. For example, to transmit the same 0.2 BTC, you could use two segments of data, each of which holds for 0.1 BTC.
“NOBODY WANTS THE TRANSACTION WAS MILLED TO DUST,” SAYS ERHARDT, MEANING BY “DUST” THE PARTS OF BITCOIN THAT ARE JUST IMPRACTICAL TO SPEND BECAUSE THE TRANSACTION FEE EXCEEDS THEIR COST.
Thus, the developers are working on a new algorithm called “branch and bound” or “BnB”, which more efficiently combines data that leads to a small scale and lower transaction fees. Erhardt suggested several optimizations almost two years ago, while Chow became the first developer who wrote this code change.
The last change was ready to integrate the most popular software implementation of Bitcoin, Bitcoin Core, and therefore it was included in the codebase. Good news for users, the feature should be available for widespread use with the release of the 17th version of the software next year.
On the way back, as mentioned above, every Bitcoin transaction that sends the user consists of separate smaller parts of coins. Let’s say you have one Bitcoin in your wallet. This Bitcoin is not a single piece of data. It often consists of several segments assembled together. You can have one, two or transactional dozens of small fragments, each of which is called “unspent transaction outputs” (UTXO). For example, tied to your address bitcoin wallet can store one piece of data worth of 0.1 BTC, the other is 0.3 BTC, the other is 0.1 BTC and the last price of 0.5 BTC, that is a Bitcoin.
So, when sending 0.2 BTC program can decide to take part of the data constituting 0.3 BTC and send them to two choices: the amount and the recipient’s balance for the sender. The algorithm can also create a few “spare” outputs (UTXO) for the section of the transaction between them, while using them only partially.
According to the developers, this algorithm is not so good at selection the method of selection of coins for transactions. Erhardt explained that the algorithm almost always automatically creates “outputs”, which often is not necessary. In the above example, the algorithm can avoid this by choosing two pieces of data at 0.1 BTC, and do not send “change” back. New BnB algorithm tries to eliminate as many options with which you want to send the change.
“IT HELPS TO REDUCE THE NUMBER OF UTXO,” SAID CHOW. “IN ADDITION, THE TRANSACTION WITH AN EXACT MATCH COIN BASE AND THE DESIRED AMOUNT WILL BE LESS THAN THOSE THAT INVOLVE CHANGE. THIS will ALLOW the USER to SAVE ON TRANSACTION FEES AND to FREE up a FEW BYTES IN the BLOCKCHAIN SPACE ” Already there is evidence that the new algorithm works as promised.
The simulation Erhardt found that he was able to get rid of unnecessary data, approximately 40 percent of transactions. In addition to all the benefits, change the code also helps developers because new algorithm is much easier to understand from a technical point of view. However, Chou and the other developers plan to use the algorithm by adding the so-called “simple random selection”.
When the BnB algorithm, after analyzing all the UTXO user simply can not avoid the issue of delivery, he returns to the original process of selection of coins. But simple random selection algorithm will use a random unspent outputs random method, until you reach the required amount of money.
Interestingly, the developers find a random selection of coins a better option than polling algorithm Bitcoin Core used today. TO DATE, WE HAVE LAID A SOLID FOUNDATION FOR FURTHER CHANGES,” SAID ERHARDT. It is the result of years of work and according to Erhardt, it is a “sensitive part” of the code which have “global consequences.”