tempo
tempo copied to clipboard
Change key authorization signing to EIP-712
Describe the change
Summary
-- Key authorization signatures in the protocol are currently RLP-encoded, which makes them difficult to sign with common wallets like MetaMask. We should migrate key authorization signing to the EIP-712 typed data standard so that wallets can natively sign the payload.
Motivation
- Wallet compatibility: MetaMask and other wallets do not support signing arbitrary RLP payloads, but they already support EIP-712 typed data.
- Developer ergonomics: Using the same EIP-712 flow as other Tempo transactions simplifies integrations and reduces bespoke signing paths.
- User clarity: Typed data provides clear signing prompts, reducing risk of incorrect or opaque approvals.
Proposal
- Define an EIP-712 domain and typed data schema for key authorizations that captures the current RLP fields (including spend limits and permissions).
- Update the keychain/key authorization flow to produce and verify EIP-712 signatures instead of RLP-encoded payloads.
- Ensure backwards compatibility plan is documented (e.g., if RLP signatures should be deprecated or temporarily supported).
- Update developer documentation and examples to reflect the new signing format.
Acceptance Criteria
- Key authorization signatures are generated and verified using EIP-712 typed data.
- Wallets that support EIP-712 (e.g., MetaMask) can sign key authorization payloads without custom flows.
- Documentation includes the new typed data schema and guidance for integrators.
- Tests cover EIP-712 signing and verification for key authorizations.
Additional context
No response