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?
Asked
Active
Viewed 1,238 times
0
ygh
- 205
- 1
- 6
1 Answers
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
Edmund Edgar
- 16,897
- 1
- 29
- 58
-
Awesome! But I only have the signature hex. Is there a way I can figure out the v, r, s arguments? – ygh Aug 09 '18 at 13:25
-
Spoke too soon. Got it. Appreciate your help. – ygh Aug 09 '18 at 13:35