Crypto Training
Smart Accounts in Practice: Deep Technical Comparison of 10 Implementations
A code-first, risk-first deep dive of Coinbase, MetaMask, Thirdweb, Nexus, Light, Kernel, Safe, SimpleAccount, Solady, and Trust smart accounts: signature models, module systems, upgrades, replay controls, and security tradeoffs.
Smart accounts are no longer one design space. They are a family of security architectures.
Two teams can both say “ERC-4337 smart account” and still ship radically different trust boundaries:
- single signer vs multi-signer vs delegated authority graphs
- static wallet logic vs module systems vs diamond/facet dispatch
- minimal upgrade hooks vs powerful self-upgrade paths
- strict replay domains vs explicit replayability lanes
- validation-only plugins vs execution-time hooks with arbitrary code
This post is a deep, code-referenced comparison of the following implementations:
- Coinbase Smart Wallet
- MetaMask Smart Account (Delegation Framework DeleGator family)
- Thirdweb Smart Account
- Nexus Smart Account
- Light Smart Account
- Kernel (ZeroDev) Smart Account
- Safe Smart Account (v1.5.0 core repo)
- Simple Smart Account (eth-infinitism/account-abstraction v0.9.0)
- Solady Smart Account
- Trust Smart Account (Barz)
The emphasis is features vs risk. For each design, we ask:
- What capability is being bought?
- What new exploit or operational surface is being opened?
- Which control reduces that surface?
Scope and methodology#
I used local source snapshots and pinned each implementation to a specific commit so links stay stable.
Baseline references#
- ERC-4337 spec: https://eips.ethereum.org/EIPS/eip-4337
- viem smart accounts docs: https://viem.sh/account-abstraction/accounts/smart
- ERC-4337 docs portal: https://docs.erc4337.io/index.html
- Hacken overview: https://hacken.io/discover/erc-4337-account-abstraction/
- Cyfrin glossary: https://www.cyfrin.io/glossary/erc-4337
- QuickNode part 1: https://www.quicknode.com/guides/ethereum-development/wallets/account-abstraction-and-erc-4337
- QuickNode part 2: https://www.quicknode.com/guides/ethereum-development/wallets/account-abstraction-and-erc-4337-pt-2
- Alchemy overview: https://www.alchemy.com/overviews/what-is-account-abstraction
Code snapshots#
- Coinbase:
coinbase/smart-wallet@503363d7a7bc1dd38fd6a4cf2e2778203d0a0d5c - Light:
alchemyplatform/light-account@9368be5c9d627c4b8710f5a4c66e4cbff61399a0 - Kernel:
zerodevapp/kernel@a4b75ee53bd3fc71fa81b8b82d9e078c3d75917e - Nexus:
bcnmy/nexus@7db9b00b7288eaefbe0124abd9ed2daa3f4ae2cc - Thirdweb:
thirdweb-dev/contracts@0da770f27209774061e118401e8b9796ead97ced - Solady:
Vectorized/solady@90db92ce173856605d24a554969f2c67cadbc7e9 - Safe:
safe-global/safe-smart-account@dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be - SimpleAccount:
eth-infinitism/account-abstraction@b36a1ed52ae00da6f8a4c8d50181e2877e4fa410 - MetaMask:
MetaMask/delegation-framework@b553aae72e4dcb704d927b567d839d38f7546d21 - Trust:
trustwallet/barz@86bc46378f5055561d841ca0880c4f4cb1cef988
One architecture, many trust boundaries#
All compared systems plug into this broad flow. They differ in where they add complexity.
10 implementations, side by side#
| Implementation | Validation model | Extensibility | Upgrade model | Signature breadth | Dominant risk class |
|---|---|---|---|---|---|
| Coinbase Smart Wallet | owner-indexed EOA or P256/WebAuthn | Limited built-in owner mgmt + replayable lane | UUPS | EOA + P256/WebAuthn | Replay lane and upgrade path coupling |
| MetaMask DeleGator | ERC-4337 + delegation graph validation | DelegationManager + caveat enforcers | UUPS-style in proxy pattern | EOA, multisig, hybrid P256, 7702 variants | Delegation policy/caveat misconfiguration |
| Thirdweb Account | account-permissions-based signer checks | Permission system + extension contracts | Variant dependent | EOA signers with scoped permissions | Permission scope drift and misapproval |
| Nexus | nonce-mode validator routing + prevalidation hooks | Full module matrix (validator, executor, fallback, hooks) | UUPS | Validator-dependent | Module composition and hook complexity |
| Light Account | simple typed signature prefix dispatch | Single-owner and multi-owner variants | UUPS | EOA + contract signatures | Signature type confusion and owner management errors |
| Kernel | nonce-encoded validation modes + permissions | ERC-7579-style validators/hooks/executors/fallback | Upgradeable implementation slot | Validator/signer module dependent | Mode/nonce/selector access misconfigurations |
| Safe v1.5.0 | multisig EIP-712 tx hash checks | Modules + transaction/module guards + fallback handler | Singleton + proxy deployment | EOA and contract signatures | Module trust and guard bypass assumptions |
| SimpleAccount | minimal owner ECDSA | Minimal | UUPS | ECDSA owner | Missing controls by design (feature poverty) |
| Solady ERC4337 | lightweight owner signature path | Rich direct ops (delegateExecute, storageStore) | UUPS | ERC1271 nested EIP-712 + ECDSA | Powerful primitives becoming footguns |
| Trust Barz | diamond-routed account + pluggable verification facets | Facets, guardian, lock, migration | Diamond facet replacement | secp256k1 and secp256r1 passkey style | Diamond/facet governance complexity |
1) Coinbase Smart Wallet#
What it does#
Coinbase’s design focuses on practical UX features while remaining relatively opinionated:
- multiple owners stored as bytes (address or pubkey)
- owner selection by index for compact calldata/signatures
- EOA and P256/WebAuthn validation paths
- explicit replayable transaction lane for selected self-calls
- UUPS upgrades with additional code-existence checks in replayable flows
Key code:
CoinbaseSmartWallet.sol: https://github.com/coinbase/smart-wallet/blob/503363d7a7bc1dd38fd6a4cf2e2778203d0a0d5c/src/CoinbaseSmartWallet.solMultiOwnable.sol: https://github.com/coinbase/smart-wallet/blob/503363d7a7bc1dd38fd6a4cf2e2778203d0a0d5c/src/MultiOwnable.solERC1271.sol: https://github.com/coinbase/smart-wallet/blob/503363d7a7bc1dd38fd6a4cf2e2778203d0a0d5c/src/ERC1271.solCoinbaseSmartWalletFactory.sol: https://github.com/coinbase/smart-wallet/blob/503363d7a7bc1dd38fd6a4cf2e2778203d0a0d5c/src/CoinbaseSmartWalletFactory.sol
Feature design details#
- Replayable nonce lane: https://github.com/coinbase/smart-wallet/blob/503363d7a7bc1dd38fd6a4cf2e2778203d0a0d5c/src/CoinbaseSmartWallet.sol#L43-L68
- Validation branch for replayable execution path: https://github.com/coinbase/smart-wallet/blob/503363d7a7bc1dd38fd6a4cf2e2778203d0a0d5c/src/CoinbaseSmartWallet.sol#L154-L197
- Selector allowlist for replayable self-calls: https://github.com/coinbase/smart-wallet/blob/503363d7a7bc1dd38fd6a4cf2e2778203d0a0d5c/src/CoinbaseSmartWallet.sol#L281-L292
- EOA vs WebAuthn signature switch: https://github.com/coinbase/smart-wallet/blob/503363d7a7bc1dd38fd6a4cf2e2778203d0a0d5c/src/CoinbaseSmartWallet.sol#L318-L346
- Cross-account replay-safe ERC-1271 wrapping: https://github.com/coinbase/smart-wallet/blob/503363d7a7bc1dd38fd6a4cf2e2778203d0a0d5c/src/ERC1271.sol#L7-L13
Risk profile#
- Replay lane risk: controlled cross-chain replay is useful, but if the allowlist expands incorrectly, replay scope can widen fast.
- Upgrade coupling risk: replayable path includes upgrade selector, so upgrade governance quality directly impacts replay risk.
- Index-owner mismatch risk: index-based signature wrappers reduce calldata, but wrong index resolution creates sharp operational failure modes.
2) MetaMask Smart Account (Delegation Framework DeleGator)#
What it does#
MetaMask’s local implementation is the DeleGator family: smart accounts that combine ERC-4337 execution with a first-class delegation system.
Key code:
DeleGatorCore.sol: https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/DeleGatorCore.solHybridDeleGator.sol: https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/HybridDeleGator.solMultiSigDeleGator.sol: https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/MultiSigDeleGator.solEIP7702StatelessDeleGator.sol: https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/EIP7702/EIP7702StatelessDeleGator.solDelegationManager.sol: https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/DelegationManager.sol
Feature design details#
- Core supports delegation redemption plus ERC-4337 validation path: https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/DeleGatorCore.sol#L160-L169 and https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/DeleGatorCore.sol#L267-L279
- Storage-clearing default on upgrade (safer migration posture, but easy to misuse if not expected): https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/DeleGatorCore.sol#L393-L396
- Hybrid signer model (EOA + P256/WebAuthn-like): https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/HybridDeleGator.sol#L369-L389
- Multisig sorted-signature threshold checks: https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/MultiSigDeleGator.sol#L328-L359
- 7702 stateless variant check: https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/EIP7702/EIP7702StatelessDeleGator.sol#L54-L58
- DelegationManager validates chain of delegations and runs caveat hooks pre/post execution: https://github.com/MetaMask/delegation-framework/blob/b553aae72e4dcb704d927b567d839d38f7546d21/src/DelegationManager.sol#L126-L205
Risk profile#
- Delegation graph risk: more expressiveness means more policy states to audit.
- Caveat enforcer risk: each enforcer is code-level authority shaping execution.
- Upgrade migration risk: clearing storage by default can brick behavior if migration choreography is poor.
3) Thirdweb Smart Account#
What it does#
Thirdweb leans into signer permissions and factory-driven account registries.
Key code:
AccountCore.sol: https://github.com/thirdweb-dev/contracts/blob/0da770f27209774061e118401e8b9796ead97ced/contracts/prebuilts/account/utils/AccountCore.solAccountExtension.sol: https://github.com/thirdweb-dev/contracts/blob/0da770f27209774061e118401e8b9796ead97ced/contracts/prebuilts/account/utils/AccountExtension.solAccount.sol: https://github.com/thirdweb-dev/contracts/blob/0da770f27209774061e118401e8b9796ead97ced/contracts/prebuilts/account/non-upgradeable/Account.solBaseAccountFactory.sol: https://github.com/thirdweb-dev/contracts/blob/0da770f27209774061e118401e8b9796ead97ced/contracts/prebuilts/account/utils/BaseAccountFactory.sol
Feature design details#
- Entrypoint override support: https://github.com/thirdweb-dev/contracts/blob/0da770f27209774061e118401e8b9796ead97ced/contracts/prebuilts/account/utils/AccountCore.sol#L69-L76
- Permission-aware signer validation for target lists and per-tx native limits: https://github.com/thirdweb-dev/contracts/blob/0da770f27209774061e118401e8b9796ead97ced/contracts/prebuilts/account/utils/AccountCore.sol#L90-L163
- UserOp signature validation flows into permission windows: https://github.com/thirdweb-dev/contracts/blob/0da770f27209774061e118401e8b9796ead97ced/contracts/prebuilts/account/utils/AccountCore.sol#L209-L225
- ERC-1271 path tied to approved targets for signers: https://github.com/thirdweb-dev/contracts/blob/0da770f27209774061e118401e8b9796ead97ced/contracts/prebuilts/account/utils/AccountExtension.sol#L73-L95
Risk profile#
- Permission explosion risk: many signer scopes can become hard to reason about during incident response.
- Target wildcard risk: wildcard target semantics are convenient but dangerous with weak operational controls.
- Registry/factory consistency risk: signer indexing callbacks must stay in sync with account state transitions.
4) Nexus Smart Account#
What it does#
Nexus is a heavily modular ERC-7579-style account with multiple validation modes and operational safeguards for hook failures.
Key code:
Nexus.sol: https://github.com/bcnmy/nexus/blob/7db9b00b7288eaefbe0124abd9ed2daa3f4ae2cc/contracts/Nexus.solModuleManager.sol: https://github.com/bcnmy/nexus/blob/7db9b00b7288eaefbe0124abd9ed2daa3f4ae2cc/contracts/base/ModuleManager.solBaseAccount.sol: https://github.com/bcnmy/nexus/blob/7db9b00b7288eaefbe0124abd9ed2daa3f4ae2cc/contracts/base/BaseAccount.solK1Validator.sol: https://github.com/bcnmy/nexus/blob/7db9b00b7288eaefbe0124abd9ed2daa3f4ae2cc/contracts/modules/validators/K1Validator.sol
Feature design details#
- Nonce-mode driven validation paths (
validate,module enable,prep): https://github.com/bcnmy/nexus/blob/7db9b00b7288eaefbe0124abd9ed2daa3f4ae2cc/contracts/Nexus.sol#L116-L137 - Module enable flow with signature-authorized install: https://github.com/bcnmy/nexus/blob/7db9b00b7288eaefbe0124abd9ed2daa3f4ae2cc/contracts/base/ModuleManager.sol#L152-L175
- Extensive module taxonomy and install/uninstall routing: https://github.com/bcnmy/nexus/blob/7db9b00b7288eaefbe0124abd9ed2daa3f4ae2cc/contracts/base/ModuleManager.sol#L191-L211
- Emergency hook uninstall timelock flow: https://github.com/bcnmy/nexus/blob/7db9b00b7288eaefbe0124abd9ed2daa3f4ae2cc/contracts/Nexus.sol#L266-L300
- PREP and ERC-7702 aware initialization logic: https://github.com/bcnmy/nexus/blob/7db9b00b7288eaefbe0124abd9ed2daa3f4ae2cc/contracts/Nexus.sol#L306-L334
Risk profile#
- Module composability risk: cross-module assumptions can fail in emergent ways.
- Hook liveness risk: malicious or broken hooks can impede critical paths; emergency uninstall helps but adds operational choreography.
- Mode parsing risk: nonce-driven multiplexing must be audited as protocol-level parsing logic.
5) Light Smart Account#
What it does#
Light keeps account logic relatively compact while supporting both single-owner and multi-owner variants with typed signature prefixes.
Key code:
BaseLightAccount.sol: https://github.com/alchemyplatform/light-account/blob/9368be5c9d627c4b8710f5a4c66e4cbff61399a0/src/common/BaseLightAccount.solLightAccount.sol: https://github.com/alchemyplatform/light-account/blob/9368be5c9d627c4b8710f5a4c66e4cbff61399a0/src/LightAccount.solMultiOwnerLightAccount.sol: https://github.com/alchemyplatform/light-account/blob/9368be5c9d627c4b8710f5a4c66e4cbff61399a0/src/MultiOwnerLightAccount.solMultiOwnerLightAccountFactory.sol: https://github.com/alchemyplatform/light-account/blob/9368be5c9d627c4b8710f5a4c66e4cbff61399a0/src/MultiOwnerLightAccountFactory.sol
Feature design details#
- Signature type enum dispatch (
EOA,CONTRACT,CONTRACT_WITH_ADDR): https://github.com/alchemyplatform/light-account/blob/9368be5c9d627c4b8710f5a4c66e4cbff61399a0/src/common/BaseLightAccount.sol#L16-L22 - Single-owner validation logic: https://github.com/alchemyplatform/light-account/blob/9368be5c9d627c4b8710f5a4c66e4cbff61399a0/src/LightAccount.sol#L114-L176
- Multi-owner validation with contract-owner address embedding: https://github.com/alchemyplatform/light-account/blob/9368be5c9d627c4b8710f5a4c66e4cbff61399a0/src/MultiOwnerLightAccount.sol#L131-L201
- Factory canonical ordering and owner count constraints: https://github.com/alchemyplatform/light-account/blob/9368be5c9d627c4b8710f5a4c66e4cbff61399a0/src/MultiOwnerLightAccountFactory.sol#L92-L115
Risk profile#
- Signature-type confusion risk: a one-byte type switch is efficient but parser strictness is critical.
- Owner-set maintenance risk in multi-owner mode.
- UUPS risk remains: upgrade governance quality determines final safety envelope.
6) Kernel (ZeroDev)#
What it does#
Kernel is an aggressively modular smart account architecture (ERC-7579 style) with validation modes, permissions, signer/policy modules, hooks, and fallback selector controls.
Key code:
Kernel.sol: https://github.com/zerodevapp/kernel/blob/a4b75ee53bd3fc71fa81b8b82d9e078c3d75917e/src/Kernel.solValidationManager.sol: https://github.com/zerodevapp/kernel/blob/a4b75ee53bd3fc71fa81b8b82d9e078c3d75917e/src/core/ValidationManager.solHookManager.sol: https://github.com/zerodevapp/kernel/blob/a4b75ee53bd3fc71fa81b8b82d9e078c3d75917e/src/core/HookManager.solECDSAValidator.sol: https://github.com/zerodevapp/kernel/blob/a4b75ee53bd3fc71fa81b8b82d9e078c3d75917e/src/validator/ECDSAValidator.sol
Feature design details#
- UserOp mode/type/id decoded from nonce: https://github.com/zerodevapp/kernel/blob/a4b75ee53bd3fc71fa81b8b82d9e078c3d75917e/src/Kernel.sol#L243-L247
- Validation pipeline supports validator, permission, and 7702 types: https://github.com/zerodevapp/kernel/blob/a4b75ee53bd3fc71fa81b8b82d9e078c3d75917e/src/core/ValidationManager.sol#L292-L343
- Replayable signature prefix support: https://github.com/zerodevapp/kernel/blob/a4b75ee53bd3fc71fa81b8b82d9e078c3d75917e/src/core/ValidationManager.sol#L303-L310
- Install routing for validators/executors/fallback/hook modules: https://github.com/zerodevapp/kernel/blob/a4b75ee53bd3fc71fa81b8b82d9e078c3d75917e/src/Kernel.sol#L334-L390
- Hook lifecycle management: https://github.com/zerodevapp/kernel/blob/a4b75ee53bd3fc71fa81b8b82d9e078c3d75917e/src/core/HookManager.sol#L14-L52
Risk profile#
- Configuration risk dominates: misconfigured selector grants or validator permissions can undermine security assumptions.
- Module lifecycle risk: install/uninstall data paths are complex and deserve invariant tests.
- Hook execution risk: any pre/post hook can become critical availability or integrity boundary.
7) Safe Smart Account (v1.5.0 core)#
What it does#
Safe v1.5.0 core remains multisig-first. It is not a “native 4337 account” in this repo; instead, it provides a robust multisig core with module and guard extensibility, and compatibility hooks for contract signatures.
Key code:
Safe.sol: https://github.com/safe-global/safe-smart-account/blob/dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be/contracts/Safe.solModuleManager.sol: https://github.com/safe-global/safe-smart-account/blob/dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be/contracts/base/ModuleManager.solGuardManager.sol: https://github.com/safe-global/safe-smart-account/blob/dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be/contracts/base/GuardManager.solCompatibilityFallbackHandler.sol: https://github.com/safe-global/safe-smart-account/blob/dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be/contracts/handler/CompatibilityFallbackHandler.solSafeProxyFactory.sol: https://github.com/safe-global/safe-smart-account/blob/dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be/contracts/proxies/SafeProxyFactory.sol
Feature design details#
- Core multisig transaction execution and signature checks: https://github.com/safe-global/safe-smart-account/blob/dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be/contracts/Safe.sol#L115-L207
- Ordered-owner multi-signature verification and support for EOA/contract/approved-hash signatures: https://github.com/safe-global/safe-smart-account/blob/dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be/contracts/Safe.sol#L287-L341
- Explicit module security warning in code comments: https://github.com/safe-global/safe-smart-account/blob/dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be/contracts/base/ModuleManager.sol#L51-L54
- Transaction guard + module guard support: https://github.com/safe-global/safe-smart-account/blob/dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be/contracts/base/GuardManager.sol#L71-L81 and https://github.com/safe-global/safe-smart-account/blob/dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be/contracts/base/ModuleManager.sol#L258-L270
- ERC-1271 compatibility fallback behavior: https://github.com/safe-global/safe-smart-account/blob/dc437e8fba8b4805d76bcbd1c668c9fd3d1e83be/contracts/handler/CompatibilityFallbackHandler.sol#L73-L86
Note on 4337 in this repo snapshot: the explicit 4337 artifact present is a dummy test module/handler, not production wallet logic:
Risk profile#
- Module trust risk is explicit and intentionally delegated to governance/ops.
- Guard correctness risk: weak or broken guards can create false confidence.
- Operational complexity risk grows with each enabled module and fallback handler.
8) Simple Smart Account (Infinitism v0.9)#
What it does#
SimpleAccount is the intentionally minimal reference account pattern.
Key code:
SimpleAccount.sol: https://github.com/eth-infinitism/account-abstraction/blob/b36a1ed52ae00da6f8a4c8d50181e2877e4fa410/contracts/accounts/SimpleAccount.solSimpleAccountFactory.sol: https://github.com/eth-infinitism/account-abstraction/blob/b36a1ed52ae00da6f8a4c8d50181e2877e4fa410/contracts/accounts/SimpleAccountFactory.sol
Feature design details#
- Single owner storage and validation: https://github.com/eth-infinitism/account-abstraction/blob/b36a1ed52ae00da6f8a4c8d50181e2877e4fa410/contracts/accounts/SimpleAccount.sol#L23-L40 and https://github.com/eth-infinitism/account-abstraction/blob/b36a1ed52ae00da6f8a4c8d50181e2877e4fa410/contracts/accounts/SimpleAccount.sol#L90-L97
- Execute authorization by owner or entry point: https://github.com/eth-infinitism/account-abstraction/blob/b36a1ed52ae00da6f8a4c8d50181e2877e4fa410/contracts/accounts/SimpleAccount.sol#L77-L87
- UUPS auth restricted to owner: https://github.com/eth-infinitism/account-abstraction/blob/b36a1ed52ae00da6f8a4c8d50181e2877e4fa410/contracts/accounts/SimpleAccount.sol#L122-L125
- Factory requires EntryPoint senderCreator as caller for account deployment: https://github.com/eth-infinitism/account-abstraction/blob/b36a1ed52ae00da6f8a4c8d50181e2877e4fa410/contracts/accounts/SimpleAccountFactory.sol#L33-L40
Risk profile#
- Feature poverty risk: minimalism reduces attack surface but omits many guardrails required in production ecosystems.
- Upgrade governance still required due UUPS.
- No native policy or rich auth model: external integrations must handle many concerns.
9) Solady ERC4337 Smart Account#
What it does#
Solady provides a compact but powerful baseline that many teams either use directly or fork.
Key code:
ERC4337.sol: https://github.com/Vectorized/solady/blob/90db92ce173856605d24a554969f2c67cadbc7e9/src/accounts/ERC4337.solERC4337Factory.sol: https://github.com/Vectorized/solady/blob/90db92ce173856605d24a554969f2c67cadbc7e9/src/accounts/ERC4337Factory.solERC1271.sol: https://github.com/Vectorized/solady/blob/90db92ce173856605d24a554969f2c67cadbc7e9/src/accounts/ERC1271.sol
Feature design details#
- Canonical EntryPoint v0.7 default: https://github.com/Vectorized/solady/blob/90db92ce173856605d24a554969f2c67cadbc7e9/src/accounts/ERC4337.sol#L85-L89
- Straightforward validateUserOp core: https://github.com/Vectorized/solady/blob/90db92ce173856605d24a554969f2c67cadbc7e9/src/accounts/ERC4337.sol#L103-L117
- Powerful delegate execution and storage write primitives with explicit guards: https://github.com/Vectorized/solady/blob/90db92ce173856605d24a554969f2c67cadbc7e9/src/accounts/ERC4337.sol#L266-L286 and https://github.com/Vectorized/solady/blob/90db92ce173856605d24a554969f2c67cadbc7e9/src/accounts/ERC4337.sol#L320-L330
- Nested EIP-712 ERC-1271 anti-replay workflow and ERC-7739 detection path: https://github.com/Vectorized/solady/blob/90db92ce173856605d24a554969f2c67cadbc7e9/src/accounts/ERC1271.sol#L122-L203
Risk profile#
- Power-feature risk:
delegateExecuteandstorageStoreare useful for account programmability, but are footguns if policy layers are weak. - Guard bypass risk if custom overrides alter storage/delegate guards incorrectly.
10) Trust Smart Account (Barz)#
What it does#
Trust’s Barz is a diamond-based modular account with extensive facet architecture: account execution, signature facets, migration, guardian controls, lock controls, fallback middleware, and registry gating.
Key code:
Barz.sol: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/Barz.solAccountFacet.sol: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/facets/AccountFacet.solDiamondCutFacet.sol: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/facets/base/DiamondCutFacet.solSignatureMigrationFacet.sol: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/facets/SignatureMigrationFacet.solGuardianFacet.sol: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/facets/GuardianFacet.solLockFacet.sol: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/facets/LockFacet.solSecp256k1VerificationFacet.sol: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/facets/verification/secp256k1/Secp256k1VerificationFacet.solSecp256r1VerificationFacet.sol: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/facets/verification/secp256r1/Secp256r1VerificationFacet.sol
Feature design details#
- Diamond fallback selector routing for facets: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/Barz.sol#L54-L82
- AccountFacet delegates signature validation to current verification facet selector: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/facets/AccountFacet.sol#L170-L190
- Diamond cut with guardian-owner approval logic: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/facets/base/DiamondCutFacet.sol#L75-L131
- Signature scheme migration with pending periods and explicit finalize transitions: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/facets/SignatureMigrationFacet.sol#L338-L437
- Secp256r1/WebAuthn-style verification path: https://github.com/trustwallet/barz/blob/86bc46378f5055561d841ca0880c4f4cb1cef988/contracts/facets/verification/secp256r1/Secp256r1VerificationFacet.sol#L187-L211
Risk profile#
- Diamond complexity risk is fundamental: selector maps + facet lifecycle + storage layout interaction is hard to audit.
- Recovery/guardian windows improve safety but add liveness and operational error modes.
- Verification migration safety depends on strict cut validation and robust approval semantics.
Cross-cutting security themes#
1) Replay safety is not one thing#
- Coinbase explicitly permits selected cross-chain replay lane.
- Solady and Coinbase both include anti cross-account replay logic in ERC-1271 paths.
- Delegation systems shift replay reasoning from nonce-only to authority graph state.
2) Extensibility is the largest risk multiplier#
Low-extensibility accounts fail by missing features. High-extensibility accounts fail by misconfiguration and unsafe module governance.
3) Upgradeability is a governance problem first#
- UUPS everywhere is not equal.
- The question is: who can trigger it, under what signatures, with what migration constraints, and with what rollback plan.
Practical decision framework#
- If your team cannot run strong module governance and incident response, do not start with maximal modularity.
- If you need rich delegation, formalize delegation caveat policy review as a first-class security process.
- If you need passkeys, budget for signature parsing and verification fuzzing.
- If you rely on upgrades, write and test explicit migration playbooks before mainnet.
Risk vs feature scorecard (qualitative)#
| Implementation | Feature richness | Security review burden | Ops burden | Blast radius of misconfig |
|---|---|---|---|---|
| SimpleAccount | Low | Low | Low | Medium |
| Light | Medium | Medium | Medium | Medium |
| Coinbase | Medium-high | Medium-high | Medium | High |
| Solady base | Medium-high | High | Medium | High |
| Safe core | High | High | High | High |
| Thirdweb | High | High | High | High |
| Kernel | Very high | Very high | Very high | Very high |
| Nexus | Very high | Very high | Very high | Very high |
| MetaMask DeleGator | Very high | Very high | Very high | Very high |
| Trust Barz | Very high | Very high | Very high | Very high |
“Very high” is not “bad.” It means the implementation is powerful and can be secure, but requires disciplined engineering and operations.
Concrete failure modes and why they matter#
The most useful way to compare these systems in audit practice is by asking what actually breaks in production.
Coinbase Smart Wallet#
- Failure mode: replayable lane allowlist accidentally expanded in future version.
- Incident class: cross-chain replay of management actions outside intended scope.
- Why this matters: replayability is a deliberate feature, so every selector in
canSkipChainIdValidationis effectively a policy commitment.
MetaMask DeleGator#
- Failure mode: caveat enforcer logic mismatch between intent and implementation.
- Incident class: delegated authority overreach.
- Why this matters: delegation chains are hard to reason about compositionally, and each caveat adds custom semantics.
Thirdweb#
- Failure mode: signer gets over-broad approved target set or stale permissions.
- Incident class: unauthorized but syntactically valid account actions.
- Why this matters: signer-level policy is powerful and can drift operationally even if core validation code is correct.
Nexus#
- Failure mode: wrong nonce mode or validator routing assumptions in clients.
- Incident class: denial of service, wrong-module validation, or bypassed expected flow.
- Why this matters: nonce-mode multiplexing is elegant but increases client and tooling correctness requirements.
Light#
- Failure mode: signature type byte and payload encoding mismatch.
- Incident class: validation failures or unintended validation path usage.
- Why this matters: type-dispatched signatures are compact but unforgiving when integrations are inconsistent.
Kernel#
- Failure mode: selector grants for a validator/permission set too wide.
- Incident class: privileged method reachability via an otherwise-valid module.
- Why this matters: module security depends on both module code and selector authorization topology.
Safe#
- Failure mode: high-trust module introduced with insufficient review.
- Incident class: complete Safe takeover through legitimate module powers.
- Why this matters: Safe’s module model intentionally delegates large authority; this is a governance problem, not a bytecode bug.
SimpleAccount#
- Failure mode: adopting it in production without compensating controls.
- Incident class: missing policy constraints and weak operational recoverability.
- Why this matters: minimal examples are excellent references, not complete risk frameworks.
Solady#
- Failure mode: exposing
delegateExecuteor directstorageStorepathways behind weak auth assumptions. - Incident class: storage corruption, implementation slot corruption attempts, or unexpected control-plane writes.
- Why this matters: Solady gives powerful primitives and assumes engineering maturity to constrain them.
Trust Barz#
- Failure mode: facet cut, migration, guardian windows, and verification facet assumptions diverge.
- Incident class: ownership model confusion, delayed recovery, or upgrade deadlocks.
- Why this matters: diamond accounts are systems of systems; safety depends on lifecycle coherence across facets.
Feature-to-risk mapping#
A good architecture decision is rarely “pick the most advanced system.” It is usually:
- pick the smallest feature set that still supports product goals
- prove operational discipline for the controls that architecture requires
- add complexity only when the team can absorb its review and incident-response burden
Audit checklist by architecture class#
Minimal account class (SimpleAccount, basic Light)#
- Validate signature malleability and digest domain assumptions.
- Confirm upgrade auth and initializer protections.
- Fuzz
executeand batch execution for revert bubbling and authorization.
Permissioned signer class (Thirdweb, Coinbase owner-index model)#
- Test every signer permission transition and revocation edge case.
- Validate wildcard target semantics.
- Confirm no confusion across signer type encodings.
Module-based class (Kernel, Nexus, Safe modules)#
- Build a complete module graph inventory and allowed call graph.
- Test hook failures and gas griefing around hook callbacks.
- Validate emergency uninstall and timelock behaviors under stress.
Delegation/facet-heavy class (MetaMask DeleGator, Trust Barz)#
- Prove delegation/facet state transitions with invariants.
- Fuzz authority-chain and caveat/facet cut ordering.
- Treat migration flows as privileged operations requiring separate threat models.
Final takeaways#
- “ERC-4337 compatible” does not define your risk profile; your authorization and extensibility model does.
- The strongest differentiator between these designs is not signature algorithm choice. It is how much policy logic you let execute at validation and execution time.
- Features and risk scale together. Every step toward modularity and delegation requires an equal step in security process maturity.
If you are selecting an account architecture, start with your operational security budget, then choose the most constrained design that still meets product requirements.