Home

Awesome

Elliptic Solidity

Solidity smart contract project to allow the verification of ECDSA signatures.

Verification of a signature costs approx. 1 million gas.

Curves Implemented:

How Do I Use It?

The contract aims to allow on-chain verification of ECDSA signatures. Thus the contract takes the signature, split into r and s, the signed data and the public key that purports to have produced the signature.

    function Verify(uint X, uint Y, uint r, uint s, bytes memory input)
        public pure returns (bool)

If the signature is valid then true is returned else false.

Run the Tests

To run the tests, first clone and enter the repo:

git clone https://github.com/maxrobot/elliptic-solidity.git
cd elliptic-solidity

Then,

npm install
npm run testrpc

open a new terminal and in the same directory run,

npm run test

References

hyperelliptic.org

jbaylina/ecsol

rynobey/multiexponent

SEC 2: Recommended Elliptic Curve Domain Parameters