Bitcoin Forum
September 27, 2018, 10:54:44 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: This transaction requires a transaction fee of at least 0.0215 because of ...  (Read 1191 times)
sebicas
Member
**
Offline Offline

Activity: 69
Merit: 10


View Profile WWW
January 10, 2013, 08:29:31 PM
 #1

Can somebody tell me how is this amount calculated?

Thanks!
1538088884
Hero Member
*
Offline Offline

Posts: 1538088884

View Profile Personal Message (Offline)

Ignore
1538088884
Reply with quote  #2

1538088884
Report to moderator
1538088884
Hero Member
*
Offline Offline

Posts: 1538088884

View Profile Personal Message (Offline)

Ignore
1538088884
Reply with quote  #2

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

Posts: 1538088884

View Profile Personal Message (Offline)

Ignore
1538088884
Reply with quote  #2

1538088884
Report to moderator
1538088884
Hero Member
*
Offline Offline

Posts: 1538088884

View Profile Personal Message (Offline)

Ignore
1538088884
Reply with quote  #2

1538088884
Report to moderator
gmaxwell
Moderator
Legendary
*
qt
Offline Offline

Activity: 2520
Merit: 1514



View Profile
January 10, 2013, 09:07:38 PM
 #2

Can somebody tell me how is this amount calculated?
Thanks!

Your transaction doesn't qualify as free, so it's applying 0.0005  BTC per 1000 bytes of transaction data. Your transaction is 43kilobytes in size. A basic transaction is about 230 bytes in size. Your transaction is likely so large because something has been paying you in very tiny coins.

E.g. it's like you asked for all your change in pennies and now that bank wants a fee to handle the big sack you're turning in to deposit.

Bitcoin will not be compromised
DannyHamilton
Legendary
*
Offline Offline

Activity: 2198
Merit: 1373



View Profile
January 10, 2013, 10:21:29 PM
 #3

The code can be found in GetMinFee() in main.cpp.

First a fee is calculated by dividing the size of the transaction (in bytes) by 1000, adding one to the integer quotient, and multiplying the sum by 0.0005 (nBaseFee) . . .
Quote
int64 nMinFee = (1 + (int64)nBytes / 1000) * nBaseFee;

If the total size (in bytes) of the transaction is less than 10kB, then the client lets you send it without the fee . . .
Quote
if (nBytes < 10000)
    nMinFee = 0;

However, if any output is less than 0.01, then a the client decides you need a fee after all . . .
Quote
if (txout.nValue < CENT)
    nMinFee = nBaseFee;

After all that, if the fee is bigger than 21,000,000 BTC, then it gets reduced to exactly 21,000,000 BTC.
Quote
if (!MoneyRange(nMinFee))
    nMinFee = MAX_MONEY;

dooglus
Legendary
*
Offline Offline

Activity: 2548
Merit: 1125



View Profile
January 11, 2013, 09:28:27 PM
 #4

If the total size (in bytes) of the transaction is less than 10kB, then the client lets you send it without the fee . . .
Quote
if (nBytes < 10000)
    nMinFee = 0;

Except that there's also a check made to make sure that the coins you are spending are old enough and big enough to qualify for no fee.  It multiplies the age of the coin (in days) by the value of the coin (in BTC) and needs to get more than 1 for the spend to be free.

For example, a 12 BTC coin only needs to be 2 hours old to not incur a fee when it's spent (12 * 2/24 == 1) but a 0.01 BTC coin needs to be 100 days old before it can be spent without a fee.

If you're spending multiple coins at once, it sums the product of value and age over all the coins you're spending, and if that sum is greater than 1, the coins are deemed big/old enough.  So you can spend the 2 hour old 12 BTC coin and a brand new 0.01 BTC coin without a fee if you spend them both at once.

Just-Dice                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   Play or Invest                 ██             
          ██████████         
      ██████████████████     
  ██████████████████████████ 
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
    ██████████████████████   
        ██████████████       
            ██████           
   1% House Edge
sebicas
Member
**
Offline Offline

Activity: 69
Merit: 10


View Profile WWW
January 12, 2013, 09:17:08 AM
 #5

Thanks for all the answers!
etotheipi
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1002


Core Armory Developer


View Profile WWW
January 13, 2013, 04:02:27 AM
 #6

Whoa, didn't the allow-free criteria for transaction size used to be like 4 kB?  I have definitely been using 4 kB ever since Armory was first released...

I'll go ahead and update that...

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
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!