<p>This is a P2PKH (Pay-to-public-key-hash) address which means <code>a2fd2e039a86dbcf0e1a664729e09e8007f89510</code> is the hash of your public key. <a href="https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses" rel="nofollow noreferrer">Here</a> is a step by step guide on how to go from public key to address</p>

CC BY-SA 4.0
2021-01-08T18:56:08.293Z
Thanks for clarification. But as I understand there is no way, how I get a P2PKH out of a bitcoin address. Because the bitcoin address (not the public key) is the only information I get from the receiver, I still can not see how I would get the P2PKH.
user3776738
CC BY-SA 4.0
2021-01-08T19:21:17.243Z
Hmm, it looks like I just have to base58 decode the btc adress which results in "00a2fd2e039a86dbcf0e1a664729e09e8007f89510c5214deb", don't know what the numbers before and after stand for but I can work with that.
user3776738
CC BY-SA 4.0
2021-01-08T19:25:02.483Z
I hope that this value is even the right value because at the second answer of https://bitcoin.stackexchange.com/questions/32628/redeeming-a-raw-transaction-step-by-step-example-required someone claimed that specifically this value ("a2fd2e0....") was not correct.
user3776738
CC BY-SA 4.0
2021-01-08T20:12:41.923Z
if you add the base58 decode info to your answer or clarify the solution , I will accept it.
user3776738
CC BY-SA 4.0
2021-01-08T23:34:16.597Z
So, I know have fully understand why there was another value than the "a2fd2e0....". The second responder just used another target address for the transaction. So base58 decoding is the solution.
user3776738
CC BY-SA 4.0
2021-01-08T18:31:43.673Z
2021-01-08T18:31:43.673Z
Mike D
<p>When I mean output script I mean the output script from step 11 from this question:</p>
<p><a href="https://bitcoin.stackexchange.com/questions/32628/redeeming-a-raw-transaction-step-by-step-example-required">Redeeming a raw transaction step by step example required</a></p>
<blockquote>
<p>Then the actual output script: 76 a9 14 a2fd2e039a86dbcf0e1a664729e09e8007f89510 88 ac ( this is transferring funds back to address 1FromKBPAS8MWsk1Yv1Yiu8rJbjfVioBHc )</p>
</blockquote>
<p>In this example the responder used Pkscript from the input of the previous trasaction. However there is no explanation how the hex &quot;a2fd2e039a86dbcf0e1a664729e09e8007f89510&quot; is generated itself. I'm asking because, I don't know what I would insert if I want to use another address as output. As I understand (maybe not) this hex is somehow generated from the bitcoin address &quot;1FromKBPAS8MWsk1Yv1Yiu8rJbjfVioBHc&quot;. Is this correct? And how is it done?</p>

<transactions><raw-transaction><raw-data><p2pkh>
Ho do I generate the output script of a bitcoin transaction?
user3776738
# Ho do I generate the output script of a bitcoin transaction?

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

When I mean output script I mean the output script from step 11 from this question:

[Redeeming a raw transaction step by step example required](https://bitcoin.stackexchange.com/questions/32628/redeeming-a-raw-transaction-step-by-step-example-required)

> Then the actual output script: 76 a9 14 a2fd2e039a86dbcf0e1a664729e09e8007f89510 88 ac ( this is transferring funds back to address 1FromKBPAS8MWsk1Yv1Yiu8rJbjfVioBHc )

In this example the responder used Pkscript from the input of the previous trasaction. However there is no explanation how the hex "a2fd2e039a86dbcf0e1a664729e09e8007f89510" is generated itself. I'm asking because, I don't know what I would insert if I want to use another address as output. As I understand (maybe not) this hex is somehow generated from the bitcoin address "1FromKBPAS8MWsk1Yv1Yiu8rJbjfVioBHc". Is this correct? And how is it done?

**Tags:** transactions, raw-transaction, raw-data, p2pkh


---

## 1 answers

### Answer by username_1 on 2021-01-08. Score: 1 | Accepted answer

This is a P2PKH (Pay-to-public-key-hash) address which means `a2fd2e039a86dbcf0e1a664729e09e8007f89510` is the hash of your public key. [Here](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses) is a step by step guide on how to go from public key to address

> **Comments:**
> **username_0**: Thanks for clarification. But as I understand there is no way, how I get a P2PKH out of a bitcoin address. Because the bitcoin address (not the public key) is the only information I get from the receiver, I still can not see how I would get the P2PKH.  
> **username_0**: Hmm, it looks like I just have to base58 decode the btc adress which results in "00a2fd2e039a86dbcf0e1a664729e09e8007f89510c5214deb", don't know what the numbers before and after stand for but I can work with that.  
> **username_0**: I hope that this value is even the right value because at the second answer of https://bitcoin.stackexchange.com/questions/32628/redeeming-a-raw-transaction-step-by-step-example-required someone claimed that specifically this value ("a2fd2e0....") was not correct.  
> **username_0**: if you add the base58 decode info to your answer or clarify the solution , I will accept it.  
> **username_0**: So, I know have fully understand why there was another value than the "a2fd2e0....". The second responder just used another target address for the transaction. So base58 decoding is the solution.  

---

