Bitcoin Forum
December 11, 2024, 10:44:39 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Having trouble figuring out tx fees  (Read 427 times)
Priceslide (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 102


Hello


View Profile WWW
July 17, 2013, 06:12:34 PM
 #1

Hello, I will use transaction f045f489dd97e8a66e4551d67b117678a558a068ce886cba1aa47b6f7eee84f0 as the example for my question (https://blockchain.info/address/1EA3nKgZVuVqwTGcM7AQCJLJbZFPJN2nam)

Why did 0.01097283 BTC get sent in addition to the .1 BTC for entry, to a separate wallet?  Obviously, for fees. Who gets to spend that? Does it sit until someone happens to generate that wallet for themselves (what I understand to be extremely unlikely)?

reddit.com/r/kinfoundation
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
July 17, 2013, 06:23:28 PM
 #2

This link shows it better (link to tx vs the address).
https://blockchain.info/tx/f045f489dd97e8a66e4551d67b117678a558a068ce886cba1aa47b6f7eee84f0

That wasn't a fee.  It was change.  Bitcoin can't spend part of output so it needs to make change
The person making the tx had outputs worth:  0.11097293 BTC and wanted to spend 0.1 BTC.
For some asinine reason they decided they wanted to include a single satoshi (0.0000001 BTC) as a fee (not exactly sure why).
Inputs must equal outputs + fee.

However the user didn't want to spend 0.11097292 BTC they wanted to spend 0.1 BTC so the client made a tx like this

IN0: 0.02465968 BTC
IN1: 0.08631325 BTC
OUT0: 0.1 BTC   <---- amount user wanted to spend
OUT1: 0.01097292 <---- the "change" sent to another address controlled by the user.

FEE: 0.00000001 BTC

You will notice the sum of the inputs minus the sum of the outputs is 0.00000001 BTC which is the fee paid to the miner.

Think of it like you want to buy a candy bar for $1 but you only have a single $20 bill.  How large will the tx be.  Well it can't be $1 because you don't have $1.  The tx will be $20. So you send $20 to the cashier and she sends back $19 in change and puts $1 into the store's account.

In Bitcoin terms it would be like this:
IN0: $20.00    <- your single $20 bill
OUT0: $1.00   <- your payment to merchant
OUT1: $10.00  <- your change in the form of $10 bill, $5 bill and 4x $1 bills
OUT2: $5.00
OUT3: $1.00
OUT4: $1.00
OUT5: $1.00
OUT6: $1.00
FEE: $0.00

You will notice the merchant had to give you a large number of discrete outputs (smaller bills).  This is because in fiat currencies the currency can only exist is predefined forms ($1, $5, $20, $100, etc).  Bitcoin however can create a new output of any value thus in the Candy bar analogy it would be like "You hand cashier a $20 bill, she securely destroys it and prints a new $1 bill and $19 bill, she puts the $1 in the teller and hands the $19 bill back to you".
wtfvanity
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500


WTF???


View Profile
July 17, 2013, 07:10:21 PM
 #3

This link shows it better (link to tx vs the address).
https://blockchain.info/tx/f045f489dd97e8a66e4551d67b117678a558a068ce886cba1aa47b6f7eee84f0

That wasn't a fee.  It was change.  Bitcoin can't spend part of output so it needs to make change
The person making the tx had outputs worth:  0.11097293 BTC and wanted to spend 0.1 BTC.
For some asinine reason they decided they wanted to include a single satoshi (0.0000001 BTC) as a fee (not exactly sure why).
Inputs must equal outputs + fee.

However the user didn't want to spend 0.11097292 BTC they wanted to spend 0.1 BTC so the client made a tx like this

IN0: 0.02465968 BTC
IN1: 0.08631325 BTC
OUT0: 0.1 BTC   <---- amount user wanted to spend
OUT1: 0.01097292 <---- the "change" sent to another address controlled by the user.

FEE: 0.00000001 BTC

You will notice the sum of the inputs minus the sum of the outputs is 0.00000001 BTC which is the fee paid to the miner.

Think of it like you want to buy a candy bar for $1 but you only have a single $20 bill.  How large will the tx be.  Well it can't be $1 because you don't have $1.  The tx will be $20. So you send $20 to the cashier and she sends back $19 in change and puts $1 into the store's account.

In Bitcoin terms it would be like this:
IN0: $20.00    <- your single $20 bill
OUT0: $1.00   <- your payment to merchant
OUT1: $10.00  <- your change in the form of $10 bill, $5 bill and 4x $1 bills
OUT2: $5.00
OUT3: $1.00
OUT4: $1.00
OUT5: $1.00
OUT6: $1.00
FEE: $0.00

You will notice the merchant had to give you a large number of discrete outputs (smaller bills).  This is because in fiat currencies the currency can only exist is predefined forms ($1, $5, $20, $100, etc).  Bitcoin however can create a new output of any value thus in the Candy bar analogy it would be like "You hand cashier a $20 bill, she securely destroys it and prints a new $1 bill and $19 bill, she puts the $1 in the teller and hands the $19 bill back to you".

What a nice explanation.


Can I play with the ending?

Quote
"You hand cashier a $20 bill, she gives it to the government which gives her a $19 bill and a $1 bill. She keeps the $1 and gives the $19 bill back to you"

No one in the bitcoin network just makes money up, they follow the rules of the network to create the change, based on the inputs. Nothing is made up, but completely dependent on previous transactions and mined blocks.

DeathAndTaxes, thanks for being so clear on that.

          WTF!     Don't Click Here              
          .      .            .            .        .            .            .          .        .     .               .            .             .            .            .           .            .     .               .         .              .           .            .            .            .     .      .     .    .     .          .            .          .            .            .           .              .     .            .            .           .            .               .         .            .     .            .            .             .            .              .            .            .      .            .            .            .            .            .            .             .          .
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!