-
Notifications
You must be signed in to change notification settings - Fork 213
feat: cross-chain CREATE2 smart wallet factory #2451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gakonst
wants to merge
4
commits into
main
Choose a base branch
from
feat/cross-chain-create2-accounts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implements deterministic address derivation for Tempo smart wallets, ensuring the same passkey produces the same wallet address on all EVM chains. Key design decisions (per Oracle audit): - No proxy pattern to keep initCode identical across chains - Atomic deploy+initialize to prevent griefing/front-running - Chain-specific accountKeychain stored as factory immutable - Account index support for multiple wallets per passkey - Multi-key support for rotation without address change Includes: - CrossChainAccountFactory: CREATE2 factory for deterministic deployment - CrossChainAccount: Passkey-authenticated smart wallet - Comprehensive test suite (24 tests) Addresses: https://tempoxyz.slack.com/archives/C0A99L9RLHZ/p1770239877682879 Amp-Thread-ID: https://ampcode.com/threads/T-019c2a93-ed22-74de-918f-c74f24bf203e Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c2a93-ed22-74de-918f-c74f24bf203e Co-authored-by: Amp <amp@ampcode.com>
📊 Tempo Precompiles CoverageprecompilesCoverage: 16376/17309 lines (94.61%) File details
contractsCoverage: 164/329 lines (49.85%) File details
Total: 16540/17638 lines (93.77%) |
BREAKING CHANGE: CrossChainAccount no longer uses AccountKeychain precompile ## Problem The AccountKeychain is a Tempo-specific precompile that doesn't exist on other EVM chains (Ethereum, Base, Arbitrum, etc.). This broke the core value proposition of cross-chain deterministic addresses. ## Solution Replaced precompile-based authorization with pure Solidity signature verification using Solady's battle-tested libraries: - P256: Raw P-256 ECDSA signature verification - WebAuthn: Passkey/authenticator signature verification - ECDSA: Standard secp256k1 signature verification ## Changes - Remove accountKeychain storage and constructor parameter - Add KeyType enum (Secp256k1, P256, WebAuthnP256) inspired by ithacaxyz/account - Add ERC-1271 isValidSignature support - Add signature-based execute() with EIP-712 typed data - Add key expiry support - Update factory to remove chain-specific configuration ## Cross-Chain Compatibility The contract now works identically on ANY EVM chain without modification. Signature verification is done entirely in Solidity, no precompiles needed. Addresses feedback from @horsefacts and @jxom Ran 30 tests: 30 passed, 0 failed Amp-Thread-ID: https://ampcode.com/threads/T-019c2b95-3535-76e4-a61a-b60108fb6ad2 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c2c0c-be67-705a-b5be-a950b332e782 Co-authored-by: Amp <amp@ampcode.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements deterministic CREATE2-based address derivation for Tempo smart wallets, ensuring the same passkey produces the same wallet address on all EVM chains.
Problem
Users see their Tempo wallet address
0xfooand send funds to it on other chains (e.g., Base) where the wallet isn't deployed. With traditional CREATE-based deployment, addresses differ per chain → funds lost forever.Solution
Use CREATE2 to derive wallet addresses deterministically from passkey public key coordinates:
Key Design Decisions (Oracle-Audited)
initCodeidentical across chains (proxies need chain-specific impl addresses)indexparameterFiles
tips/ref-impls/src/CrossChainAccountFactory.sol- CREATE2 factorytips/ref-impls/src/CrossChainAccount.sol- Passkey-authenticated smart wallettips/ref-impls/test/CrossChainAccountFactory.t.sol- 24 tests (all passing)User Flow
(x, y)public key coordsfactory.getAddress(x, y)Tests
Migration Path
Existing CREATE-deployed wallets cannot be converted. Recommended UX:
Thread: https://tempoxyz.slack.com/archives/C0A99L9RLHZ/p1770239877682879
cc @georgios @varun @jxom