Migrating to 2.0.0
During the EIP review process, there were changes to the initially proposed 1.0 version. This guide outlines the key changes between version 1.0 and the finalised 2.0.0 of EIP-5792, and provides guidance for migrating your implementation.
Major Changes
1. Version Number
The version number in requests has been updated from "1.0" to "2.0.0". This change reflects the significant updates to the specification during the review phase. Subsequent updates will follow SemVer.
2. Atomic Capability
The atomicBatch capability has been replaced with a more expressive atomic capability that has three states:
supported: The wallet will execute all calls atomically and contiguouslyready: The wallet is able to upgrade tosupportedpending user approval (e.g. via EIP-7702)unsupported: The wallet does not provide any atomicity or contiguity guarantees
Example response:
{
"0x1": {
"atomic": {
"status": "supported"
}
}
}3. Status Codes
The string-based status codes ("PENDING", "CONFIRMED") have been replaced with numeric status codes:
| Code | Description |
|---|---|
| 100 | Batch has been received by the wallet but has not completed execution onchain (pending) |
| 200 | Batch has been included onchain without reverts, receipts array contains info of all calls (confirmed) |
| 400 | Batch has not been included onchain and wallet will not retry (offchain failure) |
| 500 | Batch reverted completely and only changes related to gas charge may have been included onchain (chain rules failure) |
| 600 | Batch reverted partially and some changes related to batch calls may have been included onchain (partial chain rules failure) |
4. Request Structure
The wallet_sendCalls request structure has been updated:
chainIdis now a top-level property instead of being per-call- Added
idfield for batch identification - Added
atomicRequiredfield to specify atomic execution requirements - Removed per-call
chainIdfields
Example request:
{
"version": "2.0.0",
"chainId": "0x1",
"from": "0x...",
"calls": [
{
"to": "0x...",
"data": "0x...",
"value": "0x0"
}
],
"capabilities": {
"atomic": {
"required": true
}
}
}5. Response Structure
wallet_sendCalls Response
The wallet_sendCalls response structure has been updated:
- Changed from returning a simple string identifier to returning a structured object
- Added
capabilitiesfield for capability-specific metadata - The
idfield is now part of a structured response rather than being returned directly as a string
Version 1.0 response:
"0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"Version 2.0.0 response:
{
"id": "0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
}wallet_getCallsStatus Response
The wallet_getCallsStatus response structure has been updated:
- Added
versionfield - Added
idfield - Added
chainIdfield - Added
atomicfield to indicate how the batch was executed - Changed status to numeric codes
Example response:
{
"version": "2.0.0",
"id": "0x...",
"chainId": "0x1",
"status": 200,
"atomic": true,
"receipts": [...]
}6. Additional Changes
wallet_getCapabilities Parameters
The wallet_getCapabilities method now accepts an optional array of chain IDs:
Version 1.0:
["0xd46e8dd67c5d32be8058bb8eb970870f07244567"]Version 2.0.0:
["0xd46e8dd67c5d32be8058bb8eb970870f07244567", ["0x2105", "0x14A34"]]This allows apps to query capabilities for specific chains, rather than getting all capabilities for all chains.
wallet_getCallsStatus Response Fields
Additional fields have been added to the wallet_getCallsStatus response:
version: Indicates the version of the response formatatomic: Explicitly indicates whether the batch was executed atomically
These fields help apps understand the format of the response and how the batch was executed.
Migration Guide
For Wallets
- Update your version number to
"2.0.0"in all responses - Replace
atomicBatchcapability with the newatomiccapability - Update status codes to use numeric values
- Implement the new request/response structures
- Add support for the
atomicRequiredfield inwallet_sendCalls - Ensure proper handling of the
idfield for batch identification - Update
wallet_sendCallsto return a structured response withidandcapabilitiesfields - Add support for chain-specific capability queries in
wallet_getCapabilities - Include
versionandatomicfields inwallet_getCallsStatusresponses
For Apps
Note that Viem ^2.28.0 has been updated to support the latest specification
- Update your version number to
"2.0.0"in all requests - Update capability checks to use the new
atomiccapability format - Update status code handling to use numeric values
- Update request/response structure handling
- Add support for the
atomicRequiredfield when requiring atomic execution - Implement proper handling of the
idfield for batch identification - Update handling of
wallet_sendCallsresponse to expect a structured object instead of a string - Add support for chain-specific capability queries in
wallet_getCapabilities - Handle new
versionandatomicfields inwallet_getCallsStatusresponses
Backward Compatibility
While version 2.0.0 introduces significant changes, wallets and apps should maintain backward compatibility where possible:
- Wallets should continue to accept version
"1.0"requests and respond appropriately - Apps should be prepared to handle both old and new response formats
- When in doubt, check the version number in responses to determine the format
Example Migration
Here's an example of migrating a wallet_sendCalls request and response from version 1.0 to 2.0.0:
Version 1.0:
// Request
{
"version": "1.0",
"from": "0x...",
"calls": [
{
"to": "0x...",
"data": "0x...",
"value": "0x0",
"chainId": "0x1"
}
]
}
// Response
"0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"Version 2.0.0:
// Request
{
"version": "2.0.0",
"chainId": "0x1",
"from": "0x...",
"calls": [
{
"to": "0x...",
"data": "0x...",
"value": "0x0"
}
],
"capabilities": {
"atomic": {
"required": true
}
}
}
// Response
{
"id": "0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
"capabilities": {
"atomic": true
}
}