<p>Try <code>validateaddress</code>, note the <code>scriptPubKey</code> in the output of these examples:</p>
<pre><code>$ bitcoin-cli validateaddress bc1q7ckr2hlws6ku4mlaggvmfqwgs42zjm4qf3s7hy
{
  &quot;isvalid&quot;: true,
  &quot;address&quot;: &quot;bc1q7ckr2hlws6ku4mlaggvmfqwgs42zjm4qf3s7hy&quot;,
  &quot;scriptPubKey&quot;: &quot;0014f62c355fee86adcaeffd4219b481c88554296ea0&quot;,
  &quot;isscript&quot;: false,
  &quot;iswitness&quot;: true,
  &quot;witness_version&quot;: 0,
  &quot;witness_program&quot;: &quot;f62c355fee86adcaeffd4219b481c88554296ea0&quot;
}

$ bitcoin-cli validateaddress 1MWrgo4rm1aoPYFjCCMXgr1e564xVyHCqM
{
  &quot;isvalid&quot;: true,
  &quot;address&quot;: &quot;1MWrgo4rm1aoPYFjCCMXgr1e564xVyHCqM&quot;,
  &quot;scriptPubKey&quot;: &quot;76a914e1080defe0aa086f1d5f698faf614e8f67af6e3b88ac&quot;,
  &quot;isscript&quot;: false,
  &quot;iswitness&quot;: false
}
</code></pre>
<p>Update: RPC <code>getaddressinfo</code> will also return the matching output script.</p>

CC BY-SA 4.0
2020-12-05T11:55:23.943Z
2020-12-24T01:42:43.157Z
2020-12-24T01:42:43.157Z
pinhead
<p>What RPC(s) can I use to transform an address to a paying script (<code>0014&lt;addr&gt;</code>)?</p>

CC BY-SA 4.0
2020-12-03T15:15:49.530Z
Hi warchantua, could you please describe a little more what you're trying to achieve? What are you starting out with, what should the final outcome look like?
Murch
<bitcoin-core><bitcoin-cli>
What RPCs can I use to transform an address to a paying script?
warchantua
# What RPCs can I use to transform an address to a paying script?

(Asked by: username_0 on 2020-12-03)

What RPC(s) can I use to transform an address to a paying script (`0014<addr>`)?

**Tags:** bitcoin-core, bitcoin-cli

> **Comments:**
> **username_1**: Hi username_0, could you please describe a little more what you're trying to achieve? What are you starting out with, what should the final outcome look like?  

---

## 1 answers

### Answer by username_2 on 2020-12-05. Score: 2 | Accepted answer

Try `validateaddress`, note the `scriptPubKey` in the output of these examples:

```
$ bitcoin-cli validateaddress bc1q7ckr2hlws6ku4mlaggvmfqwgs42zjm4qf3s7hy
{
  "isvalid": true,
  "address": "bc1q7ckr2hlws6ku4mlaggvmfqwgs42zjm4qf3s7hy",
  "scriptPubKey": "0014f62c355fee86adcaeffd4219b481c88554296ea0",
  "isscript": false,
  "iswitness": true,
  "witness_version": 0,
  "witness_program": "f62c355fee86adcaeffd4219b481c88554296ea0"
}

$ bitcoin-cli validateaddress 1MWrgo4rm1aoPYFjCCMXgr1e564xVyHCqM
{
  "isvalid": true,
  "address": "1MWrgo4rm1aoPYFjCCMXgr1e564xVyHCqM",
  "scriptPubKey": "76a914e1080defe0aa086f1d5f698faf614e8f67af6e3b88ac",
  "isscript": false,
  "iswitness": false
}

```

Update: RPC `getaddressinfo` will also return the matching output script.


---

