Bitcoin Forum
December 15, 2024, 12:12:41 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Address from signature.  (Read 233 times)
2342q6tegw (OP)
Jr. Member
*
Offline Offline

Activity: 174
Merit: 6


View Profile
June 06, 2018, 05:46:27 AM
 #1

Hi

Is there a way to find the public address from a signature? Either from the forum such as the stake your thread which ties account members to their accountd. Now I would like to look at the transactions of each account member, but I don't know how to get that information from blockchain explorer because I don't know what their public address is, do I need to know the adress sepratley or can I work it out from the signature somehow.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3570
Merit: 6927


Just writing some code


View Profile WWW
June 06, 2018, 06:11:59 AM
Merited by Foxpup (2), ABCbits (2), pebwindkraft (1)
 #2

The point of the stake your address thread is to post your address, not just a message and a signature. You should see addresses in there, not just messages and signatures.

But even with just a message and signature, you can still get an address, it just may not be the correct one.

Signature verification requires three items: the signature, a message, and a public key. Typically you pass all three into a verification algorithm which tells you whether the signature is true or false. However, with just the signature and the message, you can get a public key which is valid for the message and signature. You can then compute the address for that public key.

Keep in mind that any signature and message combination can be used to produce a public key. That does not mean that the private key for that public key is the one that actually produced the signature or that the message is the message that was actually signed. Part of signature verification is to also provide the public key to prove that the owner of the private key for that public key signed the message, not just that the message and signature are both valid. The public key is an important part of signature verification.

DannyHamilton
Legendary
*
Offline Offline

Activity: 3514
Merit: 4895



View Profile
June 08, 2018, 04:10:40 PM
 #3

Furthermore, users can have multiple addresses.  Therefore the transactions you find from a given public key are unlikely to be all (or even most) of the transactions of the user.

Additionally, for any given public key, there are 2 possible P2PKH addresses (Addresses that start with a '1'). The compressed, and the uncompressed.  There are also approximately 1.46 X 1048 possible P2SH addresses (addresses that start with a '3').  It is also possible for a user to use a public key to create transactions that don't use addresses at all (non-standard output scripts).

2342q6tegw (OP)
Jr. Member
*
Offline Offline

Activity: 174
Merit: 6


View Profile
June 08, 2018, 05:18:58 PM
 #4

This has all been a fantastic help thanks, the next thing I want to do is learn his to do verification and check some of those staked signatures. Then ,I should be able to test if for example two people claim to both own the address who really does.
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18771


View Profile
June 08, 2018, 06:45:49 PM
 #5

The quickest way I use to verifiy a message is with this link: https://brainwalletx.github.io/#verify

You can either paste the entire quote from "-----BEGIN BITCOIN SIGNED MESSAGE-----" to "-----END BITCOIN SIGNED MESSAGE-----" in to the "Signed Message" tab, or alternatively, you can swap to "Bitcoin-QT" and manually paste in the address, message and signature. Either way will give you the same result (A green message verified banner or a red failed to verify one).

For a more indepth look at signing and verifying messages, I would recommend shorena's guide How to sign a message?!
Jus12
Newbie
*
Offline Offline

Activity: 21
Merit: 3


View Profile
June 08, 2018, 06:50:38 PM
 #6

In ECDSA, the signatures used for Bitcoin, it is possible to recover the public key and thus, the addresses.

Note that usually, you will have 4 public keys, and in rare cases, 8 keys (one of which will be the real one)

See this: https://crypto.stackexchange.com/questions/18105/how-does-recovering-the-public-key-from-an-ecdsa-signature-work

And one example code here: https://github.com/scalahub/bitcoinS/blob/35eef4231538c9e329c6a88fc82ce70f03c65bf1/BitcoinS/src/sh/ecc/ECCPubKey.scala#L43
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!