0

I want to use web3's ecRecover functionality and nothing else. Unless I misunderstand its requirements - a signature, the signed data, some cryptomagic and poof you have recovered the signer - why do I need to have a provider for it? What I'm trying to say is that this functionality could be implemented without relying on the RPC connection. So is there a way to do ecRecover in Node.js or even vanilla javascript sans web3?

1 Answer 1

1

You shouldn't need a provider. If web3.js won't let you use ecrecover without one for some reason or you prefer something more lightweight, take a look at ethereumjs-util:

https://github.com/ethereumjs/ethereumjs-util/blob/master/docs/index.md

See the answer to this question for an example: Getting an address from ethereumjs-utils ecrecover

2
  • Awesome! But I only have the signature hex. Is there a way I can figure out the v, r, s arguments?
    – ystark
    Aug 9, 2018 at 13:25
  • Spoke too soon. Got it. Appreciate your help.
    – ystark
    Aug 9, 2018 at 13:35

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.