Coder Social home page Coder Social logo

p256-signer's Introduction

P256 Signer

This library implements the decoding and verification of a signed Webauthn payload following the EIP 1271 providing an implementation of Standard Signature Validation Method when the account is a smart contract.

Contracts overview

FCL/FCL_elliptic.sol

The FCL_Elliptic_ZZ library implements computation of ECDSA verification using the secp256r1 curve.It uses a XYZZ system coordinates. This contract is from here. The original repository also contains tests.

Webauthn.sol

The Webauthn library implements the decoding and verification of a signed Webauthn payload.

P256Signer.sol

The P256Signer contract represents a Gnosis Safe signer for a given secp256r1 public key.

P256SignerFactory.sol

The P256SignerFactory contract is a factory for P256Signers. It allows us to have deterministic addresses for a given secp256r1 public key.

Audits

Gnosis chain audit: https://gnosischain.notion.site/p256-signer-Audit-a9e7807bc9dd4a768d0f78e3919d3eac

We've updated our contracts following the audit's recommandations, see deployments: #23

Signature malleability

Clients need to note there is a potential signature malleability by replacing (r, s) by (r, -s mod n). It is the responsibility of the client to check the message signed is played only once if necessary.

Launch tests

You will need INFURA_ID=<your_infura_id> in your env variables.
You will need forge installed, see foundry book for instructions here.

Install FCL dependency:

forge install

To launch both hardhat and forge tests:

yarn test

Hardhat

npx hardhat test

Forge

forge test

Deploy

HARDHAT_NETWORK=<target_network> npx hardhat deploy

p256-signer's People

Contributors

obatirou avatar kelvyne avatar fdematos avatar laurentsalou avatar yoanslvy avatar vincentlg avatar mmv08 avatar

Stargazers

Romel avatar Shorn avatar Ilan Gitter avatar  avatar jiangplus avatar  avatar  avatar Hamid Akhlaghi avatar  avatar Lewis Freiberg avatar Tao Xu avatar Charan V avatar

Watchers

Jérôme Bernard avatar  avatar Arthur Tayrac avatar  avatar  avatar Benjamin Payoux avatar Guillaume Badi avatar Vincent Loupmon avatar Jonathan Vanhouteghem avatar Jerome de Tychey avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.