Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: How to define which coordinate is negative?
by
o_e_l_e_o
on 10/01/2023, 11:22:52 UTC
⭐ Merited by PowerGlove (1)
hi can you please tell me how to find the publickey of btc address
If the only information you have is the address, then chances are you cannot.

Most bitcoin addresses are hashes of the public key or the locking script. Hashing is a one way function and cannot be reversed, so you cannot take an address and go backwards to find the public key. However, when a transaction spending coins from that address is made, the public key will be revealed in the signature of that transaction.

So if you have an address which has never made a transaction, you cannot find out the public key. If the address has made a transaction, then you can look at that transaction data and extract the public key from it. Where exactly the public key is within that data depends on the type of address and the transaction itself.

There are a few exceptions to the above, such as P2PK and P2TR outputs.