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

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?

1 Answer 1


This is a P2PKH (Pay-to-public-key-hash) address which means a2fd2e039a86dbcf0e1a664729e09e8007f89510 is the hash of your public key. Here is a step by step guide on how to go from public key to address

  • 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. Jan 8, 2021 at 18:56
  • 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. Jan 8, 2021 at 19:21
  • I hope that this value is even the right value because at the second answer of bitcoin.stackexchange.com/questions/32628/… someone claimed that specifically this value ("a2fd2e0....") was not correct. Jan 8, 2021 at 19:25
  • if you add the base58 decode info to your answer or clarify the solution , I will accept it. Jan 8, 2021 at 20:12
  • 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. Jan 8, 2021 at 23:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.