1

I'm trying to figure out how you find the public key used to sign a transaction from v, r, and s. Before someone says so, this isn't a duplicate of Get public key of any ethereum account. That question asks how you do it just from the address, not from a transactions. The responses to that question just say that it can be done with some libraries, but don't explain how the math actually works.

I'm trying to follow the steps in the Wikipedia article on ECDSA (https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm). I'm good up to step 6 of the signature verification algorithm. We can get u1 and u2 from r, s, and the transaction itself. The generator point is part of the secp256k1 specification, but I don't see where the public key (Q_A in the Wikipedia article) comes from. We haven't used v yet (not clear to me what it is), but it's only one byte and we lost more than one byte when we went from public key to Ethereum address (Keccak-256 hash, then drop 12 bytes), so I don't see how that can get us back to the public key.

To be clear, I'm trying to figure out how the math actually works. I know there are some black box methods in Python, JavaScript, etc, but I can't figure out how they work. Thanks.

7
  • Do you have the transaction hash?
    – Dorian Lee
    Feb 4, 2018 at 3:22
  • I'm not talking about a specific transaction, but in general, yes. Feb 4, 2018 at 4:13
  • and you dont mean the address(public key hash)?
    – Dorian Lee
    Feb 4, 2018 at 4:30
  • No, I can find the address in the block explorer or Geth console. I have that. I want to do the ECDSA math myself and I need the public key for that. Feb 4, 2018 at 5:09
  • 1
    @JohnStanford The mathematical details are explained in crypto.stackexchange.com/questions/18105/…
    – Ismael
    Feb 4, 2018 at 5:38

1 Answer 1

1

The originator’s public key can be computed directly from the ECDSA signature. Once you have the public key, you can compute the address easily. The process of recovering the signer’s public key is called public key recovery.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.