<p>You should use <code>ownPaymentPubKeyHash</code> here is <a href="https://github.com/input-output-hk/plutus-apps/blob/5ffdb6362b9ba3e7095beccde56df0280abf12d0/plutus-contract/src/Plutus/Contract/Request.hs#L769" rel="nofollow noreferrer">the source code</a>.</p>
<p>It will work by just replacing <code>ownPubKeyHash</code> with <code>ownPaymentPubKeyHash</code> and return type <code>PubKeyHash</code> to <code>PaymentPubKeyHash</code>.</p>

CC BY-SA 4.0
2022-01-22T13:13:06.740Z
Here is: [How to reference material written by others](https://cardano.stackexchange.com/help/referencing)
gRebel
CC BY-SA 4.0
2022-01-22T09:02:22.813Z
2022-01-22T21:58:27.333Z
2022-01-22T21:58:27.333Z
zarej
<p>Interesting, I haven't found one either. If you need the PubKey to compute the hash you can use <code>ownPaymentPubKeyHash</code></p>

CC BY-SA 4.0
2022-01-22T09:06:38.773Z
2022-01-22T14:27:04.983Z
2022-01-22T14:27:04.983Z
Jey
<p>In lesson 5 that they use a built in function called <code>ownPubKey</code> to access the wallet pubKey in the transaction on the plutus playground.</p>
<p>This function seems to be non-existent in the newer versions of plutus what is a good replacement for this?</p>

<plutus><plutus-pioneer-program>
What's the equivalent to ownPubKey in the newer version of Plutus?
# What's the equivalent to ownPubKey in the newer version of Plutus?

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

In lesson 5 that they use a built in function called `ownPubKey` to access the wallet pubKey in the transaction on the plutus playground.

This function seems to be non-existent in the newer versions of plutus what is a good replacement for this?

**Tags:** plutus, plutus-pioneer-program

---

## 2 answers

### Answer by username_1 on 2022-01-22. Score: 2

You should use `ownPaymentPubKeyHash` here is [the source code](https://github.com/input-output-hk/plutus-apps/blob/5ffdb6362b9ba3e7095beccde56df0280abf12d0/plutus-contract/src/Plutus/Contract/Request.hs#L769).

It will work by just replacing `ownPubKeyHash` with `ownPaymentPubKeyHash` and return type `PubKeyHash` to `PaymentPubKeyHash`.

> **Comments:**
> **username_2**: Here is: [How to reference material written by others](https://cardano.stackexchange.com/help/referencing)  

---

### Answer by username_3 on 2022-01-22. Score: 1

Interesting, I haven't found one either. If you need the PubKey to compute the hash you can use `ownPaymentPubKeyHash`


---

