The Bitcoin protocol knows no “Account Balance”, and understanding this can save you a lot of fees

Cryptocurrency News and Public Mining Pools

The Bitcoin protocol knows no “Account Balance”, and understanding this can save you a lot of fees

The Bitcoin protocol knows no "Account Balance", and understanding this can save you a lot of fees

From time to time people are confronted with surprisingly high BTC transaction fees and don't understand what they do wrong. So let me explain how the BTC protocol handles balances and how you can use this knowledge to save fees in the future.

Bitcoin is a UTXO currency

Other than Ethereum, the Bitcoin protocol doesn't have a concept like an "account balance". There are only Unspent Transaction Outputs (UTXO), and these belong to a certain address.

For one a UTXO has to be always completely spend, this is the reason we always have a "change address" in BTC – even though technically the change address can be made identical to the sender. For this reason a "standard transaction" is often referring to a transaction with 1 input and 2 outputs.

Other known examples using this model besides Bitcoin are Litecoin and Dogecoin, but also many more.

How knowing this can save you money

Besides having a change address there is another consequence from this: Each UTXO has the be spend explicitely. If your address received 17 deposits over time and you want to transfer them to a different address, your next transaction will have 17 inputs:

TX1 : Example transaction to self requiring 17 inputs all coming from the same address

This transaction destroys your 17 UTXOs and creates a new one holding all your coins in this address. Your next transaction will be a lot smaller and cost less fees:

TX2 : Following transaction having only 1 input

In this example you can easily see the TX1 is more than 10 times the size of TX2.

If you are accumulating Bitcoin on your own wallet (like once a week or month), you can use this knowledge to save potential fees in the future. During a bull run, the Bitcoin fees usually go up, you will pay a lot of sats per virtual Byte. If you have to send TX1 while the fee is high, you will have to pay a lot more. If a standard transaction is 10$, you can easily pay 100$ or more for this "mistake".

You can easily prevent this by batching your inputs together from time to time while the fees are low. To do this in the most efficient way, you simply make a transfer to yourself with the lowest possible fee (1 sat/vB) , ideally while the mempool is empty. Of course you could also broadcast the transaction at any time, and it will confirm once the mempool gets emptied.

You can browse the transactions I made for this on the testnet.

tl;dr: Bitcoin transactions are not automatically combined in an "account balance". You can combine them yourself to prevent paying a very high fee in the next hype phase.

submitted by /u/Maxx3141
[link] [comments]