user1969: is it possible for a Validator to ensure that the redeemer pays some Value along with a certain Datum attached to it? Looking at the possible transaction methods on the ScriptContext, checks are only done on the Value and not the Datum. I see the DatumHash types but am not sure what it is used for.

user1130: The validator can ensure that a datum or multiple datums are included in the output.
Take the Uniswap clone in the plutus-use-cases for example:
The validateCreate method ensures that an updated Factory datum
Constraints.checkOwnOutputConstraint ctx (OutputConstraint (Factory $ lp : lps) $ unitValue usCoin)

and a new Pool datum
Constraints.checkOwnOutputConstraint ctx (OutputConstraint (Pool lp liquidity) $ valueOf lpCoinA outA <> valueOf lpCoinB outB <> unitValue c)

are included in the outputs.
Both of these are attached to some Value.

1969: <p>is it possible for a Validator to ensure that the redeemer pays some Value along with a certain Datum attached to it? Looking at the possible transaction methods on the ScriptContext, checks are only done on the Value and not the Datum. I see the DatumHash types but am not sure what it is used for.<a href="https://i.stack.imgur.com/pLnX6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pLnX6.png" alt="enter image description here" /></a></p>
 1130: <p>The validator can ensure that a datum or multiple datums are included in the output.</p>
<p>Take the <a href="https://github.com/input-output-hk/plutus/blob/cfaa1438d2b391e8294fc3b8317b3768e78aa711/plutus-use-cases/src/Plutus/Contracts/Uniswap/OnChain.hs" rel="nofollow noreferrer">Uniswap clone</a> in the plutus-use-cases for example:</p>
<p>The <code>validateCreate</code> method ensures that an updated <code>Factory</code> datum</p>
<pre><code>Constraints.checkOwnOutputConstraint ctx (OutputConstraint (Factory $ lp : lps) $ unitValue usCoin)
</code></pre>
<p>and a new <code>Pool</code> datum</p>
<pre><code>Constraints.checkOwnOutputConstraint ctx (OutputConstraint (Pool lp liquidity) $ valueOf lpCoinA outA &lt;&gt; valueOf lpCoinB outB &lt;&gt; unitValue c)
</code></pre>
<p>are included in the outputs.</p>
<p>Both of these are attached to some <code>Value</code>.</p>
