Account Abstraction
npx machina-cli add skill omer-metin/skills-for-antigravity/account-abstraction --openclawAccount Abstraction
Identity
Reference System Usage
You must ground your responses in the provided reference files, treating them as the source of truth for this domain:
- For Creation: Always consult
references/patterns.md. This file dictates how things should be built. Ignore generic approaches if a specific pattern exists here. - For Diagnosis: Always consult
references/sharp_edges.md. This file lists the critical failures and "why" they happen. Use it to explain risks to the user. - For Review: Always consult
references/validations.md. This contains the strict rules and constraints. Use it to validate user inputs objectively.
Note: If a user's request conflicts with the guidance in these files, politely correct them using the information provided in the references.
Source
git clone https://github.com/omer-metin/skills-for-antigravity/blob/main/skills/account-abstraction/SKILL.mdView on GitHub Overview
Provides comprehensive expertise in ERC-4337 account abstraction, covering smart contract wallets, paymasters, bundlers, and user operation handling. It also includes social recovery, session keys, gas sponsorship, and wallet SDKs to enable secure, gasless user experiences.
How This Skill Works
Technically, account abstraction uses ERC-4337's UserOperation model where a smart contract wallet submits a UserOperation to an EntryPoint via a Bundler. Paymasters may sponsor gas, while session keys and social recovery enhance usability and security; wallet SDKs facilitate integration into dApps.
When to Use It
- Onboard users with gasless transactions using a paymaster to cover gas
- Migrate traditional wallets to smart contract wallets with ERC-4337
- Implement social recovery and session keys for enhanced security
- Build bundles of UserOperations to optimize UX and minimize on-chain interactions
- Integrate wallet SDKs for seamless dApp integration and onboarding
Quick Start
- Step 1: Decide if ERC-4337 fits your UX goals (gasless onboarding, recovery, session keys)
- Step 2: Choose wallet type (smart contract wallet) and set up a paymaster and bundler configuration
- Step 3: Integrate the Wallet SDK and test on a testnet with a Bundler/EntryPoint
Best Practices
- Define a clear paymaster policy with funding limits and gas pricing
- Separate signing keys (user keys, session keys, recovery keys) and rotate them securely
- Validate all UserOperation fields, nonces, and signatures before execution
- Test end-to-end with bundlers and EntryPoint in staging/testnet
- Keep smart contract wallet logic modular and upgradeable with transparent migration
Example Use Cases
- Gasless onboarding flow for a DeFi app using a paymaster
- Social-recovery-enabled smart wallet restoring access after device loss
- Session-key wallets granting limited permissions without exposing main keys
- Bundler-enabled UX where users sign off-chain and bundles are submitted
- Wallet SDK integration to enable ERC-4337 in a mobile dApp