0

As per my understanding from the book "Mastering bitcoin", a transaction output contains three things

  1. Amount - Bitcoin Value in Satoshis
  2. Locking-Script-Size - Locking-Script length in bytes, to follow
  3. Locking-Script -A script defining the conditions needed to spend the output

Now let us say a transaction input points to UTXOs mentioned in one of the transaction output through transaction hash and a validation software is able satisfy the scriptPubKey(locking script) using script‐ Sig(unlocking script).

Questions regarding this case

  1. What would happen to the UTXOs mentioned in the output of parent transaction? Would it get vanished in the transaction or any change would happen?
  2. Only a valid transaction that correctly satisfies the conditions of the UTXO results in the UTXO being marked as “spent” and removed from the set of available (unspent) UTXO.

This was a statement from the book, now is there any seperate pool of UTXOs or it just meant the transaction lying at the leaf nodes of merkel tree? And what does

removed from the set of available (unspent) UTXO.

mean?

  1. Would the output of the child transaction contain the same transaction ids as the its parent'output contained?

Assume when the spender tried to see what all he can spend i.e the transactions directed to its bitcoin address then these were the transaction output which he got

[<7dbc497969c7475e45d952c4a872e213fb15d45e5cd3473c386a71a1b0c136a1:0 with 25000000 Satoshis>, \ <7f42eda67921ee92eae5f79bd37c68c9cb859b899ce70dba68c48338857b7818:0 with 16100000 Satoshis>, \ <6596fd070679de96e405d52b51b8e1d644029108ec4cbfe451454486796a1ecf:0 with 16050000 Satoshis>]

Please enlighten me if I am missing out on something.

1

I would like to first clarify a thing, before trying to answer, and it is also from the book:

unspent transaction output (UTXO) UTXO is an unspent transaction output that can be spent as an input in a new transaction.

a UTXO is not an element per se, it is a description for a set of data in a transaction. UTXO's can be spent, or unspent. For transactions to become valid, they of course can only use unspents. So when using an UTXO from a previous transaction, spending all funds to a new address and a return address, the previous UTXO becomes part of two new UTXOs. And yes, the previous UTXO is spent, documented in the blockchain, and can't be used anymore.

When it comes to adding or removing UTXOs: here it is about mempool. The list of unspent tx is kept by the bitcoin client in memory. To see, how big UTXO database is, see here. This is what you described as a separate pool. And in this sense

removed from the set of available (unspent) UTXO

simply means, that when you have sent a transaction, this particular UTXO must be removed from the mempool. I am not 100% sure, but the mempool is needed to verify, if the tx is valid or not (aka spends only valid UTXO out of the mempool). See also page 119 in the book.

Would the output of the child transaction contain the same transaction ids as the its parent'output contained?

Each tx references a previous tx, to specify from which transaction (the tx hash) and VOUT to take the funds. So a child tx would reference a parents tx inputs. However, if the child tx is then referenced by the next tx, you wouldn't see references from the parent tx.

Assuming you have (you see) these three TX_IDs and outpoints and values,

7dbc497969c7475e45d952c4a872e213fb15d45e5cd3473c386a71a1b0c136a1:0 25000000 Satoshis
7f42eda67921ee92eae5f79bd37c68c9cb859b899ce70dba68c48338857b7818:0 16100000 Satoshis
6596fd070679de96e405d52b51b8e1d644029108ec4cbfe451454486796a1ecf:0 16050000 Satoshis

the wallet software would know, these are unspent outputs, and could be asked to use these as inputs for a new transaction of ~0.57BTC to a new address.

Besides the very good book from Andreas, I also recommend Ken Shirrif's blog entry, were he explains how to manually sign a tx. That makes things very clear as well.

  • The U in UTXO stands for Unspent. A UTXO is by definition unspent. Otherwise it's just a spent output. – Pieter Wuille Jan 30 '18 at 23:41
  • Please correct me if I am wrong A transaction contains both inputs and outputs. An unspent output of a transaction becomes part of UTXO pool. Once a node receives it removes the UTXO from its pool once it gets validated and broadcasts the transaction. When other nodes also receives this transaction they do also remove corresponding UTXO from their pools. Is it? – Learner Jan 31 '18 at 13:43
  • Yes, tx contains inputs and outputs. A UTXO becomes part of the mempool. It gets removed from mempool, when it appears in a block. See also Pieter’s answer here: bitcoin.stackexchange.com/questions/46152/… – pebwindkraft Jan 31 '18 at 22:31
  • Also Murch here: bitcoin.stackexchange.com/questions/47926/… – pebwindkraft Jan 31 '18 at 22:41
  • And found a good link on UTXO here: eprint.iacr.org/2017/1095.pdf – pebwindkraft Feb 6 '18 at 14:56

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.