Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: bolfio on December 02, 2018, 08:31:00 PM



Title: Expaining bitcoin transaction: When does Alice posses the fund?
Post by: bolfio on December 02, 2018, 08:31:00 PM
I have a question. I know that a transaction consists of an input and an output, whereas an unspent transaction output (UTXO) is equivalent to an amount someone holds. Clearly, every output contains a locking script, whereas each input contains a corresponding unlocking script.

My question is the following: We consider the following picture (unfortuatley, [img]http://doesn't work...


https://freedomnode.com/uploads/images/ad1f3d1790b9f1f7764fbc72f2337b6c44cd5adfba10324a9a8a65e5b6b09125.png

The picture shows that Bob spends 0.5 BTC to Alice. This is quite clear. He signs the transaction. But now this is what I don't understand: When do the 0.5 BTC appear in Alices wallet? Does she now posses the Output of transaction A? Because this is an unspent output. Only when she wants to pay her employee, she unlocks this output, such that the input of transaction B consumes the output of transaction A. Then, her empoyee "holds" the output of transaction B.

Is this the correct way? In my understanding, an input only consumes a previous output, when someone wants to make a subsequent transaction. This is why this picture irritates me a little, because it says "Alice receives"... But isn't she already the owner of the output, before the input of transaction B consumes the output of transaction A?

So, in my optionen: Alice won't unlock the 0.5 BTC in order to possess them, but in order to spend them.

I hope someone can explain me......


Title: Re: Expaining bitcoin transaction: When does Alice posses the fund?
Post by: hubballi on December 02, 2018, 09:35:56 PM
I dont know much technically but in simple way, when A sells to B and when the transaction gets confirmed, it automatically moves the funds from A account to B account.

Until the transaction is not confirmed the funds are holded in between the A and B transaction data.

Once A  sends the funds it will be moved from his account and gets stuck in transaction and until it is not confirmed in B account it will be lying their. So now nor A or B can use that funds until it is not confirmed or rejected.


Title: Re: Expaining bitcoin transaction: When does Alice posses the fund?
Post by: achow101 on December 02, 2018, 11:21:46 PM
When do the 0.5 BTC appear in Alices wallet?
It depends on the wallet software. Typically wallet software will show the BTC as appeared in her wallet as soon as the transaction is received by that wallet. It will be unconfirmed at that point, so it is potientially unsafe to spend the outputs in that transaction.

Does she now posses the Output of transaction A? Because this is an unspent output. Only when she wants to pay her employee, she unlocks this output, such that the input of transaction B consumes the output of transaction A. Then, her empoyee "holds" the output of transaction B.

Is this the correct way? In my understanding, an input only consumes a previous output, when someone wants to make a subsequent transaction. This is why this picture irritates me a little, because it says "Alice receives"... But isn't she already the owner of the output, before the input of transaction B consumes the output of transaction A?

So, in my optionen: Alice won't unlock the 0.5 BTC in order to possess them, but in order to spend them.
Yes, that is correct. Alice does not have to do anything in order to receive the Bitcoin. Once Bob has created an unspent output that Alice can spend, she can say that she has received the Bitcoin.

Of course, there is a caveat to this. Bob can't just make any output script that he wants that Alice can spend. There are a lot of output scripts that Alice could theoretically unlock and spent as an input in another transaction. However Alice is not tracking all of those things. Rather she has a specific set of output scripts that she can spend and she gives out addresses that correspond to those scripts. In order for Alice to consider Bob to have paid her, he needs to make an output with a script that corresponds to the address Alice gave him, otherwise Alice will not consider that transaction to be hers.


Title: Re: Expaining bitcoin transaction: When does Alice posses the fund?
Post by: bolfio on December 03, 2018, 03:36:31 AM
...

Wow, fantastic explanation. Now it's clear. Thank you very much!


Title: Re: Expaining bitcoin transaction: When does Alice posses the fund?
Post by: odolvlobo on December 03, 2018, 05:18:29 PM
...
Is this the correct way? In my understanding, an input only consumes a previous output, when someone wants to make a subsequent transaction. This is why this picture irritates me a little, because it says "Alice receives"... But isn't she already the owner of the output, before the input of transaction B consumes the output of transaction A?

So, in my optionen: Alice won't unlock the 0.5 BTC in order to possess them, but in order to spend them.

I hope someone can explain me......

Yes. It is more accurate to say that you receive or possess the ability to use bitcoins, rather than saying that you receive or possess the bitcoins themselves, though they are effectively the same.