<p>That value is the hash value of an empty list. You can calculate it in the repl as follows:</p>
<pre><code>import Ledger qualified
import PlutusTx qualified

emptyListDatum = Ledger.Datum $ PlutusTx.toBuiltinData ([] :: [()])
emptyListDatumHash = Ledger.datumHash emptyListDatum -- 45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0
</code></pre>
<p>Note that the datum selected by Lars is completely arbitrary because it's not used in the validator script.</p>
<p><a href="https://i.sstatic.net/s2LRm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/s2LRm.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2022-02-09T15:10:18.960Z
That's brilliant.  Thanks @kindofdev.
Kurt Hartmann
CC BY-SA 4.0
2022-02-09T15:14:41.973Z
You’re more than welcome. Glad to help!
kindofdev
CC BY-SA 4.0
2022-02-08T23:24:40.543Z
2022-02-09T00:05:03.743Z
2022-02-09T00:05:03.743Z
kindofdev
<p>When the Alonzo era started on mainnet, Lars deployed a smart contract example, in which he minted a lobster NFT as part of a lobster naming challenge.</p>
<p>In the policy script used to mint the lobster NFT - <a href="https://github.com/input-output-hk/lobster-challenge/blob/main/src/Cardano/PlutusLobster/LobsterScript.hs#L53" rel="nofollow noreferrer">link to policy/validator code</a>, the argument inputs for the tokenName and the UTxO are baked into the compiled Plutus script, since it's a parameterized typed policy/validator. By &quot;baked in&quot; I mean the  validator code compiled to plutus already includes the token name and UTxO, so these args do not need to passed as datum when executing the transaction.</p>
<p>However, in the deploy script to mint the lobster NFT - <a href="https://github.com/input-output-hk/lobster-challenge/blob/main/scripts/lobster-mint-nft.sh#L38" rel="nofollow noreferrer">link to deploy script</a>, there is an parameter <code>tx-out-datum-hash</code> set in the <code>cardano-cli transaction build</code>.  What datum does this hashed value represent and how is the hash computed?  In Lars' example code, the value is hard-coded and no explanation is given for what it represents.</p>

<plutus-pioneer-program><smart-contract><nft><haskell><plutustx>
Understand purpose of tx-out-datum-hash in Lars' lobster NFT minting example
# Understand purpose of tx-out-datum-hash in Lars' lobster NFT minting example

(Asked by: username_0 on 2022-02-08)

When the Alonzo era started on mainnet, Lars deployed a smart contract example, in which he minted a lobster NFT as part of a lobster naming challenge.

In the policy script used to mint the lobster NFT - [link to policy/validator code](https://github.com/input-output-hk/lobster-challenge/blob/main/src/Cardano/PlutusLobster/LobsterScript.hs#L53), the argument inputs for the tokenName and the UTxO are baked into the compiled Plutus script, since it's a parameterized typed policy/validator. By "baked in" I mean the validator code compiled to plutus already includes the token name and UTxO, so these args do not need to passed as datum when executing the transaction.

However, in the deploy script to mint the lobster NFT - [link to deploy script](https://github.com/input-output-hk/lobster-challenge/blob/main/scripts/lobster-mint-nft.sh#L38), there is an parameter `tx-out-datum-hash` set in the `cardano-cli transaction build`. What datum does this hashed value represent and how is the hash computed? In Lars' example code, the value is hard-coded and no explanation is given for what it represents.

**Tags:** plutus-pioneer-program, smart-contract, nft, haskell, plutustx

---

## 1 answers

### Answer by username_1 on 2022-02-08. Score: 3 | Accepted answer

That value is the hash value of an empty list. You can calculate it in the repl as follows:
import Ledger qualified
import PlutusTx qualified

emptyListDatum = Ledger.Datum $ PlutusTx.toBuiltinData ([] :: [()])
emptyListDatumHash = Ledger.datumHash emptyListDatum -- 45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0

Note that the datum selected by Lars is completely arbitrary because it's not used in the validator script.

> **Comments:**
> **username_0**: That's brilliant.  Thanks @kindofdev.  
> **username_1**: You’re more than welcome. Glad to help!  

---

