Bitcoin Forum
May 13, 2024, 10:58:51 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Basic transaction question  (Read 698 times)
HabBear (OP)
Hero Member
*****
Offline Offline

Activity: 1106
Merit: 637


View Profile WWW
May 20, 2017, 07:50:30 PM
 #1

This is a basic transaction question, thanks in advance for the education.

I sent a transaction to someone for BTC0.022, however when I look at the TXID on the blockchain it shows a total output of BTC0.049 (plus some dust).

Here's the TXID: a445eb2606c75627e93dc8f28a2464e01799816ef647a8d219b19be1ff41be35

Can someone explain to me what's happening?

Thank you.
1715597931
Hero Member
*
Offline Offline

Posts: 1715597931

View Profile Personal Message (Offline)

Ignore
1715597931
Reply with quote  #2

1715597931
Report to moderator
"Your bitcoin is secured in a way that is physically impossible for others to access, no matter for what reason, no matter how good the excuse, no matter a majority of miners, no matter what." -- Greg Maxwell
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715597931
Hero Member
*
Offline Offline

Posts: 1715597931

View Profile Personal Message (Offline)

Ignore
1715597931
Reply with quote  #2

1715597931
Report to moderator
1715597931
Hero Member
*
Offline Offline

Posts: 1715597931

View Profile Personal Message (Offline)

Ignore
1715597931
Reply with quote  #2

1715597931
Report to moderator
Velkro
Legendary
*
Offline Offline

Activity: 2296
Merit: 1014



View Profile
May 20, 2017, 11:28:15 PM
 #2

By me, its that u had 0.049 in your bitcoin addresses. When you send only 0.022 bitcoin by design spend whole 0.049 in this way:
1. One part is amount u send to specific address (0.022)
2. Rest of money is sent as change to your other address in a wallet (could be hidden, that how some wallet works).

pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
May 21, 2017, 04:21:50 AM
 #3

if you had one 100 dollar bill and you wanted to pay someone 50 dollar, so what do you do? you tear the 100 dollar bill in half and give half of it (50 dollar) to that someone and put the other half (50 dollar) in your pocket Smiley

the same is true about bitcoin.
in bitcoin there is no such thing as "coins" or "bitcoin" there are only transaction outputs and you spend those.
here you had 1 transaction output called c4473ecd47d5cbe10c560579ff2f989c05a33e7a9a8df718da0db7cec4c98577 which was worth 0.05BTC and you wanted to pay someone 0.022BTC.
so what do you do?
you break that amount into two new amounts: 0.022BTC + 0.02708601BTC give the 0.022 to that someone and put the rest in your pocket (the newly generated change address).
and the difference goes to the miners as fee (0.00091399BTC)

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
HabBear (OP)
Hero Member
*****
Offline Offline

Activity: 1106
Merit: 637


View Profile WWW
May 21, 2017, 04:44:52 AM
 #4

This analogy is confusing for me because I'm choosing how much money to use to pay for the transaction. I chose to pay with exact change. (Recognizing it's likely possible I'm just missing key foundational understanding of how transactions work.)

Would your answer differ if I said this transaction was sent from a Coinbase wallet?

Thanks...I appreciate both of your comments.

if you had one 100 dollar bill and you wanted to pay someone 50 dollar, so what do you do? you tear the 100 dollar bill in half and give half of it (50 dollar) to that someone and put the other half (50 dollar) in your pocket Smiley

the same is true about bitcoin.
in bitcoin there is no such thing as "coins" or "bitcoin" there are only transaction outputs and you spend those.
here you had 1 transaction output called c4473ecd47d5cbe10c560579ff2f989c05a33e7a9a8df718da0db7cec4c98577 which was worth 0.05BTC and you wanted to pay someone 0.022BTC.
so what do you do?
you break that amount into two new amounts: 0.022BTC + 0.02708601BTC give the 0.022 to that someone and put the rest in your pocket (the newly generated change address).
and the difference goes to the miners as fee (0.00091399BTC)
odolvlobo
Legendary
*
Offline Offline

Activity: 4312
Merit: 3214



View Profile
May 21, 2017, 07:25:30 AM
 #5

Transactions work with inputs and outputs. The output of one transaction becomes an input of another transaction.

Here is a long example:

Let's say that somebody sends you 0.5 BTC twice, for a total of 1 BTC, and you want to send 0.75 BTC to somebody. Your wallet will construct this transaction:

Inputs: 0.5 BTC, 0.5 BTC
Outputs: 0.75 BTC, 0.2499 BTC
(fee paid is 0.0001 BTC)

After that transaction, your wallet has 0.2499 BTC (the "change" from the previous transaction).

Now, you want to send 0.1 BTC. The wallet constructs this transaction:

Inputs: 0.2499 BTC
Outputs: 0.1 BTC, 0.1498 BTC
(fee paid is 0.0001 BTC)

Your wallet now holds 0.1498 BTC. Then someone sends you 0.1 BTC, so you have 0.2498 BTC.

Now, you want to send 0.2 BTC. You wallet constructs this transaction:

Inputs: 0.1498 BTC, 0.1 BTC
Outputs: 0.2 BTC, 0.0497 BTC
(fee paid is 0.0001 BTC)

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
HabBear (OP)
Hero Member
*****
Offline Offline

Activity: 1106
Merit: 637


View Profile WWW
May 21, 2017, 07:45:05 PM
 #6

Here is a long example:

Let's say that somebody sends you 0.5 BTC twice, for a total of 1 BTC, and you want to send 0.75 BTC to somebody. Your wallet will construct this transaction:

Inputs: 0.5 BTC, 0.5 BTC
Outputs: 0.75 BTC, 0.2499 BTC
(fee paid is 0.0001 BTC)

After that transaction, your wallet has 0.2499 BTC (the "change" from the previous transaction).

I suppose this starting to make sense. What time frame exists for your inputs and outputs example above? When does a transaction settle to just leave me with a balance that maybe a month from now I draw on again with a new transaction? I would normally assume that a new transaction would stay clean, e.g., my 0.5 BTC out for a payment, no change needed.
Karpeles
Legendary
*
Offline Offline

Activity: 1162
Merit: 1000


View Profile
May 21, 2017, 08:21:09 PM
 #7

By default, what is not sent for an address is sent as transaction fee.
So if you want to send less than the entire balance, you should send back the amount you want to your address, or some other in the same wallet, as an additional input.
That should explain what you've seen
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
May 22, 2017, 04:32:26 AM
 #8

~
Would your answer differ if I said this transaction was sent from a Coinbase wallet?
~

it doesn't matter, even if a web wallet like Coinbase is used. they are having some transaction outputs (the 100 dollar bill) in their pocket and pay it on your behalf. the principle is still the same as long as the transaction is on chain.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
odolvlobo
Legendary
*
Offline Offline

Activity: 4312
Merit: 3214



View Profile
May 22, 2017, 05:51:21 AM
Last edit: May 22, 2017, 06:13:26 AM by odolvlobo
 #9

Here is a long example:

Let's say that somebody sends you 0.5 BTC twice, for a total of 1 BTC, and you want to send 0.75 BTC to somebody. Your wallet will construct this transaction:

Inputs: 0.5 BTC, 0.5 BTC
Outputs: 0.75 BTC, 0.2499 BTC
(fee paid is 0.0001 BTC)

After that transaction, your wallet has 0.2499 BTC (the "change" from the previous transaction).

I suppose this starting to make sense. What time frame exists for your inputs and outputs example above? When does a transaction settle to just leave me with a balance that maybe a month from now I draw on again with a new transaction? I would normally assume that a new transaction would stay clean, e.g., my 0.5 BTC out for a payment, no change needed.

There is no "settling" and no balance. The balances your wallet shows you are computed by the wallet for your convenience. The balance for an address is simply the sum of the outputs using that address that have not yet been used as inputs.

Time is not relevant. Your 0.75 BTC transaction will be the same whether it is made immediately after the two 0.5 BTC transactions or 100 years later (assuming there are no others in between).

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
HabBear (OP)
Hero Member
*****
Offline Offline

Activity: 1106
Merit: 637


View Profile WWW
May 22, 2017, 04:56:32 PM
 #10

Thanks everyone for your responses.

Is change like this produced on every transaction? Or, more clearly, what's the trigger or criteria that will produce the change? Knowing this helps the rest us know when we need to be aware of the change and where it's being sent after a transaction.
odolvlobo
Legendary
*
Offline Offline

Activity: 4312
Merit: 3214



View Profile
May 22, 2017, 06:46:53 PM
 #11

Thanks everyone for your responses.

Is change like this produced on every transaction? Or, more clearly, what's the trigger or criteria that will produce the change? Knowing this helps the rest us know when we need to be aware of the change and where it's being sent after a transaction.

You must send the full amounts of the inputs. If you don't actually want send all of it, the remainder must be sent somewhere. Your wallet creates a new ("change") address and sends the leftover amount to that.

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

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
May 23, 2017, 07:01:34 AM
 #12

I have found that for some people it helps to think of bitcoin as chunks of gold... your wallet is like a little mini vault, where you store all the chunks that you get.

So say you receive 1 btc, 0.1 btc and 0.01 btc... you now have 3 chunks of gold in your vault worth 1.11 in total.

Now you want to send 0.05 btc to someone. You hand your 0.1 btc chunk to the miners and tell them they can keep 0.0001 btc for their services (miners fee), they break your chunk up, making  a 0.05 chunk that they deliver to the other person, a 0.0001 chunk that they keep for themselves as the fee and then give the remaining chunk of 0.0499 btc back to you as change.

Now, your vault contains 3 chunks, 1 btc, 0.0499 btc and 0.01 btc... worth 1.0599 btc.

It is also possible to take a number of smaller chunks, give them to a miner... and they can "melt it down" producing one bigger chunk (minus their fee of course)...

Hopefully that helps a little... Wink


█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
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!