Author

Topic: Relationship between utxo and tx fee (Read 227 times)

legendary
Activity: 3472
Merit: 10611
July 26, 2019, 12:24:39 AM
#10
a typical non-segwit 148 byte input and 34 bytes output,
these numbers seem a bit weird since you are also including the "transaction" fields such as version (4 bytes), txincout (1 byte), txoutcount (1 byte), locktime (4bytes) as the input/output sizes. the input/output size itself is smaller.

Quote
you can always click on the line numbers, hold shift click on second number to get the link. also add commit to it.
https://github.com/bitcoin/bitcoin/blob/a54a12046e98c57512715041d30ecf2f0ab8f6dd/src/policy/policy.cpp#L16-L29
legendary
Activity: 2268
Merit: 18748
July 25, 2019, 03:50:49 AM
#9
So there is no point of reusing addresses.
Correct. Address reuse is also generally discouraged as it reduces your privacy, by allowing someone to link you to many separate transactions.

This also mean that dust utxo are hardly spendable. Tx fee of such transaction from many dust utxo will be higher than combined dust utxo value.
Also correct. The default dustrelayfee is 3 satoshi/byte. With a typical non-segwit 148 byte input and 34 bytes output, this means the minimum spend is ((148+34)*3) = 546 satoshi. If you find yourself with many small UTXOs, then the best option is to consolidate them all together in to one UTXO with the lowest possible fee of 1 sat/byte. Loyce has a thread explaining this here: https://bitcointalksearch.org/topic/aug-2022-mempool-empty-use-this-opportunity-to-consolidate-your-small-inputs-2848987

Dust is explained within the bitcoin code here: https://github.com/bitcoin/bitcoin/blob/master/src/policy/policy.cpp (lines 16 - 29).
sr. member
Activity: 1372
Merit: 322
July 25, 2019, 03:03:04 AM
#8
Thanks for responses. So there is no point of reusing addresses. I always thought that one "donation" address can somehow consolidate multiple utxo with lower fee. I was wrong. This also mean that dust utxo are hardly spendable. Tx fee of such transaction from many dust utxo will be higher than combined dust utxo value.
Any amount of fewer than 300 satoshis (probably) will be a loss to have transacted. However, you can consolidate transaction with 1 satoshi per byte which will not be much costly, assuming that donation is not less than 500 satoshi (which barely can be true.)
newbie
Activity: 8
Merit: 8
July 25, 2019, 02:52:36 AM
#7
Thanks for responses. So there is no point of reusing addresses. I always thought that one "donation" address can somehow consolidate multiple utxo with lower fee. I was wrong. This also mean that dust utxo are hardly spendable. Tx fee of such transaction from many dust utxo will be higher than combined dust utxo value.
legendary
Activity: 3472
Merit: 10611
July 24, 2019, 11:12:19 PM
#6
I forgot to mention that if you use segwit address it will decrease your transaction size and fee. So I suggest you use segwit address instead if you care about the fee.

your transaction "size" in bytes is actually bigger when you use SegWit, it is extra big if you use nested SegWit (SegWit addresses that start with 3) because SegWit transactions have overhead. the reason why you pay lesser fees compared to legacy transactions is the way transaction size or rather weight/virtual size is used for fee payment instead.
legendary
Activity: 4466
Merit: 3391
July 24, 2019, 07:05:07 PM
#5
When you spend bitcoins, the transaction references only their UTXOs. Their addresses are not included in the transaction.
legendary
Activity: 3374
Merit: 3095
Playbet.io - Crypto Casino and Sportsbook
July 24, 2019, 12:18:46 PM
#4
UTXO means "Unspent Transaction Output"  these are outputs that you can able to spend.

The variant 2 will count as two UTXO so they are both the same. The transaction fee will depend on your transaction size and the fee you set.

If you have a higher amount of UTXO(Higher Transaction size) in the transaction even if they are on different address the calculation of the fees will depend on the fee you set and the transaction size.

Sample you have 5 UTXO in one address/2 UTXO and 3 UTXO in your two addresses it will count as one if you spend them(Both will have the same size).
Sample Transaction size is 500bytes and the fee you set is 20sat/byte. (500x20=10,000) so your fee will be 10k sat.

We can set the fee to lower like 1sat/byte but the problem with lower fees it will take time to be process before it confirms.

Edit:
I forgot to mention that if you use segwit address it will decrease your transaction size and fee. So I suggest you use segwit address instead if you care about the fee.
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
July 24, 2019, 12:10:31 PM
#3
Both are same because your input will be the same here. In both case, input is 2, So, fee will not have any affect. I might be wrong, let's see an answer from SR member.

You are right.

You can estimate your fees here (https://www.buybitcoinworldwide.com/fee-calculator/), according to how many inputs and outputs you have in a transaction.

Number of addresses doesn't matter, as long as they are in the same wallet (i.e. both private keys in the same wallet). If they are on different wallets you need to make 2 transactions., which will be more expensive.
legendary
Activity: 2156
Merit: 2100
Marketing Campaign Manager |Telegram ID- @LT_Mouse
July 24, 2019, 08:53:39 AM
#2
Both are same because your input will be the same here. In both case, input is 2, So, fee will not have any affect. I might be wrong, let's see an answer from SR member.
newbie
Activity: 8
Merit: 8
July 24, 2019, 08:30:07 AM
#1
Hi, I would like to ask:

Variant 1: I have one address with two utxo.

Variant 2: I have two addresses, each one with one utxo.

I want to spend these two utxos to one final address. Which transaction (1 or 2) will have lower tx fee?
Jump to: