Question about TxIx

I did some test raw transactions.
First I queried the payment.addr like so:

cardano-cli shelley query utxo --address $(cat payment.addr) --testnet-magic 42

and get the result:

                       TxHash                                 TxIx        Lovelace

7e741b4a5f7098ed5a50b9a501a7f5ff6d659457564321c757be9bffc9500da4 0 1000000000
a6e2a84de691c670ce7d869d040598135af0c243282c7ba17ab3861a750b1a3a 1 899832035

So there are 2 Transactions, with TxIx of 0 and 1.

Then after I send another Transaction, I query it again and I get:

                       TxHash                                 TxIx        Lovelace

7e741b4a5f7098ed5a50b9a501a7f5ff6d659457564321c757be9bffc9500da4 0 1000000000
80d8d92a1bcbda3289e760b3a680951c5dd4da3455edd2d149a0f120d4e4712f 1 399632035

Shouldn’t there now be 3 results? TxIx 0, TxIx 1 and TxIx 3 ?
The balance now of TxIx 1 is correct, but I don’t understand why there aren’t 3 entries?
Is this normal? if anyone can explain this to me, I’d appreciate it.

If you open you everyday wallet, and it contains a 20€ and a 10€ notes, if you decide to spend 5€ and use the 10€ note for that, you will receive one 5€ note in exchange. Your wallet now contains the initial 20 € note (your first utxo) that you haven’t touched, and a fresh 5€ note as change, that you have never seen before. > 2 notes, not 3.

1 Like

I understand that. But what are the TxIX 's for ? what is the meaning of 0 or 1?
Sorry if that sounds like a dumb question!

The TxId values are the indices of the outputs in that particular UTxO. They are zero based and start from zero for each new transaction.

thank you erik. So how would they go above zero? if they go to zero every time there is new transaction? is there a page where I can read about exactly how that works?

All transaction have one or more outputs. The outputs within a transaction are numbered 0, 1, 2, .... . This is the standard UTxO model used in Bitcoin and many other cryptos (but not Eth). A quick google search turned up this explanation: . I am sure there are many others.

1 Like

Thanks mate, I appreciate the help. And well done with Cardano.
I’m really excited to be a part of it. It’s actually really easy to use when you take a bit of time to read the docs. And it just works. Nice.
I now got my pool up and running. Found some blocks. Awesome.

1 Like