1

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?

user3776738
  • 113
  • 3

1 Answers1

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

Mike D
  • 3,519
  • 1
  • 8
  • 18
  • 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 Jan 08 '21 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. – user3776738 Jan 08 '21 at 19:21
  • 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 Jan 08 '21 at 19:25
  • if you add the base58 decode info to your answer or clarify the solution , I will accept it. – user3776738 Jan 08 '21 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. – user3776738 Jan 08 '21 at 23:34