October 29, 2026

Capitalizations Index – B ∞/21M

Bitcoin Is Close to Cutting Fees with Better Coin Selection

Bitcoin is close to cutting fees with better coin selection

Bitcoin Is Close to Cutting Fees with Better Coin Selection

Bitcoin is close to cutting fees with better coin selection

One of the technical mechanisms that has helped earn bitcoin comparisons to cash is on the verge of a major update.

Called “coin selection,” the term refers to the algorithm that today decides which bits of data come together to create a user’s transaction. Essentially, the coin selection code replicates the process of giving, say, a $10 bill to a cashier for a $7 item and the consumer receiving $3 in change.

But if that doesn’t sound particularly complex, remember bitcoin is experimental software, and this function, while working, isn’t altogether optimized. Making matters worse, the part that perhaps needs tweaking has a direct impact on user costs.

“bitcoin Core’s original coin selection algorithm actually needs a lot of reworking, especially with regards to transaction fees. It’s inefficient and it ends up doing a weird loop to try to guess the amount of transaction fees that are needed,” bitcoin Core contributor Andrew Chow told CoinDesk.

Mark Erhardt an engineer at wallet provider BitGo agrees, going so far as to call the algorithm “convoluted” during a recent interview on the podcast Noded.

As such, developers have been working on a new algorithm, dubbed “branch and bound” or “BnB,” which forges together data in a more efficient way, resulting in a small scaling bump and lower transaction fees.

Erhardt first proposed some optimizations nearly two years ago, while Chow was the first developer to code up the changes.

And recently the change was deemed ready to be added to bitcoin’s most popular software implementation, bitcoin Core, and so was merged into the codebase. Even better for users, the feature should be available for widespread use with the release of the 17th version of the software in the next year or so.

Speaking to the benefits of the changes, Chow said:

“This will let us tidy up the coin selection code a lot and actually make it possible for one person to understand exactly what the coin selection algorithm is doing.”

No change needed

Stepping back, as mentioned, each bitcoin transaction a user sends is made up of different smaller amounts of bitcoin.

That’s because, say you have one bitcoin in your wallet, this bitcoin is usually not just one piece of data. Rather, it’s often made up of a number of chunks of data pieced together. You might have one, two or dozens of little transaction chunks – each called “unspent transaction outputs” (UTXOs).

For instance, tied to your bitcoin wallet address might be one piece of data worth 0.1 BTC, another worth 0.3 BTC, another of 0.1 BTC and a last one, worth 0.5 BTC, to make up a whole bitcoin.

These pieces are based on the transactions that came before them and how they were initially split up to send to your wallet.

So, if you need to send 0.2 BTC, the bitcoin Core “coin selection” algorithm might decide to put the piece of data worth 0.3 BTC in what’s called the “input,” creating the transaction. There will then be two outputs: 0.2 BTC, which will be sent to the recipient, and 0.1 BTC, which will be put back into your wallet as the “change output.”

Yet, according to the developers, the algorithm isn’t all that good at deciding how to select coins for transactions.

The algorithm almost always automatically creates “change outputs,” which often aren’t necessary and waste space on the blockchain, Erhardt explained. In the example above, the algorithm could avoid this by picking the two pieces of data worth 0.1 BTC and not have to send “change” back to the sender at all.

He continued, speaking to another unfortunate side effect:

“You don’t want transactions to be ground up to dust.”

“Dust” are pieces of bitcoin that are so small they’re almost not worth spending, since the fees could be more than the transaction itself. They’re perhaps analogous to pennies, in that a penny actually costs more to make than it’s actually worth in purchasing goods.

How to choose?

The new algorithm, BnB, avoids these issuers by trying to eliminate as many change output scenarios as possible. In short, it looks at all the inputs to see if there’s a way to reach exactly the number of bitcoins a user wants to send in a transaction.

“This helps shrink the UTXO set a little more,” Chow said. “Additionally, transactions, where an exact match was found, will generally be smaller than ones where there is change, so this will also save on transaction fees for the user and free up a few more bytes of block space to fit in other transactions.”

And there’s evidence this works. In a simulation, Erkhardt found that, in approximately 40 percent of transactions that would normally have change outputs, the new algorithm was able to get rid of the unnecessary data.

In addition to these user benefits, the code change also helps developers, since the new algorithm is much easier to understand for a technical standpoint.

Still, developers aren’t done tweaking the coin selection process. Chow and others plan to take the algorithm further, by adding a so-called “simple random draw.”

