<p>Because the purpose of a script is to determine the conditions a UTxO can be spent.</p>
<p>If you want to deter people from creating arbitrary UTxOs at your script address, you can write the script in a way that makes those UTxOs unspendable, e.g. require the UTxO to include a specific NFT.</p>
<p>Other than that, you can't stop someone from sending their tokens to an unreachable address. Adding some validation on every UTxO being created at the address would only serve to protect people from accidentally burning their tokens--that's not really your job as the script writer. It would also increase the cost of transactions.</p>

CC BY-SA 4.0
2021-11-10T05:47:10.697Z
Would it not increase the cost of transactions for having to pick the utxos linked to the specific NFT?
lambda
CC BY-SA 4.0
2021-11-10T17:32:16.573Z
Sure. It would. But only on the relevant transactions. If you put a script that validated all incoming Txs, it would have to be run on every Tx.
Mitchell Turner
CC BY-SA 4.0
2021-11-09T19:11:37.157Z
2021-11-09T19:11:37.157Z
Mitchell Turner
<p>It is simply not feasible. The only way would be to require that the transaction includes the script that hashes to the output-address. But in the general case this script is publicly available on the blockchain in a previous transaction where a UTxO with this same script address was consumed. So you could just extract it and include it in your transaction to circumvent this restriction. The only case where this mechanism would prevent UTxOs sitting at arbitrary script addresses is the one of secret one-way scripts, and I don't see this to be meaningful use case.</p>
<p>Edit: Actually requiring to include the script that hashes to the output-address exposes the script. So this mechanism does not work either.</p>

CC BY-SA 4.0
2021-11-09T14:24:34.090Z
2021-11-09T20:03:18.747Z
2021-11-09T20:03:18.747Z
Jey
<p>It has been told that anyone can create UTXOs at any script address without restrictions since the validator does not run for transaction that do not consume UTXOs. The question is, why so?</p>
<p>I think it would have been convenient if there was mechanism to assign (if needed) some validation logic to the creation of UTXOs at a script address. It would have enabled developers to define boundaries on what can possibly sit at their script addresses and that can simplify subsequent operations with those UTXOs.</p>
<p>It's hard to imagine that the absence of such a mechanism was not a conscious decision or that its technically not feasible. I am curious to know the reasoning behind it.</p>
<p><em>Update</em>: While it is possible to filter out utxos in consuming tx, by looking at the datum associated with them, it also feels like a side effect of not being able to restrict the creation in the first place. That is the motivation for this question.</p>

<utxo><eutxo><script-addresses><validation>
Why is there no mechanism available to restrict creation of UTXOs at a script address?
# Why is there no mechanism available to restrict creation of UTXOs at a script address?

(Asked by: username_0 on 2021-11-09)

It has been told that anyone can create UTXOs at any script address without restrictions since the validator does not run for transaction that do not consume UTXOs. The question is, why so?

I think it would have been convenient if there was mechanism to assign (if needed) some validation logic to the creation of UTXOs at a script address. It would have enabled developers to define boundaries on what can possibly sit at their script addresses and that can simplify subsequent operations with those UTXOs.

It's hard to imagine that the absence of such a mechanism was not a conscious decision or that its technically not feasible. I am curious to know the reasoning behind it.

*Update*: While it is possible to filter out utxos in consuming tx, by looking at the datum associated with them, it also feels like a side effect of not being able to restrict the creation in the first place. That is the motivation for this question.

**Tags:** utxo, eutxo, script-addresses, validation

---

## 2 answers

### Answer by username_1 on 2021-11-09. Score: 1

Because the purpose of a script is to determine the conditions a UTxO can be spent.

If you want to deter people from creating arbitrary UTxOs at your script address, you can write the script in a way that makes those UTxOs unspendable, e.g. require the UTxO to include a specific NFT.

Other than that, you can't stop someone from sending their tokens to an unreachable address. Adding some validation on every UTxO being created at the address would only serve to protect people from accidentally burning their tokens--that's not really your job as the script writer. It would also increase the cost of transactions.

> **Comments:**
> **username_0**: Would it not increase the cost of transactions for having to pick the utxos linked to the specific NFT?  
> **username_1**: Sure. It would. But only on the relevant transactions. If you put a script that validated all incoming Txs, it would have to be run on every Tx.  

---

### Answer by username_2 on 2021-11-09. Score: 0

It is simply not feasible. The only way would be to require that the transaction includes the script that hashes to the output-address. But in the general case this script is publicly available on the blockchain in a previous transaction where a UTxO with this same script address was consumed. So you could just extract it and include it in your transaction to circumvent this restriction. The only case where this mechanism would prevent UTxOs sitting at arbitrary script addresses is the one of secret one-way scripts, and I don't see this to be meaningful use case.

Edit: Actually requiring to include the script that hashes to the output-address exposes the script. So this mechanism does not work either.


---

