1

this is a pretty general, conceptual question. I feel I do not yet completely understand the blockchain transaction dynamics.

Let's say, we have A, B and C trading on the Blockchain:

  • A has previously transferred 10BTC to B. So B has an unspent transaction output (that it can spend) referenced by the address of A.
  • Now, B wants to pay 5BTC to C and does so by using the UTXO that it has from A's earlier transaction and routing it to C.
  • So, B forwards the UTXO with A's address to C and also gives 5BTC change to himself.

So, now, doesn't the transaction list look like this?

Inputs:

  • address_A 10BTC

Outputs:

  • address_C 5BTC
  • address_B 5BTC

Now, to me this seems correct from B's view, but it actually looks like A has transferred money to C and B, instead of B transferring money to C. I guess my understanding is wrong then, because it cant work like this. So where is my error?

From the view of C, shouldn't it look like this:

Inputs:

  • address_B 10BTC

Outputs:

  • address_C 5BTC
  • address_B 5BTC

Otherwise, also C would have again the unspent output of A and this output from A would sort of be forwarded again and again.

Don't judge me for my bad understanding please :D, if there is any good reads that you can recommend that would be great.

Thanks!

Best, JC

2

A first thing to correct is that UTXOs are not referenced by address, but by the txid that created them. The addresses are purely a human abstraction about locking conditions to help think about ownership.

So in your example what happens is that in the initial transaction tx0 created by A, B was credited with 10 BTC. Assume that transaction only had one output. That means that there is now the state of the UTXO is:

  • tx0:0 (10 BTC, spendable by B)

When B now wants to pay C, he creates a transaction tx1 with input (tx0:0, (signature by B)) which consumes the UTXO listed above, and has outputs (tx1:0, 5 BTC, (spendably by C)) and ((tx1:1, 5 BTC, (spendable by B)). Note that the tx1:0 and tx1:1 are not actually stored in the transaction here; they're implicit as the 0th and 1st output of tx1.

The state of the UTXO set is now:

  • tx1:0 (5 BTC, spendable by C)
  • tx1:1 (5 BTC, spendable by B)
1

UTXO are uniquely identified by their outpoint. An outpoint consists of the id of the transaction that created the output and the position in the output list. As transaction ids are the full transaction body's hash, they are collision resistant, and as each position in the output list can occur only once, outpoints can be expected to be unique.

E.g. the second output of this random transaction I found on a blockexplorer would be c0352a…21bf50:1. (The first output is c0352a…21bf50:0.)

Now when you want to spend a UTXO, you would reference which one exactly in an input by its outpoint. The UTXO doesn't get forwarded, but rather a transaction orders the Bitcoin network to destroy/invalidate/consume all the UTXO listed in the inputs and to create new transaction outputs as specified in the output list.

0

EDIT: I wrote this hours ago, but apparently forgot to hit the post button. There are now a couple great answers, but I'll still post this anyways.

A has previously transferred 10BTC to B. So B has an unspent transaction output (that it can spend) referenced by the address of A.

UTXOs are not 'forwarded to an address', they exist until they are used entirely as input(s) in a new transaction, and that transaction may create new UTXOs as outputs. Each transaction entirely destroys its inputs, and creates new outputs (new UTXOs). Note that even within a transaction, it may be unclear which inputs relate to which outputs.

So when A spends a UTXO to send coins to B, they will create an entirely new UTXO (that B owns) to do so. Etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.