user1165: In gift.hs, I do not understand the logic for why in the lookups for the grab contract there is Constraints.otherScript validator. The grabber is the consumer of the UTXO and thus the burden of providing the validator is on him, not the provider. It seems that the other is the provider who by definition does not have a validator.
grab :: forall w s e. AsContractError e => Contract w s e ()
grab = do
   utxos <- utxoAt scrAddress
   let orefs   = fst <$> Map.toList utxos
      lookups  = Constraints.unspentOutputs utxos      <>
                 Constraints.otherScript validator -- ###### THIS LINE #####
      tx :: TxConstraints Void Void
      tx       = mconcat [mustSpendScriptOutput oref $ Redeemer $ I 17 | oref <- orefs]
   ledgerTx <- submitTxConstraintsWith @Void lookups tx
   void $ awaitTxConfirmed $ txId ledgerTx
   logInfo @String $ "collected gifts"


user1130: 
The grabber is the consumer of the UTXO and thus the burden of providing the validator is on him, not the provider.

Correct! And I feel like this might be where your misunderstanding is.
You are right that "the burden of providing the validator" is on the grabber. The grab and give functions are called offchain to construct txs to perform those actions. So the line in question is in fact the code where the grabber "provid[es] the validator."
The Constraits are a way to declaratively specify

What kind of script and UTxOs you want to target with your tx (lookups)
What kind of tx you want to send (tx)

When we include
Constraints.otherScript validator

we are just saying that we want to target our validator with your tx. Or, it might be more accurate to say, we will need our validator in order to perform the tx.

Admittedly the name of the function as well as the documentation doesn't shed too much light on what it's doing:
-- | A script lookups value with a validator script
otherScript :: Validator -> ScriptLookups a
otherScript vl =
    let addr = Address.scriptAddress vl in
    mempty { slOtherScripts = Map.singleton addr vl }


1165: <p>In <code>gift.hs</code>, I do not understand the logic for why in the <em>lookups</em> for the <code>grab</code> contract there is <code>Constraints.otherScript validator</code>. The grabber is the consumer of the UTXO and thus the burden of providing the validator is on him, not the provider. It seems that the <em>other</em> is the provider who by definition does <strong>not</strong> have a validator.</p>
<pre><code>grab :: forall w s e. AsContractError e =&gt; Contract w s e ()
grab = do
   utxos &lt;- utxoAt scrAddress
   let orefs   = fst &lt;$&gt; Map.toList utxos
      lookups  = Constraints.unspentOutputs utxos      &lt;&gt;
                 Constraints.otherScript validator -- ###### THIS LINE #####
      tx :: TxConstraints Void Void
      tx       = mconcat [mustSpendScriptOutput oref $ Redeemer $ I 17 | oref &lt;- orefs]
   ledgerTx &lt;- submitTxConstraintsWith @Void lookups tx
   void $ awaitTxConfirmed $ txId ledgerTx
   logInfo @String $ &quot;collected gifts&quot;
</code></pre>
 1130: <blockquote>
<p>The grabber is the consumer of the UTXO and thus the burden of providing the validator is on him, not the provider.</p>
</blockquote>
<p>Correct! And I feel like this might be where your misunderstanding is.</p>
<p>You are right that &quot;the burden of providing the validator&quot; is on the grabber. The <code>grab</code> and <code>give</code> functions are called <em>offchain</em> to construct txs to perform those actions. So the line in question is in fact the code where the grabber &quot;provid[es] the validator.&quot;</p>
<p>The <code>Constraits</code> are a way to <em>declaratively</em> specify</p>
<ol>
<li>What kind of script and UTxOs you want to target with your tx (lookups)</li>
<li>What kind of tx you want to send (tx)</li>
</ol>
<p>When we include</p>
<pre><code>Constraints.otherScript validator
</code></pre>
<p>we are just saying that we want to target our <code>validator</code> with your <code>tx</code>. Or, it might be more accurate to say, we will need our <code>validator</code> in order to perform the <code>tx</code>.</p>
<hr />
<p>Admittedly the name of the function as well as the documentation doesn't shed too much light on what it's doing:</p>
<pre><code>-- | A script lookups value with a validator script
otherScript :: Validator -&gt; ScriptLookups a
otherScript vl =
    let addr = Address.scriptAddress vl in
    mempty { slOtherScripts = Map.singleton addr vl }
</code></pre>
