0

I'm trying to find a way to get the public key of an Ethereum's address. I found out that if an address has an outgoing transaction it's possible. I used Etherscan's "txlist" to get the address transactions, it would output something like this:

enter image description here

And then from the "hash" parameter I used Etherscan's "eth_getTransactionByHash" to get more information about the transaction and get v, r, and s. The output would be something like this:

enter image description here

Now having v, r, and s I was wondering if there's a way to retrieve the public key. I've found posts that using v, r, s and also "signed transaction" can compute the public key, but also couldn't find a way to get the "signed transaction" of an address from the list of its previous transaction. Thanks

m0j1
  • 167
  • 7
  • here is the answer to your question. https://ethereum.stackexchange.com/a/79174/19683 – Nulik Jan 30 '23 at 15:43
  • transaction hash is already signed, you don't get any new hash labeled as "signed". Transaction hash is just a hash on a bunch of fields of the transactions concatenated into a variable length byte array. Then this block is fed to Sign() function and it gives you the signature of the hash. That's what the process of signing a transaction do – Nulik Jan 30 '23 at 15:45
  • you probably got mislead because in the libraries signed transaction is an object which has R/S/V fields set, and unsiged transaction has these fields set to "empty" – Nulik Jan 30 '23 at 15:46
  • Thanks @Nulik, The thing that I suspect is that if I paste "hash" value in the ABDK toolkit it gives error and doesn't output the public key. what do you think? – m0j1 Jan 31 '23 at 06:32
  • @Nulik, I'm trying to follow this code https://scrapbox.io/piyopiyo/How_to_get_sender%E2%80%99s_Ethereum_address_and_public_key_from_signed_transaction and it needs the signedTx, that's why I'm looking for it. – m0j1 Jan 31 '23 at 11:31
  • all transactions are signed so saying that you need a signed transaction doesn't make sense. If the transaction would be unsigned nobody would be able to verify it (because there are no R/S/V values present) , such transaction simply won't be accepted by any ethereum node. – Nulik Feb 01 '23 at 01:19

0 Answers0