<p>I managed to use PubKeyHash by using parameterized smartcontract code like I have showed in another question <a href="https://cardano.stackexchange.com/a/6157/4596">here</a></p>

CC BY-SA 4.0
2022-01-07T14:27:13.757Z
It seems so strange to me that parametrizing works but not direcly :s
Alicia Basilio
CC BY-SA 4.0
2022-01-07T12:30:20.003Z
2022-01-07T12:30:20.003Z
KugisMugis
<p>I am trying to use a PubKeyHash as a variable in my on-Chain code, something like this:</p>
<pre><code>pkh :: PubKeyHash
pkh = &quot;dca6035712f164db2f99c71404d392115d2bdde366fbbe359ae01f1d&quot;
</code></pre>
<p>But this does not work, just give me a strange error when compiling  I tried to add the In-linable but that did not work either. I tried with some BuildIn constructors as well and that did not work either.</p>

<plutus><smart-contract>
How to parse PubKeyHash hash into a Plutus Smart Contract for on Chain Validation
# How to parse PubKeyHash hash into a Plutus Smart Contract for on Chain Validation

(Asked by: username_0 on 2022-01-04)

I am trying to use a PubKeyHash as a variable in my on-Chain code, something like this:
pkh :: PubKeyHash
pkh = "dca6035712f164db2f99c71404d392115d2bdde366fbbe359ae01f1d"

But this does not work, just give me a strange error when compiling  I tried to add the In-linable but that did not work either. I tried with some BuildIn constructors as well and that did not work either.

**Tags:** plutus, smart-contract

---

## 1 answers

### Answer by username_1 on 2022-01-07. Score: 1

I managed to use PubKeyHash by using parameterized smartcontract code like I have showed in another question [here](https://cardano.stackexchange.com/a/6157/4596)

> **Comments:**
> **username_0**: It seems so strange to me that parametrizing works but not direcly :s  

---

