A Dart/Flutter SDK for building ERC-4337 (Account Abstraction) applications. This monorepo contains packages for smart account creation, user operation bundling, and WebAuthn/Passkey authentication.
| Package | Description | pub.dev |
|---|---|---|
| permissionless | Core ERC-4337 SDK for smart accounts and bundler interactions | |
| permissionless_passkeys | WebAuthn/Passkeys support for biometric smart account authentication |
Add the packages you need to your pubspec.yaml:
dependencies:
# Core ERC-4337 functionality
permissionless: ^0.1.2
# Optional: WebAuthn/Passkeys support
permissionless_passkeys: ^0.1.0import 'package:permissionless/permissionless.dart';
// Create a bundler client
final bundlerClient = BundlerClient(
chain: Chain.sepolia,
bundlerUrl: 'https://api.pimlico.io/v2/sepolia/rpc?apikey=YOUR_KEY',
);
// Create a simple smart account
final account = SimpleSmartAccount(
SimpleSmartAccountConfig(
owner: privateKeyToAccount(privateKey),
chainId: Chain.sepolia.id,
publicClient: publicClient,
),
);
// Send a user operation
final hash = await bundlerClient.sendUserOperation(
account: account,
calls: [
Call(
to: recipientAddress,
value: BigInt.from(1000000000000000), // 0.001 ETH
),
],
);import 'package:permissionless_passkeys/permissionless_passkeys.dart';
// Register a passkey
final signer = PassKeySigner(options: PassKeysOptions(
namespace: 'myapp.com',
name: 'My App',
sharedWebauthnSigner: SafeWebAuthnSigners.sharedSigner,
));
final passkey = await signer.register('user@example.com', 'User Name');
final credential = WebAuthnCredential.fromPassKeyPair(passkey);
// Create a WebAuthn-authenticated smart account
final account = WebAuthnSafeSmartAccount(
WebAuthnSafeSmartAccountConfig(
owner: WebAuthnOwner(credential: credential, rpId: 'myapp.com'),
credential: credential,
chainId: Chain.sepolia.id,
publicClient: publicClient,
),
);This project uses Melos 6.x for monorepo management. I use Melos 6.x rather than 7.x due to known conflicts between Melos 7's pub workspaces and path dependencies.
# Install dependencies (Melos is a dev dependency)
dart pub get
# Bootstrap the workspace (links local packages via pubspec_overrides.yaml)
dart run melos bootstrap# Run tests across all packages
dart run melos test
# Run static analysis
dart run melos analyze
# Format code
dart run melos format
# Clean build artifacts
dart run melos cleanFor convenience, you can install Melos globally:
dart pub global activate melos
# Then use without "dart run"
melos bootstrap
melos testpermissionless-dart/
├── packages/
│ ├── permissionless/ # Core ERC-4337 package
│ │ ├── lib/
│ │ ├── test/
│ │ └── example/
│ └── permissionless_passkeys/ # WebAuthn extension
│ ├── lib/
│ ├── test/
│ └── example/
├── melos.yaml # Monorepo configuration
└── README.md
- SimpleSmartAccount - Minimal ERC-4337 account
- SafeSmartAccount - Safe (Gnosis Safe) smart account
- KernelSmartAccount - ZeroDev Kernel smart account
- WebAuthnSafeSmartAccount - Safe with WebAuthn shared signer
- WebAuthnKernelSmartAccount - Kernel with WebAuthn validator (v0.3.x)
The SDK supports any EVM chain with ERC-4337 infrastructure:
- Ethereum Mainnet & Sepolia
- Polygon, Arbitrum, Optimism, Base
- And many more...
See the permissionless package for the full chain list.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes using conventional commits
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE for details.