permissionless_passkeys 0.1.0
permissionless_passkeys: ^0.1.0 copied to clipboard
WebAuthn/Passkeys support for permissionless.dart ERC-4337 smart accounts. Enables biometric authentication with Kernel and Safe accounts using P256 signatures.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 - 2026-02-20 #
Initial release of permissionless_passkeys - WebAuthn/Passkeys support for permissionless.dart ERC-4337 smart accounts.
Added #
-
viem-compatible WebAuthn Account API
WebAuthnAccount- Abstract account interface extendingWebAuthnAccountOwnerfrom permissionlessWebAuthnSignReturnType- Return type with signature and metadataWebAuthnSignMetadata- Authenticator data, client JSON, indicestoWebAuthnAccount()- Factory function (matches viem pattern)createWebAuthnAccount()- Dart-idiomatic convenience function
-
Types
WebAuthnCredential- Wrapper for WebAuthn credential data with JSON serialization
-
Factory Functions
createPasskeyCredential()- Register passkeys with biometricscreateWebAuthnAccountFromCredential()- Create account from credential
-
Encoding Functions
encodeKernelWebAuthnSignature()- ABI encode signatures for Kernel WebAuthn validatorencodeSafeWebAuthnSignature()- ABI encode signatures for Safe WebAuthn signerencodeSafeWebAuthnSignatureRaw()- Encode with explicit timestampsencodeWebAuthnSignerConfig()- Encode signer public key configurationencodeWebAuthnSignerConfigure()- Encode SafeWebAuthnSharedSigner configure callgetDummyKernelWebAuthnSignature()- Gas estimation stub for KernelgetDummySafeWebAuthnSignature()- Gas estimation stub for Safe
-
Smart Account Integration
WebAuthnAccountcan be passed directly tocreateKernelSmartAccount()as ownerWebAuthnAccountcan be passed directly tocreateSafeSmartAccount()as owner- Works with Kernel v0.3.x (WebAuthn validator) and Safe v1.4.1/v1.5.0 (shared signer)
-
Tests
- Comprehensive unit tests for encoding functions
- Credential serialization tests (JSON round-trip)
- WebAuthnAccount creation and signing tests
-
Example App
- Flutter example demonstrating passkey registration
- Kernel and Safe account creation from WebAuthn credentials
- Riverpod state management
Fixed #
- Kernel WebAuthn: Fixed null safety for
typeIndexin kernel signature encodingsignature.getTypeLocation()!replaced withsignature.getTypeLocation() ?? 0- Handles undefined typeIndex by defaulting to 0