EVM: precompiled ECDSA
Context
fix #4827 (closed)
Implements the precompiled contract 0x01
called ECDSA, or ECDSA recover, or ecrecover. The goal of that contract is to check the signature of an input, by returning the address corresponding to the private key used to sign.
Notes:
- the signature doesn't implement EIP-155, ie. the
v
parameter doesn't encode the chainid - the signature doesn't implement EIP-2, ie. the
s
parameter can be greater thansecp256k1n ÷ 2 + 1
andv
can be0
or1
(as normal) or2
or3
(which correspond to "big" values fors
).
Manually testing the MR
A few tests are implemented in precompiled.rs
both for the checking inputs and executing the contract.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rst
for the protocol and the environment,CHANGES.rst
at the root of the repository for everything else). -
Select suitable reviewers using the Reviewers
field below. -
Select as Assignee
the next person who should take action on that MR
Edited by Pierre-Emmanuel CORNILLEAU