WebAuthnValidator
The primary validator. Verifies signatures from WebAuthn authenticators - passkeys, hardware security keys, and device secure enclaves (Apple Secure Enclave, Android Keystore, FIDO2). These devices use the P-256 (secp256r1) elliptic curve, which is different from Ethereum’s native secp256k1.How it works
- The smart account receives a UserOp
- The account calls
validateUserOp()on the WebAuthnValidator - The validator extracts the signature components: authenticator data, client data JSON, and the WebAuthn signature
- For the first transaction: validates against the initial key stored in the contract
- After the first transaction: validates against keys in the KeyStore
- Verifies the challenge in the client data matches the UserOp hash
- Checks the sign count for replay protection
- Returns valid or invalid
Key migration
On installation, the validator stores the initial public key internally. After the first successful transaction, it migrates the key to the KeyStore viainitialRegisterKey(). This two-phase approach ensures the KeyStore entry is only created for accounts that actually transact.
EIP-7951 support
The validator supports the P256VERIFY precompile (EIP-7951) via a configurable flag. On chains that have adopted this precompile, signature verification costs 6,900 gas instead of 200,000+ gas for Solidity-based P-256 math. TheusePrecompiled flag can be set per account, allowing the validator to work on chains with and without precompile support.
Verification options
Each account can configure:| Option | Default | Description |
|---|---|---|
| usePrecompiled | Chain-dependent | Use the P-256 precompile for faster verification |
| allowMalleability | true | Accept signature malleability (standard WebAuthn behavior) |
| requireUserPresence | true | Require the UP flag in authenticator data |
| requireUserVerification | false | Require the UV flag (biometric confirmation) |
Future validators
The KeyStore is signature-scheme agnostic. It stores raw public key bytes. Different validators can read from the same KeyStore to support different signing methods:| Validator | Curve | Use case |
|---|---|---|
| WebAuthnValidator | P-256 (secp256r1) | Passkeys, hardware keys, secure enclaves |
| ECDSAValidator | secp256k1 | Traditional Ethereum wallets, agent-held keys |
| Ed25519Validator | Curve25519 | Solana-style signatures, cross-chain agents |