<p>I'm afraid that presenting a &quot;none&quot; datum is not possible. This also means that this UtxO is lost (anybody, correct me if I'm wrong)</p>
<p>I don't know the very reason why it is possible to send a UtxO at a script address without datum hash, while at the same time it will not be possible to get it back. Anyway, pay attention to always send a datum hash when sending some value at a script address.</p>

CC BY-SA 4.0
2022-01-10T15:15:02.740Z
I'm leaning to think that's the case as well. But haven't been able to find a definite reference yet.
Jaanus Varus
CC BY-SA 4.0
2022-01-12T16:54:01.673Z
Found a confirmation to the statement here: https://github.com/input-output-hk/Alonzo-testnet/blob/0ecd57c14570a92c2f6cd102c12b59c99a01a954/Alonzo-tutorials/Datums_redeemer_tutorial.md?plain=1#L131
Jaanus Varus
CC BY-SA 4.0
2023-03-07T17:57:30.617Z
The reason for this is that in addition to Plutus scripts, there are also native scripts (which predate Plutus), and those don't require a datum. It's impossible to know, given just an address, whether a script address corresponds to a Plutus script or to a native script. Therefore the node can't enforce that UTxO's at Plutus script addresses always have a datum attached.
Lars Brünjes
CC BY-SA 4.0
2022-01-10T14:17:30.773Z
2022-01-10T14:17:30.773Z
Jean-Sébastien Gonsette
<p>You can ignore it. You do not need to account for TxOutDatumNone in your tx-out or anywhere else. See for yourself by manually sending a TX using cli before you script it.</p>

CC BY-SA 4.0
2022-01-10T15:14:18.420Z
Do you mean not to pass the `--tx-in-datum-value` option to the `cardano-cli transaction build` command? Or did you have something else in mind?
Jaanus Varus
CC BY-SA 4.0
2022-01-10T15:34:16.030Z
Correct. It's not a required parameter, so if you aren't using it (which it doesn't sound like you are), then ignore it..?

EDIT: I see now that you say you've tried this and are getting an error which baffles me - I send hundreds of CLI transactions a day and have never seen that error come up. Are you able to provide your draft cli command TX?
Tygar Pool
CC BY-SA 4.0
2022-01-10T15:53:17.797Z
Correct that I'm not using the datum. It seems to me that either of the datum options still has to be specified because the transaction is consuming a UTxO from a Plutus script address. The full command and accompanying script can be found at: https://gist.github.com/discosultan/c03a1ea29d8b3bec8b2825c8fd879afa
Jaanus Varus
CC BY-SA 4.0
2022-01-10T14:49:12.763Z
2022-01-10T14:49:12.763Z
Tygar Pool
<p>Usually when you want to pass empty datum to the script you'd pass an empty list like so</p>
<pre><code>--tx-in-datum-value []
</code></pre>

CC BY-SA 4.0
2022-01-10T15:10:25.867Z
This gives me a similar error as passing `0`: Command failed: transaction build  Error: The following scripts have execution failures:
the script for transaction input 0 (in the order of the TxIds) failed with:
The Plutus script witness for the txin does not have a script datum (according to the UTxO). The txin in question is 10668bed901733bb0977ec72d1abad481865b34ea1c18302caaaa1eafe5784d2#1
Jaanus Varus
CC BY-SA 4.0
2022-01-10T14:41:57.310Z
2022-01-10T14:41:57.310Z
pyropy
<p>I'm trying to consume a UTxO from a <em>script address</em>. When querying the script address with <code>cardano-cli query utxo</code>, I have the following UTxO:</p>
<pre><code>                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
10668bed901733bb0977ec72d1abad481865b34ea1c18302caaaa1eafe5784d2     1        1344798 lovelace + TxOutDatumNone
</code></pre>
<p>However, when constructing a transaction, I do not know how to represent <code>TxOutDatumNone</code>:</p>
<pre><code>cardano-cli transaction build \
--alonzo-era \
...
--tx-in 10668bed901733bb0977ec72d1abad481865b34ea1c18302caaaa1eafe5784d2#1 \
--tx-in-datum-value WHAT_TO_PUT_HERE \
...
</code></pre>
<hr />
<p>What I've tried:</p>
<ul>
<li>Not passing the <code>--tx-in-datum-value</code> altogether results in:</li>
</ul>
<blockquote>
<p>Missing: (--tx-in-datum-file FILE | --tx-in-datum-value JSON VALUE)</p>
</blockquote>
<ul>
<li>Passing <code>--tx-in-datum-value 0</code> results in:</li>
</ul>
<blockquote>
<p>Command failed: transaction build  Error: The following scripts have execution failures:
the script for transaction input 0 (in the order of the TxIds) failed with:
The Plutus script witness for the txin does not have a script datum (according to the UTxO). The txin in question is 10668bed901733bb0977ec72d1abad481865b34ea1c18302caaaa1eafe5784d2#1</p>
</blockquote>
<ul>
<li>Passing <code>--tx-in-datum-value null</code> results in:</li>
</ul>
<blockquote>
<p>option --tx-in-datum-value: JSON schema error within the script data: null
JSON null values are not supported.</p>
</blockquote>

<smart-contract><cardano-cli><transaction><datum>
How to pass TxOutDatumNone when building a script transaction with cardano-cli
# How to pass TxOutDatumNone when building a script transaction with cardano-cli

(Asked by: username_0 on 2022-01-10)

I'm trying to consume a UTxO from a script address. When querying the script address with cardano-cli query utxo, I have the following UTxO:
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
10668bed901733bb0977ec72d1abad481865b34ea1c18302caaaa1eafe5784d2     1        1344798 lovelace + TxOutDatumNone

However, when constructing a transaction, I do not know how to represent TxOutDatumNone:
cardano-cli transaction build \
--alonzo-era \
...
--tx-in 10668bed901733bb0977ec72d1abad481865b34ea1c18302caaaa1eafe5784d2#1 \
--tx-in-datum-value WHAT_TO_PUT_HERE \
...


What I've tried:

Not passing the --tx-in-datum-value altogether results in:


Missing: (--tx-in-datum-file FILE | --tx-in-datum-value JSON VALUE)


Passing --tx-in-datum-value 0 results in:


Command failed: transaction build  Error: The following scripts have execution failures:
the script for transaction input 0 (in the order of the TxIds) failed with:
The Plutus script witness for the txin does not have a script datum (according to the UTxO). The txin in question is 10668bed901733bb0977ec72d1abad481865b34ea1c18302caaaa1eafe5784d2#1


Passing --tx-in-datum-value null results in:


option --tx-in-datum-value: JSON schema error within the script data: null
JSON null values are not supported.

**Tags:** smart-contract, cardano-cli, transaction, datum

---

## 3 answers

### Answer by username_1 on 2022-01-10. Score: 3 | Accepted answer

I'm afraid that presenting a "none" datum is not possible. This also means that this UtxO is lost (anybody, correct me if I'm wrong)

I don't know the very reason why it is possible to send a UtxO at a script address without datum hash, while at the same time it will not be possible to get it back. Anyway, pay attention to always send a datum hash when sending some value at a script address.

> **Comments:**
> **username_0**: I'm leaning to think that's the case as well. But haven't been able to find a definite reference yet.  
> **username_0**: Found a confirmation to the statement here: https://github.com/input-output-hk/Alonzo-testnet/blob/0ecd57c14570a92c2f6cd102c12b59c99a01a954/Alonzo-tutorials/Datums_redeemer_tutorial.md?plain=1#L131  
> **username_2**: The reason for this is that in addition to Plutus scripts, there are also native scripts (which predate Plutus), and those don't require a datum. It's impossible to know, given just an address, whether a script address corresponds to a Plutus script or to a native script. Therefore the node can't enforce that UTxO's at Plutus script addresses always have a datum attached.  

---

### Answer by username_3 on 2022-01-10. Score: 0

You can ignore it. You do not need to account for TxOutDatumNone in your tx-out or anywhere else. See for yourself by manually sending a TX using cli before you script it.

> **Comments:**
> **username_0**: Do you mean not to pass the `--tx-in-datum-value` option to the `cardano-cli transaction build` command? Or did you have something else in mind?  
> **username_3**: Correct. It's not a required parameter, so if you aren't using it (which it doesn't sound like you are), then ignore it..?  EDIT: I see now that you say you've tried this and are getting an error which baffles me - I send hundreds of CLI transactions a day and have never seen that error come up. Are you able to provide your draft cli command TX?  
> **username_0**: Correct that I'm not using the datum. It seems to me that either of the datum options still has to be specified because the transaction is consuming a UTxO from a Plutus script address. The full command and accompanying script can be found at: https://gist.github.com/discosultan/c03a1ea29d8b3bec8b2825c8fd879afa  

---

### Answer by username_4 on 2022-01-10. Score: 0

Usually when you want to pass empty datum to the script you'd pass an empty list like so
--tx-in-datum-value []

> **Comments:**
> **username_0**: This gives me a similar error as passing `0`: Command failed: transaction build  Error: The following scripts have execution failures: the script for transaction input 0 (in the order of the TxIds) failed with: The Plutus script witness for the txin does not have a script datum (according to the UTxO). The txin in question is 10668bed901733bb0977ec72d1abad481865b34ea1c18302caaaa1eafe5784d2#1  

---

