<p>I assume you want to integrate it into a P2PKH tx.
You would have to base58decode the address, and then remove the checksum and the network byte. Then you can integrate it into a P2PKH tx in the std. way:</p>
<p>76 A9 14 &lt;20 Bytes&gt; 88 AC</p>
<p>I have two references with some code examples in C and python, that helped me at the time, when I had the same question :-)</p>
<blockquote>
<p><a href="https://bitcointalk.org/index.php?topic=1543429.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=1543429.0</a></p>
<p><a href="https://bitcointalk.org/index.php?topic=1026.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=1026.0</a></p>
</blockquote>
<p>and some online &quot;play tools&quot; to verify:</p>
<blockquote>
<p><a href="http://gobittest.appspot.com/Address" rel="nofollow noreferrer">http://gobittest.appspot.com/Address</a></p>
<p><a href="http://lenschulwitz.com/base58" rel="nofollow noreferrer">http://lenschulwitz.com/base58</a></p>
</blockquote>

CC BY-SA 3.0
2017-12-19T15:54:03.163Z
2017-12-19T15:54:03.163Z
2020-06-16T11:10:03.350Z
pebwindkraft
<p>Given an address (i.e. 1BnPVV5Tt25cxbDg6DqoxJunjSL8reCGz6), how can I calculate its scriptPubKey in order to build a transaction?</p>

<transaction-input>
How to calculate scriptPubkey?
user2298995
# How to calculate scriptPubkey?

(Asked by: username_0 on 2017-12-19)

Given an address (i.e. 1BnPVV5Tt25cxbDg6DqoxJunjSL8reCGz6), how can I calculate its scriptPubKey in order to build a transaction?

**Tags:** transaction-input


---

## 1 answers

### Answer by username_1 on 2017-12-19. Score: 2 | Accepted answer

I assume you want to integrate it into a P2PKH tx.
You would have to base58decode the address, and then remove the checksum and the network byte. Then you can integrate it into a P2PKH tx in the std. way:

76 A9 14 <20 Bytes> 88 AC

I have two references with some code examples in C and python, that helped me at the time, when I had the same question :-)

> <https://bitcointalk.org/index.php?topic=1543429.0>
>
> <https://bitcointalk.org/index.php?topic=1026.0>

and some online "play tools" to verify:

> <http://gobittest.appspot.com/Address>
>
> <http://lenschulwitz.com/base58>


---

