Open nlordell opened 9 months ago
which adds ~300k gas overhead when verifying signatures.
This doesn't sound right, as in current prices it would mean ~746 ETH
which adds ~300k gas overhead when verifying signatures.
This doesn't sound right, as in current prices it would mean ~746 ETH
300000 gas units * 32 gwei (current gas price) = 0,0096 ether, which is 22 USD with the current prices for just verifying a signature.
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:
prf
with a fixedfirst
salt parameterOn transaction signing:
prf
and the same fixedfirst
salt parameterAlternatives
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.