Bitcoin Forum
September 21, 2021, 08:40:05 PM *
News: Latest Bitcoin Core release: 22.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: P2PKH hex to address  (Read 94 times)
linuxqq
Jr. Member
*
Offline Offline

Activity: 34
Merit: 6


View Profile
May 20, 2021, 04: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?
1632256805
Hero Member
*
Offline Offline

Posts: 1632256805

View Profile Personal Message (Offline)

Ignore
1632256805
Reply with quote  #2

1632256805
Report to moderator
1632256805
Hero Member
*
Offline Offline

Posts: 1632256805

View Profile Personal Message (Offline)

Ignore
1632256805
Reply with quote  #2

1632256805
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1632256805
Hero Member
*
Offline Offline

Posts: 1632256805

View Profile Personal Message (Offline)

Ignore
1632256805
Reply with quote  #2

1632256805
Report to moderator
1632256805
Hero Member
*
Offline Offline

Posts: 1632256805

View Profile Personal Message (Offline)

Ignore
1632256805
Reply with quote  #2

1632256805
Report to moderator
NotATether
Hero Member
*****
Offline Offline

Activity: 644
Merit: 2036


Cryptographic Crawler


View Profile WWW
May 20, 2021, 04:40:54 AM
Merited by bitmover (1)
 #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.

odolvlobo
Legendary
*
Offline Offline

Activity: 3346
Merit: 2009



View Profile
May 20, 2021, 05:30:33 AM
 #3

There is no address. It is a non-standard script:
Code:
04678afd04678afd
OP_DROP
OP_SHA256
894eeb82f9a851f5d1cb1be3249f58bc8d259963832c5e7474a76f7a859ee95c
OP_EQUAL

Buy stuff on Amazon with BTC or convert Amazon points to BTC here: Purse.io
Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
nc50lc
Legendary
*
Offline Offline

Activity: 1442
Merit: 2207


Self-proclaimed Genius ㊙️


View Profile
May 20, 2021, 05: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://bitcointalk.org/index.php?topic=52378.msg625507#msg625507
Thread has some guesses on how to spend it.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!