Skip to content

Experiment Using PRF Extension For Signer Key Material #249

@nlordell

Description

@nlordell

Context / issue

One of the big downsides of Webauthn is that most devices only support curves that are non-EVM native (P-256, RSA, Ed25519 to name the common ones). This means that, at least until EIP-7212 lands, ECDSA signature verification needs to be implemented in Solidity which adds ~300k gas overhead when verifying signatures.

There is a pseudo-random function extension (PRF) that allows credentials to provide additional 32-byte key material for use in the client. The use case for the extension, for example, request a credential when logging in with some additional key material, and then use this key material to decode some local storage data. However, this can also be used as key material to generate secp256k1 private keys for signing transactions.

Proposed solution

On account creation:

  1. Create the credential and request prf with a fixed first salt parameter
  2. Use the generate 32-byte key material as an HD wallet seed
  3. Compute the address of an account at a fixed HD wallet path (the default one for example, or a special index, etc.)
  4. Use the account as regular EOA owner to the Safe
  5. Discard the key material (ensuring it is only ever used ephemerally)

On transaction signing:

  1. Request the credential created ☝️ with prf and the same fixed first salt parameter
  2. Use the generate 32-byte key material as an HD wallet seed
  3. Sign the Safe transaction with the account with the same HD wallet path used during account creation
  4. Discard the key material (ensuring it is only ever used ephemerally)

Alternatives

Note that in the proposed solution, we always discard the key material right awayt after using it. If we want to provide a more "login once, sign many times" experience, we can even store the key material per session, and then not require an authenticator (i.e. device like iPhone) interaction per signature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions