Skip to content

EVM: precompiled ECDSA

Pierre-Emmanuel CORNILLEAU requested to merge pec@evm@precompiled@ecrecover into master

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 than secp256k1n ÷ 2 + 1 and v can be 0 or 1 (as normal) or 2 or 3 (which correspond to "big" values for s).

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

Merge request reports