Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Multiple EC Verifier Implementations #285

Closed
nlordell opened this issue Feb 29, 2024 · 1 comment
Closed

Support Multiple EC Verifier Implementations #285

nlordell opened this issue Feb 29, 2024 · 1 comment
Assignees

Comments

@nlordell
Copy link
Contributor

nlordell commented Feb 29, 2024

The WebAuthn signer implementation should support multiple elliptic curve (EC) verifier implementations. Ideally, we would be able to test against the EIP-7212 precompile, but that is currently not available in Harhat. Instead, we can use both the Daimo.eth and an FCL-based verifier to check that signature validation functions in the same way for both verifier implementations.

The expected outcome is the required code and tests ensuring that the EC verfier implementation can be changed. Since this is already the design introduced in #223, most of the work will be around testing.

For bonus points, it would be nice to also include a test using the EIP-7212 P-256 precompile as a verifier, if we can find a way to run a chain that supports this precompile in CI.

@nlordell nlordell self-assigned this Mar 4, 2024
nlordell added a commit that referenced this issue Mar 7, 2024
Partially addresses #285

This PR adds new tests that verify multiple P-256 verifiers are
supported by our code. The `webauthn` shim code now moved to the
`passkey` package and is imported by the `4337` package, as this made
more sense to me. @mmv08 moved E2E tests for Passkey+4337 to the
`passkey` project, so once they both merge, the dependency can be
removed.

Note that for now, we use a `TestWebAuthnSignerFactor` contract just for
implementing the tests, but it should be switched to using the canonical
signing factory from #306 once merged.

The additional verifier that is being used is the one from
[Daimo-eth](https://github.com/daimo-eth/p256-verifier). The artifact
was vendored into the project, as it is a Foundry project, and this is
the easiest way to include the dependency without building it (giving us
identical bytecode to what is deployed on-chain).

Adding a test for using the precompile will be done in a separate PR.

---

Note that this PR contains some unrelated changes to the deployment and
E2E setup. This was a result of rebasing onto changes introduced in #306
to get things working as well as some nits leftover from the
aforementioned PR.
@nlordell
Copy link
Contributor Author

nlordell commented Mar 11, 2024

It turns out that using an actual precompile is non-trivial at the moment. I checked out some execution clients and they either:

  • Don't support the precompile at all ATM (Optimism for example)
  • Don't enable it in Dev mode (Polygon for example)

So this issue can be closed and implemented by #307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant