# UTXO

UTXO's hash is computed by concatenating Zkopru account's public spending key, a salt, and data hash.

* Zkopru account's public spending key `S` is defined in [account](/how-it-works/account.md) part.
* Salt is a 16 bytes(128 bit) number to add some randomness.
* Data hash is a poseidon hash of Ether amount, token address (default is 0), NFT id if the note contains NFT, and the oken amount if it contains ERC20.

Zkopru protocol supports combination types of notes such as Ether and ERC20 or Ether and NFT. But, we recommend to use Ether only note, NFT only note, or ERC20 only note since the encrypted memo field does not support the combination types.

```javascript
const S = poseidon(p*G, n) // public spending key. See how-it-works/account
const salt = random16BytesSalt() // salt
const asset = poseidon(eth, tokenAddr, erc20, nft) // asset hash
const utxoHash = poseidon(S, salt, asset)
```

Please note that the erc20 field and the nft field cannot have both non-zero value at the same time.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zkopru.network/how-it-works/utxo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
