Organic UTXO consolidation (in the course of regular payments)
CFCC News Bot last edited by
For UTXO-based cryptocurrencies, such as Bitcoin or Litecoin, it is important to have the set of managed Unspent Transaction Outputs in optimal shape, because if you have too much small UTXO, you will have to create bigger transactions to send the same amount of funds, and hence pay bigger network fee, or even need to send several transactions to transfer the needed amount.
Typical approach to handle this is to do periodical sweep of UTXO, bundling them all together, at the time when network fee is low.
We implemented another approach, that does not require manual UTXO consolidation, and at the same time, conserves network fee - when fee in the network is high, the algorithm tries to use less UTXO per transaction, and when network fee is low, it will create bigger transaction, effectively performing UTXO consolidation along with regular payments. This organic UTXO consolidation allows to maintain healthy UTXO set automatically, without manual consolidation runs.
We implemented it this way:
Define a rate that you are OK to pay in terms of monetary percentage: we call it “fee per full coin”. Basically, you say, “to send 1 btc, I am willing to pay 0.001 btc”
When building a transaction, we calculate optimal tx size like this:
optimal_tx_vsize = utxo_sum * fee_per_full_coin / fee_per_kb
The closer candidate transaction to the optimal size, the better score it will get.
Of course we cannot always find the optimal transaction, but we will try to choose the one with best score, depending on available UTXO set.
The resulting effect is that when fee_per_kb is high, optimal_tx_vsize will be low (may be even zero), and we will try to find the smallest tx possible with current UTXO set. When fee_per_kb is low, optimal_tx_vsize will be high, and we will choose transactions with more UTXO, performing organic UTXO consolidation.
If more wallets implement this type of optimizations, it will result in more healthy global UTXO set.
The developers of CryptoForum.cc are creating their very own cryptocurrency startup -- BAKD.io!
Show your support by posting on our BitcoinTalk thread, following us on Twitter, and subscribing to our Telegram channel to get regular project updates and talk directly with the team!
- Website: BAKD.io
- Twitter: @BAKDme
- Telegram: https://t.me/BAKDio
- BitcoinTalk Thread: https://bitcointalk.org/index.php?topic=4952711
- CryptoForum.cc Thread: https://cryptoforum.cc/topic/2525/announcing-bakd-io-a-cryptocurrency-crowdfunding-platform-and-social-network