<p><code>Eq</code> is a type class and hence will not work as you have used it above.</p>
<p>Assuming that <code>PubKeyHash</code> has an <code>Eq</code> typeclass instance you just need:</p>
<pre><code>    checkOwnerHashDifferent :: Bool
    checkOwnerHashDifferent =  owner1 == owner2

</code></pre>

CC BY-SA 4.0
2022-03-10T08:18:28.560Z
2022-03-10T08:18:28.560Z
Erik de Castro Lopo
<p>I'm using this script to check but this doesn't works for me</p>
<pre><code>import    Prelude  hiding (Eq)

mkPolicy :: PubKeyHash -&gt; PubKeyHash -&gt; TokenName -&gt; BuiltinData -&gt; ScriptContext -&gt; Bool
mkPolicy owner1 owner2 name _redeemer ctx = checkOwnerHashDifferent

    checkOwnerHashDifferent :: Bool
    checkOwnerHashDifferent =  Eq owner1 owner2
</code></pre>
<p>can someone help me to resolve this?</p>

<plutus><cardano-cli><haskell><minting>
How to check whether my two pubkeyHash is different or not using Haskell?
# How to check whether my two pubkeyHash is different or not using Haskell?

(Asked by: username_0 on 2022-03-10)

I'm using this script to check but this doesn't works for me
import    Prelude  hiding (Eq)

mkPolicy :: PubKeyHash -> PubKeyHash -> TokenName -> BuiltinData -> ScriptContext -> Bool
mkPolicy owner1 owner2 name _redeemer ctx = checkOwnerHashDifferent

    checkOwnerHashDifferent :: Bool
    checkOwnerHashDifferent =  Eq owner1 owner2

can someone help me to resolve this?

**Tags:** plutus, cardano-cli, haskell, minting

---

## 1 answers

### Answer by username_1 on 2022-03-10. Score: 1 | Accepted answer

Eq is a type class and hence will not work as you have used it above.
Assuming that PubKeyHash has an Eq typeclass instance you just need:
    checkOwnerHashDifferent :: Bool
    checkOwnerHashDifferent =  owner1 == owner2


---

