Bitcoin Forum
February 29, 2020, 02:02:18 PM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Relationship between utxo and tx fee  (Read 147 times)
monerama
Newbie
*
Offline Offline

Activity: 8
Merit: 7


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?
1582984938
Hero Member
*
Offline Offline

Posts: 1582984938

View Profile Personal Message (Offline)

Ignore
1582984938
Reply with quote  #2

1582984938
Report to moderator
1582984938
Hero Member
*
Offline Offline

Posts: 1582984938

View Profile Personal Message (Offline)

Ignore
1582984938
Reply with quote  #2

1582984938
Report to moderator
1582984938
Hero Member
*
Offline Offline

Posts: 1582984938

View Profile Personal Message (Offline)

Ignore
1582984938
Reply with quote  #2

1582984938
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Little Mouse
Full Member
***
Offline Offline

Activity: 518
Merit: 154



View Profile
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.

[   B E S T   C H A N G E   ]      Best Rates For Exchanging Cryptocurrency
●              ►              Buy bitcoin with credit card  ✓              ◄              ●
FACEBOOK                TWITTER                INSTAGRAM                TELEGRAM
bitmover
Hero Member
*****
Offline Offline

Activity: 770
Merit: 1294



View Profile
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: 1722
Merit: 1348


Beware on fake ledger nano, trezor and electrum.


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.

odolvlobo
Legendary
*
Offline Offline

Activity: 2786
Merit: 1499



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.

Buy stuff on Amazon at a discount with bitcoins or convert Amazon points to bitcoins: Purse.io
Join an anti-signature campaign: Click ignore on the members of signature campaigns.
pooya87
Legendary
*
Offline Offline

Activity: 1932
Merit: 2397


Remember tonight for it's the beginning of forever


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.

monerama
Newbie
*
Offline Offline

Activity: 8
Merit: 7


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
Full Member
***
Online Online

Activity: 840
Merit: 122



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.)

[   B E S T   C H A N G E   ]      Best Rates For Exchanging Cryptocurrency
●              ►              Buy bitcoin with credit card  ✓              ◄              ●
FACEBOOK                TWITTER                INSTAGRAM                TELEGRAM
o_e_l_e_o
Legendary
*
Offline Offline

Activity: 854
Merit: 3699


Decent


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: 1932
Merit: 2397


Remember tonight for it's the beginning of forever


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

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!