<p>This is a simple newtype <a href="https://playground.plutus.iohkdev.io/doc/haddock/plutus-ledger/html/Ledger-Address.html#t:PaymentPubKey" rel="nofollow noreferrer">https://playground.plutus.iohkdev.io/doc/haddock/plutus-ledger/html/Ledger-Address.html#t:PaymentPubKey</a></p>
<p>you can import <code>Ledger.Address</code> and convert it with something like <code>PaymentPubKeyHash myPubKeyHash</code>, you can convert in the opposite direction with <code>unPaymentPubKeyHash</code></p>

CC BY-SA 4.0
2022-02-04T02:22:23.030Z
thanks a ton it worked I've been trying to figure that out for days
Floof99
CC BY-SA 4.0
2022-02-03T17:00:49.057Z
2022-02-03T17:00:49.057Z
Ben
<p>Im reading through old Plutus code and it seems to be that you could use in the past
pubKeyHash with the mustPayToPubKey function now it asks for a PaymentPubKeyHash. How do you get around this if you want to send a value to an owners paymentPubKeyHash from a plutus script considering that there is no byte string implementation of a PaymentPubKeyHash?</p>
<p>I cant use PubKeyHash anymore in the mustPayToPubKey is there a way to convert this format?</p>

CC BY-SA 4.0
2022-02-03T09:26:25.847Z
you can get own PymentPubKeyHash with `ownPaymentPubKeyHash` inside Contract.  Or that is not your case?
Mikhail Lazarev
CC BY-SA 4.0
2022-02-04T02:21:16.510Z
no its not I had previously manually typed in a pubKeyHash as a data type to reference the owners pubKeyHash
Floof99
<plutus>
How to make a PubKeyHash into a PaymentPubKeyHash
# How to make a PubKeyHash into a PaymentPubKeyHash

(Asked by: username_0 on 2022-02-02)

Im reading through old Plutus code and it seems to be that you could use in the past
pubKeyHash with the mustPayToPubKey function now it asks for a PaymentPubKeyHash. How do you get around this if you want to send a value to an owners paymentPubKeyHash from a plutus script considering that there is no byte string implementation of a PaymentPubKeyHash?

I cant use PubKeyHash anymore in the mustPayToPubKey is there a way to convert this format?

**Tags:** plutus
> **Comments:**
> **username_1**: you can get own PymentPubKeyHash with `ownPaymentPubKeyHash` inside Contract.  Or that is not your case?  
> **username_0**: no its not I had previously manually typed in a pubKeyHash as a data type to reference the owners pubKeyHash  

---

## 1 answers

### Answer by username_2 on 2022-02-03. Score: 4 | Accepted answer

This is a simple newtype <https://playground.plutus.iohkdev.io/doc/haddock/plutus-ledger/html/Ledger-Address.html#t:PaymentPubKey>

you can import `Ledger.Address` and convert it with something like `PaymentPubKeyHash myPubKeyHash`, you can convert in the opposite direction with `unPaymentPubKeyHash`

> **Comments:**
> **username_0**: thanks a ton it worked I've been trying to figure that out for days  

---

