<p>sorry can you please be more specific?</p>
<p>what exactly do you mean &quot;ist all Utxos that were consumed by my script &quot; ?</p>
<p>do you need a list of UTXOs for a specific address?
and additionally, do you need the address from the sender of this UTXOs?</p>
<p>if yes, please see below.</p>
<p>find all UTXOs</p>
<pre><code>fullUtxo=/fullUtxo.out
myAddr=addr1qljkdlgamadjnlh8xmgxln4535kj5j3lgl9mawrr99nkrt2meqa2z
cardano-cli query utxo --address $myAddr --mainnet &gt; $fullUtxo
</code></pre>
<p>find sender</p>
<pre><code>        in_addr=$(curl -H 'project_id: MainnetBlockfrostProjectNameID' https://cardano-mainnet.blockfrost.io/api/v0/txs/${tx_hash}/utxos | jq '.inputs' | jq '.[0]' | jq '.address' | sed 's/^.//;s/.$//')
</code></pre>
<p>if that helps you, would be great if you vote for my answer and give me some credits :)</p>
<p>have a nice day mate,
pool operator for TTS17</p>

CC BY-SA 4.0
2022-03-24T17:20:28.513Z
Yep, i wanted a list of UTXOs for a specific address and the address from the sender of this UTXOs.How can i also get the amount of times an address has send UTXOs to a script.
szhang9921
CC BY-SA 4.0
2022-03-24T17:58:05.857Z
i dont understand what is your goal, because either i need to sell / send something to everyone for each transaction..... or i can send back tokens to many addresses ,who sent transactions, in the same transaction i send. - - - - if you want to know "how many times " of something, you can create a txt file with one line for each transaction and then execute this commands to find the number of lines "wc -l fileName.txt"   -#-#-#-#-
TTS17
CC BY-SA 4.0
2022-03-26T00:11:19.890Z
I want to see how many times an address has send UTXOs to a script. I am going to use that value as parameters for the script. I want to create a logic like if this public address has send UTXOs to this script once before , something happens.
szhang9921
CC BY-SA 4.0
2022-03-27T09:35:59.557Z
like i said, i would add create a new file txt will all the tx you have currently "echo ${tx_in} >> $txsin" and better for your case, add tx there based on the sender....here you can see what i do, maybe related... if that helps you
TTS17
CC BY-SA 4.0
2022-03-24T01:01:18.547Z
2022-03-24T01:11:46.483Z
2022-03-24T01:11:46.483Z
TTS17
<p>How do I list all Utxos that is in my script as well as the public key addresses that it came from.I am using the result as a parameter for a different function.I want to know if a public key address has already send a transaction to this script , if they have then do something , and if they have not then do something else.</p>

CC BY-SA 4.0
2022-03-24T09:43:32.127Z
Scripts do not spend utxos, transactions do. Do you mean all outputs that belong to the script at any given time?, including or excluding current unsuspended outputs?
AngelCastillo
CC BY-SA 4.0
2022-03-26T00:12:59.440Z
Yep, like outputs that belong to the script.
szhang9921
<script-addresses><public-key>
Listing all UTXOs spend by a script as well as the public key it came from
# Listing all UTXOs spend by a script as well as the public key it came from

(Asked by: username_0 on 2022-03-23)

How do I list all Utxos that is in my script as well as the public key addresses that it came from.I am using the result as a parameter for a different function.I want to know if a public key address has already send a transaction to this script , if they have then do something , and if they have not then do something else.

**Tags:** script-addresses, public-key
> **Comments:**
> **username_1**: Scripts do not spend utxos, transactions do. Do you mean all outputs that belong to the script at any given time?, including or excluding current unsuspended outputs?  
> **username_0**: Yep, like outputs that belong to the script.  

---

## 1 answers

### Answer by username_2 on 2022-03-24. Score: 1 | Accepted answer

sorry can you please be more specific?
what exactly do you mean "ist all Utxos that were consumed by my script " ?
do you need a list of UTXOs for a specific address?
and additionally, do you need the address from the sender of this UTXOs?
if yes, please see below.
find all UTXOs
fullUtxo=/fullUtxo.out
myAddr=addr1qljkdlgamadjnlh8xmgxln4535kj5j3lgl9mawrr99nkrt2meqa2z
cardano-cli query utxo --address $myAddr --mainnet > $fullUtxo

find sender
        in_addr=$(curl -H 'project_id: MainnetBlockfrostProjectNameID' https://cardano-mainnet.blockfrost.io/api/v0/txs/${tx_hash}/utxos | jq '.inputs' | jq '.[0]' | jq '.address' | sed 's/^.//;s/.$//')

if that helps you, would be great if you vote for my answer and give me some credits :)
have a nice day mate,
pool operator for TTS17

> **Comments:**
> **username_0**: Yep, i wanted a list of UTXOs for a specific address and the address from the sender of this UTXOs.How can i also get the amount of times an address has send UTXOs to a script.  
> **username_2**: i dont understand what is your goal, because either i need to sell / send something to everyone for each transaction..... or i can send back tokens to many addresses ,who sent transactions, in the same transaction i send. - - - - if you want to know "how many times " of something, you can create a txt file with one line for each transaction and then execute this commands to find the number of lines "wc -l fileName.txt"   -#-#-#-#-  
> **username_0**: I want to see how many times an address has send UTXOs to a script. I am going to use that value as parameters for the script. I want to create a logic like if this public address has send UTXOs to this script once before , something happens.  
> **username_2**: like i said, i would add create a new file txt will all the tx you have currently "echo ${tx_in} >> $txsin" and better for your case, add tx there based on the sender....here you can see what i do, maybe related... if that helps you  

---

