user4178: I have a question about findDatum which is used in some of example contracts in Plutus Pioneer Program. According to those lectures, this method is used to get Datum from its DatumHash. I wonder if it is true that at anytime we can always get Datum from its corresponding DatumHash? For example, in the Lobster challenge, are we able to reveal ourselves the Datum from the given DatumHash? Please help me clarify this.

user2248: 
I wonder if it is true that at anytime we can always get Datum from
its corresponding DatumHash?

No, the transaction info TxInfo has an argument called txInfoData, defined as txInfoData :: [(DatumHash, Datum)]. Not necessarily your DatumHash will be inside this list, but what findDatum does, is to try to lookup the given datum hash, and if it's there, return the corresponding Datum.

For example, in the Lobster challenge, are we able to reveal ourselves
the Datum from the given DatumHash?

Yes, because the Lobster Chalange's txInfoData contains inside it's list the pair (DatumHash, Datum) corresponding to it's current data.

4178: <p>I have a question about findDatum which is used in some of example contracts in Plutus Pioneer Program. According to those lectures, this method is used to get Datum from its DatumHash. I wonder if it is true that at anytime we can always get Datum from its corresponding DatumHash? For example, in the Lobster challenge, are we able to reveal ourselves the Datum from the given DatumHash? Please help me clarify this.</p>
 2248: <blockquote>
<p>I wonder if it is true that at anytime we can always get Datum from
its corresponding DatumHash?</p>
</blockquote>
<p>No, the transaction info <a href="https://staging.plutus.iohkdev.io/doc/haddock/plutus-ledger-api/html/Plutus-V1-Ledger-Contexts.html#t:TxInfo" rel="nofollow noreferrer"><code>TxInfo</code></a> has an argument called <code>txInfoData</code>, defined as <code>txInfoData :: [(DatumHash, Datum)]</code>. Not necessarily your <code>DatumHash</code> will be inside this list, but what <code>findDatum</code> does, is to try to lookup the given datum hash, and if it's there, return the corresponding <code>Datum</code>.</p>
<blockquote>
<p>For example, in the Lobster challenge, are we able to reveal ourselves
the Datum from the given DatumHash?</p>
</blockquote>
<p>Yes, because the Lobster Chalange's <code>txInfoData</code> contains inside it's list the pair <code>(DatumHash, Datum)</code> corresponding to it's current data.</p>
