Author

Topic: How to find the public key of btc address (Read 362 times)

hero member
Activity: 630
Merit: 731
Bitcoin g33k
November 05, 2022, 01:23:49 PM
#14
@Morexl: What exactly do you need to know the public key for a certain address? Can you tell us, please? whats your intention ?
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
November 05, 2022, 01:19:33 PM
#13
What exactly is the reason one is interested in the pubkey of an address ?
One might want to verify a transaction associated with an address. Or he might want to prove he owns it. Or you might want to send someone an encrypted message besides money; possession of the public key is necessary to confirm that the money receiver is also the message receiver. Or one might just want to educate himself about ECDSA private and public keys.
legendary
Activity: 2380
Merit: 5213
November 05, 2022, 01:10:56 PM
#12
What exactly is the reason one is interested in the pubkey of an address ?
Public key is needed only when you want to make a transaction. Your transaction should contain the public key, so the nodes can verify your signature. Since the public key is calculated automatically by your wallet and broadcast to the network, you don't really need to know the public key of your address. That's why wallets usually gives you the addresses and private keys and not the public keys.

Maybe OP is just doing some studies on how private keys and public keys are calculated.
hero member
Activity: 630
Merit: 731
Bitcoin g33k
November 05, 2022, 10:47:00 AM
#11
What exactly is the reason one is interested in the pubkey of an address ?
legendary
Activity: 3472
Merit: 4801
October 31, 2022, 09:08:01 AM
#10
If you know who the address belongs to (who has access to thee private key for the address), then you could just ask them to send you the public key.

Verifying that they sent you the correct public key is a rather simple thing to program.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
October 31, 2022, 04:54:44 AM
#9
I want to know how I can find the public key (compressed or uncompressed) of any address

If there's a transaction made from the address, you can find its public key by checking the transaction details in a block explorer.
If the address is P2PKH (legacy), the public key is the second part of Sigscript.
If the the address is P2WPKH (native segwit) or P2WPKH-P2SH (nested segwit), the public key is the second part of witness.

But if it's P2SH, P2WSH or P2TR address, you might have to check the redeem script manually to find any revealed public key.

However, if there is at least 1 transaction on the address, then you could search an explorer or look up the firstbits on walletexplorer.
This is not accurate.  You can find the public key of an address if there's an outgoing transaction. It's not that any transaction on history of an address can help you to find its public key. 
For making a transaction, you have to reveal your public key, so nodes can verify your signature. Your public key isn't revealed when you receive a transaction.

I get what you're saying but you already sort of make my point as you say- if there's an outgoing transaction.

You're not being explicit enough on earlier post, "1 transaction" could refer to either incoming and outgoing transaction. That might be why @hosseinimr93 said your statement isn't accurate.
hero member
Activity: 2548
Merit: 607
October 30, 2022, 04:32:50 PM
#8
However, if there is at least 1 transaction on the address, then you could search an explorer or look up the firstbits on walletexplorer.
This is not accurate.  You can find the public key of an address if there's an outgoing transaction. It's not that any transaction on history of an address can help you to find its public key.  
For making a transaction, you have to reveal your public key, so nodes can verify your signature. Your public key isn't revealed when you receive a transaction.

I get what you're saying but you already sort of make my point as you say- if there's an outgoing transaction.
legendary
Activity: 2380
Merit: 5213
October 30, 2022, 04:08:23 PM
#7
However, if there is at least 1 transaction on the address, then you could search an explorer or look up the firstbits on walletexplorer.
This is not accurate.  You can find the public key of an address if there's an outgoing transaction. It's not that any transaction on history of an address can help you to find its public key.  
For making a transaction, you have to reveal your public key, so nodes can verify your signature. Your public key isn't revealed when you receive a transaction.
hero member
Activity: 2548
Merit: 607
October 30, 2022, 03:29:32 PM
#6
If there are no transactions on the address and the address doesn't belong to you, then I don't believe you will be able to find it.  However, if there is at least 1 transaction on the address, then you could search an explorer or look up the firstbits on walletexplorer.
newbie
Activity: 5
Merit: 1
October 29, 2022, 05:53:42 PM
#5
You can't derive public key from the address. The address is derived from the public key through a one way function.
Should I tell OP they can try breaking SHA256 and RIPEMD160 to reverse the public key hash into a public key or will it just cause more confusion? Grin

@OP, you want to read these:
https://learnmeabitcoin.com/beginners/keys_addresses
https://learnmeabitcoin.com/technical/address
https://learnmeabitcoin.com/technical/public-key-hash

Ok thanks let me read these topics.
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
October 29, 2022, 06:07:21 AM
#4
You can't derive public key from the address. The address is derived from the public key through a one way function.
Should I tell OP they can try breaking SHA256 and RIPEMD160 to reverse the public key hash into a public key or will it just cause more confusion? Grin

@OP, you want to read these:
https://learnmeabitcoin.com/beginners/keys_addresses
https://learnmeabitcoin.com/technical/address
https://learnmeabitcoin.com/technical/public-key-hash
jr. member
Activity: 51
Merit: 20
October 28, 2022, 10:14:39 PM
#3
Signing a message with the address in question would also reveal the public key.
legendary
Activity: 2380
Merit: 5213
October 28, 2022, 04:39:37 PM
#2
If the address isn't yours (I mean you don't own its private key) and there isn't any transaction made from that address, there is no way to find the public key of the address.
You can't derive public key from the address. The address is derived from the public key through a one way function.

If there's a transaction made from the address, you can find its public key by checking the transaction details in a block explorer.
If the address is P2PKH (legacy), the public key is the second part of Sigscript.
If the the address is P2WPKH (native segwit) or P2WPKH-P2SH (nested segwit), the public key is the second part of witness.


Here is the sample address: 1N45DoSuhiNi5dCqMTpC2k3tfSaHEw1uKk
Since no transaction has been made from this address, there is no way to find its public key.
To know the public key of this address, you need its private key.
newbie
Activity: 5
Merit: 1
October 28, 2022, 04:17:50 PM
#1
Hello everyone,

I want to know how I can find the public key (compressed or uncompressed) of any address, because i see there are too many addresses but they didn't have the public key so i check them blockchair.com and other explorer but they also didn't show the public key.

Here is the sample address: 1N45DoSuhiNi5dCqMTpC2k3tfSaHEw1uKk
Jump to: