---
title: "Comment by Eldar Ahmadov on \"Simulating UTXOs on Algorand\" | Hashnode"
description: "Heard about UTXOs few times, never really bothered to understand what they are, thanks for a clear explanation, Alex. Basically, they're somewhat similar to dou"
url: "https://hashnode.com/posts/simulating-utxos-on-algorand/6623750748b70965dd2b5778/comment/6623a1b384e1bf95d4c565b6"
---

[Discussion](https://hashnode.com/posts/simulating-utxos-on-algorand/6623750748b70965dd2b5778)

Comment [Simulating UTXOs on Algorand](https://hashnode.com/posts/simulating-utxos-on-algorand/6623750748b70965dd2b5778)

[Eldar Ahmadov](https://hashnode.com/@EldarAhmadov)

[Apr 20, 2024](https://hashnode.com/posts/simulating-utxos-on-algorand/6623750748b70965dd2b5778/comment/6623a1b384e1bf95d4c565b6)

Heard about UTXOs few times, never really bothered to understand what they are, thanks for a clear explanation, Alex. Basically, they're somewhat similar to double entry in bookkeeping.

As usual, got a question regarding the example (can't help it ) :))

How would an account get hold of output Utxos, assuming the account wants to spend it later? \_mint\_utxo returns an asset\_id, but in process\_transaction method, those newly minted asset ids are not returned?

[Alexander Codes](https://hashnode.com/@alexandercodes)

[Apr 20, 2024](https://hashnode.com/posts/simulating-utxos-on-algorand/6623750748b70965dd2b5778/comment/6623a1b384e1bf95d4c565b6#reply-6623ac7877398f089371a399)

No worries, I enjoy your feedback and questions!

The asset ID is returned from the convert\_algo\_to\_utxo method mainly as a convenience for testing.

You can check which assets an account owns any time off chain using the Algod API.

For any asset other than Algo, an account has to opt in to receive it. The only exception is for assets created by the account. There's no opt-in method in the contract, so it's impossible for anyone to send any other assets to it. So you can be certain that every asset owned by the contract was created by the contract, and is therefore a UTXO :)

This is kind of similar to how Cardano works - it is the job of off chain code (wallets/dapps) to use the indexer to find suitable UTXOs to use for inputs, and to propose the transaction outputs.

The network only validates that the UTXOs can be spent (checking signatures) and validates that the input and output amounts match.

[Eldar Ahmadov](https://hashnode.com/@EldarAhmadov)

[Apr 20, 2024](https://hashnode.com/posts/simulating-utxos-on-algorand/6623750748b70965dd2b5778/comment/6623a1b384e1bf95d4c565b6#reply-66241ff09e72b9789ba785e3)

Ok, understood, thank you.

One more (quick) question if I may:

```
tx_out = tx_outs[i].copy()
```

Why the `.copy()`?

[Alexander Codes](https://hashnode.com/@alexandercodes)

[Alexander Codes](https://hashnode.com/@alexandercodes)

[Apr 20, 2024](https://hashnode.com/posts/simulating-utxos-on-algorand/6623750748b70965dd2b5778/comment/6623a1b384e1bf95d4c565b6#reply-66243ef068bea2eeb380f4b9)

[Eldar Ahmadov](https://hashnode.com/@EldarAhmadov) Good question... I added that because the compiler told me to!

I think it's because ARC-4 dynamic arrays and structs are mutable.

For immutable types like UInt64, String etc. you can assign the value to a new variable and it returns a new value.

Whereas for the mutable types, it would be like creating another reference to the same object, which I don't think the compiler allows.

In Python, if you run:

a = \[1, 2, 3\]

b = a

b.pop()

print(a, b)

the output is `[1, 2] [1, 2]`

because b is a reference to the same object as a.

I'm not 100% sure though - hopefully that's covered in more detail in future documentation.

[Alexander Codes](https://hashnode.com/@alexandercodes)

[Apr 20, 2024](https://hashnode.com/posts/simulating-utxos-on-algorand/6623750748b70965dd2b5778/comment/6623a1b384e1bf95d4c565b6#reply-66243f5d68bea2eeb380f4c4)

[Alexander Codes](https://hashnode.com/@alexandercodes) Just to complete the Python example:

a = \[1, 2, 3\]

b = a.copy()

b.pop()

print(a, b)

\[1, 2, 3\] \[1, 2\]

[Eldar Ahmadov](https://hashnode.com/@EldarAhmadov)

[Apr 21, 2024](https://hashnode.com/posts/simulating-utxos-on-algorand/6623750748b70965dd2b5778/comment/6623a1b384e1bf95d4c565b6#reply-6624d41c45769a711b7b5580)

Ok, understood, although it's a bit strange, since you're not mutating `tx_out` in this case. Anyway, massive thanks again, and looking forward to the next one! I'm learning a lot from these!

[Alexander Codes](https://hashnode.com/@alexandercodes)

[Alexander Codes](https://hashnode.com/@alexandercodes)

[Apr 21, 2024](https://hashnode.com/posts/simulating-utxos-on-algorand/6623750748b70965dd2b5778/comment/6623a1b384e1bf95d4c565b6#reply-6624f91e6de2232e1f3ff775)

[Eldar Ahmadov](https://hashnode.com/@EldarAhmadov) Agreed, and it's also a bit weird that you can't iterate over a mutable data structure directly.

I would imagine that might change in future releases.

In any case... I do what the compiler tells me to do :D

[Eldar Ahmadov](https://hashnode.com/@EldarAhmadov)

[Apr 21, 2024](https://hashnode.com/posts/simulating-utxos-on-algorand/6623750748b70965dd2b5778/comment/6623a1b384e1bf95d4c565b6#reply-6624fb419d35ae7088fd9669)

We all do :) Although sometimes I feel like the compiler ignores my comments :)))

[Alexander Codes](https://hashnode.com/@alexandercodes)