When the BnB algorithm goes through all a bitcoin user’s UTXOs and simply can’t avoid creating a change output, it then falls back on the original coin selection process. But with simple random draw, the algorithm will choose random UTXOs until it reaches the amount of money required.

Interestingly, developers find randomly choosing coins is a better method than the more deliberate algorithm bitcoin Core uses today.

It’s the culmination of years of work, but according to Erhardt, the process couldn’t have been much quicker. Coin selection is a “sensitive part” of the code and changing it has “global consequences,” he said.

As such, “no one wanted to fiddle with it for too long,” Erhardt explained, adding:

“Now we’ve put in a lot of the plumbing for further changes.”

Binary code image via Shutterstock

The leader in blockchain news, CoinDesk is a media outlet that strives for the highest journalistic standards and abides by a strict set of editorial policies. CoinDesk is an independent operating subsidiary of Digital Currency Group, which invests in cryptocurrencies and blockchain startups.

Published at Mon, 02 Apr 2018 09:00:22 +0000

Features

Previous Article

Bitcoin Generator – Claim 0.25 – 1 Bitcoin

Next Article

Bitcoin Crypto Currency Bitcoin Symbol Samsung Case

You might be interested in …

South Korea Moves to Regulate Domestic Bitcoin Trading, Exchanges

South Korea Moves to Regulate Domestic Bitcoin Trading, Exchanges

Since late November 2017, South Korea has looked to regulate cryptocurrency trading in domestic exchanges, including Bithumb, Coinone and Korbit,  The Korea Herald reports. Now, trying to tame the wave of wild cryptocurrency speculation in the country, South Korea is imposing trade bans for minors and looking for ways to impose taxes on investment returns.

South Korea is the world’s third largest market in bitcoin trading, after Japan and the U.S., and the largest exchange market for ether, accounting for more than 33 percent of its market share, according to a recent MIT Technology Review report. The country is also home to two of the top 15 global digital-currency exchanges (Bithumb and Coinone) and believed to have about one million registered daily traders in virtual currencies, which is equivalent to about one out of every 50 citizens.

This is worrying the South Korean government. In September 2017, the country’s Financial Services Commission (FSC) ordered a ban on Initial Coin Offerings (ICOs). In November 2017, the head of South Korea’s Financial Supervisory Service said that the agency was monitoring cryptocurrency trading inside the country, and the country’s National Tax Agency revealed that it was considering a value-added tax, a capital gains tax or both on cryptocurrency trades. If the plan is implemented, South Korea will become one of the few countries to tax cryptocurrency-to-cash exchanges.

The government’s concern is also motivated by the risk of cyberattacks from the country’s rogue neighbor, North Korea. According to South Korea’s National Police Agency, North Korean hackers could be targeting South Korean bitcoin exchanges.

With these newest measures, North Korean banks that offer accounts for cryptocurrency trading will have to verify the identification of new account holders and prohibit minors from opening accounts. Woori Bank and Korea Development Bank will shut down virtual accounts offered to cryptocurrency exchanges before year-end, according to the banks.

The regulators will also bar financial institutions from investing in or obtaining cryptocurrencies, and is considering ways to oblige cryptocurrency exchange operators to verify users’ real names, strengthen storage security of encryption keys, and disclose purchase price and order volumes. The authorities will also take strong-handed punitive actions against the perpetrators of cryptocurrency-related scams.

In a press release, the government said that the new regulations were necessary “to prevent a general public without expertise from suffering losses by participating in virtual currency investments that have massive fluctuations.”

These issues were discussed on Wednesday, December 13, 2017, in a meeting presided over by Hong Nam-ki, minister of the Office for Government Policy coordination, and attended by officials from the ministries of justice, finance, and science and ICT, as well as from the Financial Services Commission, the Korea Communications Commission, the Fair Trade Commission and the National Tax Service.

While some news headlines are presenting this as a catastrophic development that will shut down the cryptocurrency industry in South Korea, the initiative of the South Korean authorities is in line with current trends toward stronger cryptocurrency regulations in China, Europe and the U.S.

“A right set of regulations will rather nurture the (virtual currency) market, and we would welcome that,” Bithumb representatives told Reuters, adding that such a code of conduct could add legitimacy to the market.

The post South Korea Moves to Regulate Domestic Bitcoin Trading, Exchanges appeared first on Bitcoin Magazine.