user1108: In the pionner program they have this logic where they filter through utxos and get a specific set of utxos.
{...}
utxos <- Map.filter (isSuitable pkh) <$> utxosAt scrAddress
{...}
where
   isSuitable :: PubKeyHash -> TxOutTx -> Bool

How can i modify this to make it so that it filters utxos that came from a specific public key address. Basically get all utxos sitting in a script address that came from a specific public key.

user5085: Assuming each UTxO at the script address has a datum that contains the PubKeyHash you can compare against, then you can use the above code like so:
data UTxODatum = UTxODatum
    { pubKey :: !PaymentPubKeyHash }

{...}
    isSuitable :: PaymentPubKeyHash -> ChainIndexTxOut -> Bool
    isSuitable pkh o = case getUTxODatum o of
        UTxODatum{pubKey=pubKey} -> pubKey == <your specific pkh>
        _                        -> traceError "Unhandled datum type"
{...}

getUTxODatum :: ChainIndexTxOut -> UTxODatum
getUTxODatum o = case _ciTxOutDatum o of
    Left _ -> traceError "unexpected datum"
    Right (Datum d) -> do
        let parsedDatum = PlutusTx.fromBuiltinData d :: Maybe UTxODatum
        case parsedDatum of
            Just s -> s
            _ -> traceError "Unknown datum type"



1108: <p>In the pionner program they have this logic where they filter through utxos and get a specific set of utxos.</p>
<pre><code>{...}
utxos &lt;- Map.filter (isSuitable pkh) &lt;$&gt; utxosAt scrAddress
{...}
where
   isSuitable :: PubKeyHash -&gt; TxOutTx -&gt; Bool
</code></pre>
<p>How can i modify this to make it so that it filters utxos that came from a specific public key address. Basically get all utxos sitting in a script address that came from a specific public key.</p>
 5085: <p>Assuming each UTxO at the script address has a datum that contains the PubKeyHash you can compare against, then you can use the above code like so:</p>
<pre><code>data UTxODatum = UTxODatum
    { pubKey :: !PaymentPubKeyHash }

{...}
    isSuitable :: PaymentPubKeyHash -&gt; ChainIndexTxOut -&gt; Bool
    isSuitable pkh o = case getUTxODatum o of
        UTxODatum{pubKey=pubKey} -&gt; pubKey == &lt;your specific pkh&gt;
        _                        -&gt; traceError &quot;Unhandled datum type&quot;
{...}

getUTxODatum :: ChainIndexTxOut -&gt; UTxODatum
getUTxODatum o = case _ciTxOutDatum o of
    Left _ -&gt; traceError &quot;unexpected datum&quot;
    Right (Datum d) -&gt; do
        let parsedDatum = PlutusTx.fromBuiltinData d :: Maybe UTxODatum
        case parsedDatum of
            Just s -&gt; s
            _ -&gt; traceError &quot;Unknown datum type&quot;

</code></pre>
