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
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
-
Awesome! But I only have the signature hex. Is there a way I can figure out the v, r, s arguments?– ystarkAug 9, 2018 at 13:25
-