Bitcoin Forum
November 10, 2024, 05:21:40 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Relationship between utxo and tx fee  (Read 227 times)
monerama (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 8


View Profile WWW
July 24, 2019, 01:30:07 PM
Merited by OgNasty (2), bitmover (1)
 #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?
Little Mouse
Legendary
*
Online Online

Activity: 2226
Merit: 2279


Marketing Campaign Manager |Telegram ID- @LT_Mouse


View Profile WWW
July 24, 2019, 01:53:39 PM
Merited by OgNasty (2), bones261 (2)
 #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.

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
bitmover
Legendary
*
Offline Offline

Activity: 2478
Merit: 6316


bitcoindata.science


View Profile WWW
July 24, 2019, 05: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.

BitMaxz
Legendary
*
Offline Offline

Activity: 3430
Merit: 3168


Playbet.io - Crypto Casino and Sportsbook


View Profile WWW
July 24, 2019, 05: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.

███████████████
█████████████████████
██████▄▄███████████████
██████▐████▄▄████████████
██████▐██▀▀▀██▄▄█████████
████████▌█████▀██▄▄██████
██████████████████▌█████
█████████████▀▄██▀▀██████
██████▐██▄▄█▌███████████
██████▐████▀█████████████
██████▀▀███████████████
█████████████████████
███████████████

.... ..Playbet.io..Casino & Sportsbook.....Grab up to  BTC + 800 Free Spins........
████████████████████████████████████████
██████████████████████████████████████████████
██████▄▄████████████████████████████████████████
██████▐████▄▄█████████████████████████████████████
██████▐██▀▀▀██▄▄██████████████████████████████████
████████▌█████▀██▄▄█████▄███▄███▄███▄█████████████
██████████████████▌████▀░░██▌██▄▄▄██████████████
█████████████▀▄██▀▀█████▄░░██▌██▄░░▄▄████▄███████
██████▐██▄▄█▌██████████▀███▀███▀███▀███▀█████████
██████▐████▀██████████████████████████████████████
██████▀▀████████████████████████████████████████
██████████████████████████████████████████████
████████████████████████████████████████
odolvlobo
Legendary
*
Offline Offline

Activity: 4494
Merit: 3403



View Profile
July 25, 2019, 12:05:07 AM
 #5

When you spend bitcoins, the transaction references only their UTXOs. Their addresses are not included in the transaction.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
pooya87
Legendary
*
Offline Offline

Activity: 3626
Merit: 11027


Crypto Swap Exchange


View Profile
July 25, 2019, 04:12:19 AM
Merited by DarkStar_ (1)
 #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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
monerama (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 8


View Profile WWW
July 25, 2019, 07:52:36 AM
Merited by DarkStar_ (1)
 #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.
Pffrt
Sr. Member
****
Offline Offline

Activity: 1372
Merit: 322


View Profile
July 25, 2019, 08: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.)
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18746


View Profile
July 25, 2019, 08: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://bitcointalk.org/index.php?topic=2848987.0

Dust is explained within the bitcoin code here: https://github.com/bitcoin/bitcoin/blob/master/src/policy/policy.cpp (lines 16 - 29).
pooya87
Legendary
*
Offline Offline

Activity: 3626
Merit: 11027


Crypto Swap Exchange


View Profile
July 26, 2019, 05: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

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!