Skip to content

Conversation

@enis-incentiv
Copy link
Collaborator

@enis-incentiv enis-incentiv commented Oct 2, 2024

Story

https://incentiv-net.atlassian.net/browse/IND-126

Summary

This PR introduces support for creating or retrieving an Account Abstraction (AA) account using a passkey. It also updates the preVerificationGas calculation and the verificationGasLimit to accommodate the increased gas costs required for P-256 and WebAuthn validation.

Key Changes:

  1. Passkey Support in SimpleAccountAPI:

    • Added logic to check for publicKey and handle account creation with passkey signatures (x and y coordinates).
    • If publicKey is absent, fallback to creating the account with the owner's address and index.
  2. PreVerificationGas Calculation:

    • Updated the preVerificationGas calculation to account for the larger WebAuthn signature size (536 bytes).
    • Adjusted the calculation for gas costs related to the passkey.
  3. Increased VerificationGasLimit:

    • Increased the verificationGasLimit from 100,000 to 500,000 to handle the more complex P-256 signature verification and WebAuthn validation.
    • The P-256 verification takes a minimum of 330,000 gas, based on P-256 Verifier.

Testing:

  • Verified that both passkey-based and address-based account creation works correctly.
  • Ensured gas calculations are appropriate for passkey-based operations.

@enis-incentiv enis-incentiv force-pushed the IND-126-add-passkey-support-to-aa branch from 066b82b to da8212d Compare October 2, 2024 01:54
@DrenIncentiv
Copy link
Contributor

Looks great! Thanks!

@DrenIncentiv DrenIncentiv merged commit 89d34ff into main Oct 9, 2024
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

Successfully merging this pull request may close these issues.

3 participants