0

There are many answer which explain how to compute _r, _s, _v with an other language. But how to compute parameters in solidity itself ? Is there a built-in function like ecrecover ?

user2284570
  • 1,008
  • 1
  • 12
  • 30

1 Answers1

1

Computing the v, r, s inputs to ecrecover is another way of saying "create a signature". Normally you wouldn't want to do this in Solidity, as it would imply that the private key was recoverable from the blockchain, and private keys aren't usually useful unless they're private.

Accordingly, Solidity has no built-in function to sign data. I'm not sure if anyone has written a library to do this, and I can't imagine what it would be useful for, but in principle it should be possible.

Edmund Edgar
  • 16,897
  • 1
  • 29
  • 58