Bitcoin Forum
June 07, 2024, 01:34:46 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: P2PKH hex to address  (Read 118 times)
linuxqq (OP)
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?
NotATether
Legendary
*
Online Online

Activity: 1624
Merit: 6879


bitcoincleanup.com / bitmixlist.org


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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
odolvlobo
Legendary
*
Offline Offline

Activity: 4340
Merit: 3258



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

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
nc50lc
Legendary
*
Offline Offline

Activity: 2436
Merit: 5684


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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
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!