user326: 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, 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, 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.

user6113: 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.


326: <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>
 6113: <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.stack.imgur.com/s2LRm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s2LRm.png" alt="enter image description here" /></a></p>
