In 2019, the Bitcoin network will be completely revised the basic mechanism of transactions

The recently introduced release of Bitcoin Core 0.16.0 software contributed to lowering commissions and facilitating blockchain, significantly simplifying the creation of SegWit-wallets and increasing the number of SegWit-transactions. The next version of the SOFTWARE, the output of which is scheduled for 2019, will change one of the main mechanisms of bitcoin transactions-the algorithm of selection of coins.
To understand the principle of its operation, you can imagine a bitcoin transaction as a cash payment process, in which you pay a bill of $10 for a thing worth $7 and get $3 change. Bitcoin wallet, which stores, for example, 2 bitcoins, does not contain two separate coins, but the so — called "unspent transaction outputs" (UTXO) - "remains" of previous sent or received transactions, which can represent the amount of 0.1 BTC, 0.3 BTC, 0.1 BTC, 0.5 BTC, 0.2 BTC, 0.4 BTC, 0.3 BTC and 0.1 BTC or any other combination of similar (and even smaller) components. Going further, these records are not contained in any particular address or wallet, but are scattered among the many transactions and blocks. The wallet calculates the user's balance by scanning the blockchain and finding all UTXO belonging to that user. That is, each bitcoin transaction consists of different smaller amounts of bitcoin, and if you want to send 0.2 BTC, the algorithm of selection of coins in Bitcoin Core can send a piece of data stored 0.3 BTC, in the "transaction entry" (input-record of what address bitcoins are received from) and create two outputs (output — to what address bitcoins are sent): 0.2 BTC will be sent to the recipient, and 0.1 BTC will return to the wallet as "delivery".



Thus, the coin selection algorithm determines which bits of data are combined into a single transaction. According to the developers, this function is imperfect, leading to excess commissions and cluttered areas of the blocks of records is not always necessary to surrender. "The original algorithm of coin selection in Bitcoin Core needs a lot of processing, especially with regard to transaction fees. It is ineffective and eventually makes a strange cycle of calculations, trying to guess the amount of the required fee," — said Bitcoin Core developer Andrew Chow. Mark Ehrhardt, the developer of the BitGo wallet, calls the current principle of coin selection "confusing". It does not always make the optimal decision as to which data records (which "pieces of coins") to choose for a transaction. As Erhardt explained, today's algorithm almost always automatically creates "drop outs" that may not be needed and thus just spends block space. For example, in order to transmit the same 0.2 BTC, it was possible to use two data segments, each of which stores 0.1 BTC. "Nobody wants the transaction was milled to dust," says Erhardt, understanding of "dust" are part of bitcoin is that it is unprofitable to spend, because the transaction fee exceeds their cost.

The new branch and bound algorithm (BnB) groups data more efficiently and economically, both in terms of scalability and in terms of fees. Proposals to optimize the old system made Erhardt two years ago, and Chow became the author of the code.

"This will allow us to bring order to the selection code and make it possible for everyone to understand exactly what the coin selection algorithm does," Chow says.
The BNB algorithm is designed to avoid the need for surrender whenever possible. He works through all the inputs, trying to find among them exactly the number of bitcoins, what the user wants to spend.

"This helps to reduce the number of unspent outputs. In addition, transactions for which the exact number of bitcoins has been selected, will generally take up less space than those for which surrender is provided, because this will also reduce transaction fees and release several bytes in the block space, where several more transactions can be written," Chow notes.
During the test, Erhardt found that the new code "facilitated" about 40% of transactions that under the old system would have outputs for delivery.

The developers plan to further improve the algorithm by adding the so-called "simple random selection". When the BNB algorithm scans all unspent transaction outputs of the user and can not do without the issuance of delivery, he is forced to apply the previous process of selection of coins, but to choose unspent outputs the new algorithm will be random — until it collects the required amount of funds. A random selection of coins the developers think is more effective than today's polling algorithm.



Erhardt says that the work on the new algorithm was carried out for several years, since the selection of coins — "sensitive part" of the code, the change of which will have "global consequences".

"By now, we have laid a solid Foundation for further changes," Erhardt said.
+ 0 -
The news of the cryptocurrency, the blockchain, ICO, mining, trading. Current news from the world of cryptocurrencies, blockchain, ICO, mining, trading, cryptocurrency Exchange rate. Go to the website to find out all the details. Cryptocurrency news for today, the latest latest mining news in China and the world – analyses, reviews, forecasts