Author

Topic: P2PKH hex to address (Read 137 times)

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
May 20, 2021, 01:44:27 AM
#4
I encountered an address that could not be converted during the process of transcoding the p2pkh address,Below is the transaction tx hash

Quote
4f1433d6433d3ce8a877519ba9ddc310dbee96dba939aca0dbef0176a3563436

I get the content of scriptpubkey hex
Quote
b'0804678afd04678afd75a820894eeb82f9a851f5d1cb1be3249f58bc8d259963832c5e7474a76f7 a859ee95c87'
-snip-
The input that you're looking at isn't P2PKH thus, shouldn't be converted into an address, it's a non-standard script which translates into:
Code:
OP_PUSHBYTES_8 04678afd04678afd OP_DROP OP_SHA256 OP_PUSHBYTES_32 894eeb82f9a851f5d1cb1be3249f58bc8d259963832c5e7474a76f7a859ee95c OP_EQUAL

I believe it's the output of the mentioned txn in this thread: https://bitcointalksearch.org/topic/m.625507
Thread has some guesses on how to spend it.
legendary
Activity: 4438
Merit: 3387
May 20, 2021, 01:30:33 AM
#3
There is no address. It is a non-standard script:
Code:
04678afd04678afd
OP_DROP
OP_SHA256
894eeb82f9a851f5d1cb1be3249f58bc8d259963832c5e7474a76f7a859ee95c
OP_EQUAL
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
May 20, 2021, 12:40:54 AM
#2
The scriptPubKey will not contain the public key itself, only the public key hash (after bytes "76a9"). The actual public key is at the end of scriptSig.
jr. member
Activity: 34
Merit: 6
May 20, 2021, 12:00:17 AM
#1
I encountered an address that could not be converted during the process of transcoding the p2pkh address,Below is the transaction tx hash

Quote
4f1433d6433d3ce8a877519ba9ddc310dbee96dba939aca0dbef0176a3563436

I get the content of scriptpubkey hex
Quote
b'0804678afd04678afd75a820894eeb82f9a851f5d1cb1be3249f58bc8d259963832c5e7474a76f7 a859ee95c87'

Get the byte array of this hex

Quote
b'\x08\x04g\x8a\xfd\x04g\x8a\xfdu\xa8 \x89N\xeb\x82\xf9\xa8Q\xf5\xd1\xcb\x1b\xe3$\x9fX\xbc\x8d%\x99c\x83,^tt\xa7oz\x85\x9e\xe9\\\x87'

Which part of this hex is the public key? Isn't the address flag of p2pkh 0x00?
Jump to: