<p>To pay to a full address, you can use <code>mustPayToPubKeyAddress pkh skh v</code></p>
<p>This is not using the bech32 format though. You still need to decode the bech32 string into the public key hash (pkh) and the stake key hash (skh).</p>

CC BY-SA 4.0
2022-02-17T08:45:12.107Z
2022-02-17T08:45:12.107Z
Jey
<p>It's the mustPayToPubKey fn. It takes the <strong>hash</strong> of the public key of the wallet.
From the validator fn:</p>
<pre><code>let tx = mustPayToPubKey (ppRecipient pp) $ lovelaceValueOf $ ppLovelace pp 
</code></pre>
<p>where pp is constructed in the off chain code like this (note the use of pubKeyHash fn):</p>
<pre><code>payTrace :: Integer -&gt; Integer -&gt; EmulatorTrace ()
payTrace x y = do
    h1 &lt;- activateContractWallet (Wallet 1) payContractOfficialSolution
    s0 &lt;- Emulator.waitNSlots 1
    Extras.logInfo $ &quot;reached slot &quot; ++ show s0
    callEndpoint @&quot;pay&quot; h1 $ PayParams
        { ppRecipient = pubKeyHash $ walletPubKey $ Wallet 2
          , ppLovelace      = x
        }
...
</code></pre>
<p>This is all from the week04 of the Plutus Pioneer Program iteration 1.</p>

CC BY-SA 4.0
2022-01-18T05:31:06.480Z
2022-01-18T05:31:06.480Z
marcel_g
<p>In Plutus, <code>Ledger.Constraints</code> has the following Constraints</p>
<p><code>mustPayToOtherScript</code>,
<code>mustPayToPubKey</code>,
<code>mustPayToTheScript</code>,</p>
<p>Is there a similar constraint that can used send funds to a payment address in Daedalus or Yoroi wallets, using <code>Plutus</code>?
None of the above there constraints deal with payment addresses the way I understand.</p>

CC BY-SA 4.0
2022-04-28T05:31:25.007Z
Should one of the answers be marked as accepted?
gRebel
<plutus><transaction><payment>
How to make payment to a payment address using Plutus?
# How to make payment to a payment address using Plutus?

(Asked by: username_0 on 2021-09-01)

In Plutus, `Ledger.Constraints` has the following Constraints

`mustPayToOtherScript`,
`mustPayToPubKey`,
`mustPayToTheScript`,

Is there a similar constraint that can used send funds to a payment address in Daedalus or Yoroi wallets, using `Plutus`?
None of the above there constraints deal with payment addresses the way I understand.

**Tags:** plutus, transaction, payment
> **Comments:**
> **username_1**: Should one of the answers be marked as accepted?  

---

## 2 answers

### Answer by username_2 on 2022-02-17. Score: 1

To pay to a full address, you can use `mustPayToPubKeyAddress pkh skh v`

This is not using the bech32 format though. You still need to decode the bech32 string into the public key hash (pkh) and the stake key hash (skh).


---

### Answer by username_3 on 2022-01-18. Score: 0

It's the mustPayToPubKey fn. It takes the hash of the public key of the wallet.
From the validator fn:
let tx = mustPayToPubKey (ppRecipient pp) $ lovelaceValueOf $ ppLovelace pp 

where pp is constructed in the off chain code like this (note the use of pubKeyHash fn):
payTrace :: Integer -> Integer -> EmulatorTrace ()
payTrace x y = do
    h1 <- activateContractWallet (Wallet 1) payContractOfficialSolution
    s0 <- Emulator.waitNSlots 1
    Extras.logInfo $ "reached slot " ++ show s0
    callEndpoint @"pay" h1 $ PayParams
        { ppRecipient = pubKeyHash $ walletPubKey $ Wallet 2
          , ppLovelace      = x
        }
...

This is all from the week04 of the Plutus Pioneer Program iteration 1.


---

