Bitcoin Forum
May 22, 2024, 05:56:25 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is it possible to obtain the public key from any address?  (Read 226 times)
cookiebro (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 1


View Profile
November 29, 2021, 02:27:30 PM
 #1

Hey,

I need to know if it's possible to obtain the public key from any given BTC address. And if so, how?

I usually get it via the "decodescript" command hash value via the Bitcoin core, but this particular hash doesn't contain the public key, as far as I can tell.

Ta
DeepComplex
Newbie
*
Offline Offline

Activity: 24
Merit: 8


View Profile
November 29, 2021, 02:43:40 PM
Merited by hugeblack (4), BlackHatCoiner (1)
 #2

The Public Key is only disclosed after a spending transaction has occurred. As long as no bitcoin has been sent from the address the key is unknown.

 
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1526
Merit: 7414


Farewell, Leo


View Profile
November 29, 2021, 03:44:27 PM
 #3

When someone funds a bitcoin address, they lock those funds in a hash of the public key which is, essentially, the address. Those funds can be unlocked only if the public key, that once hashed gives the same hash, is provided along with a message that says they want to spend that UTXO plus a valid signature.

If there's no spent transaction output from an address, you only have the base58 representation of the hash, which means you only have the hash.

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

Activity: 1610
Merit: 6754


bitcoincleanup.com / bitmixlist.org


View Profile WWW
November 29, 2021, 06:02:09 PM
Merited by hugeblack (4)
 #4

The addresses are designed to not reveal to you the public key, that's why you cannot find the one for your address.

In particular, decoding the hash does not reveal the public key, it only reveals the script and also the HASH160 that it's pushing to the stack to compare for equality. There is no public key in this process at this stage (only when you sign the transaction and the public key is fed into the script to get Boolean true/false accepted/rejected value).

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

Activity: 2268
Merit: 18565


View Profile
November 29, 2021, 08:20:19 PM
Merited by hugeblack (4), ABCbits (1)
 #5

I usually get it via the "decodescript" command hash value via the Bitcoin core, but this particular hash doesn't contain the public key, as far as I can tell.
Not all addresses have a public key. It could be that you are trying to decode a P2SH or P2WSH address which is using a hash of the locking script instead of a hash of the public key, for example.

Can you share the script you are decoding and then we can tell you exactly what is going on?
Pmalek
Legendary
*
Offline Offline

Activity: 2772
Merit: 7153



View Profile
November 30, 2021, 10:27:28 AM
Merited by BlackHatCoiner (1)
 #6

Why is my gut feeling telling me that DeepComplex is just an alt of cookiebro and that the whole purpose of this thread is for either of the two to get some merits? If I am wrong, I apologize to both users.

The fact is that both registered on the same day and coincidentally ended up posting in the same thread. 

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
DeepComplex
Newbie
*
Offline Offline

Activity: 24
Merit: 8


View Profile
November 30, 2021, 10:16:00 PM
 #7

No, i'm not "cookiebro", i'm a long-time lurker who only had a reason to post recently.

I'm now learning about the technology.

Why is my gut feeling telling me that DeepComplex is just an alt of cookiebro and that the whole purpose of this thread is for either of the two to get some merits? If I am wrong, I apologize to both users.

The fact is that both registered on the same day and coincidentally ended up posting in the same thread. 
bitcoinbeto
Newbie
*
Offline Offline

Activity: 4
Merit: 3


View Profile WWW
December 03, 2021, 11:58:55 PM
 #8

In the new P2TR (pay-to-taproot) single key address type, the bech32 decoded address is also a public key.
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!