2

I am trying to implement EdDSA verification using solidity as all my contracts are written in solidity.I wanted to upgrade it to use EdDSA algorithm, but I found no packages that support it that are production ready.I found Geth-snarks implementation that requires points on the curve as input.I wanted a implementation that takes in a compressed public key and {R,s} to verify the signature.

4 Answers 4

1

Here are some reference, you can check below:

1
  • This should be the accepted answer - OP was looking for EdDSA, not ECDSA Commented Feb 9, 2023 at 7:08
1

This is an implementation of EDDSA signature verification with sha512 digest (based on this RFC).

https://github.com/rdubois-crypto/FreshCryptoLib/blob/master/solidity/src/FCL_eddsa.sol

0

I recently have open-sourced the library for message verification on Farcaster, you can use Ed25519.sol from there.

https://github.com/pavlovdog/farcaster-solidity/blob/main/contracts/Test.sol#L58

    bool valid = Ed25519.verify(
      public_key,
      signature_r,
      signature_s,
      message_hash
    );

Verification currently takes about 1m gas, which can be reduced by using ZK proofs.

-1

Openzepplin has a library that supports ECDSA operations here https://docs.openzeppelin.com/contracts/2.x/api/cryptography

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.