EIP-7896 · Stagnant · Interface · 2025-02-27
EIP-7896: ABI attachment in `wallet_sendCalls`
Adds an `interfaces` capability to `wallet_sendCalls` so dapps can attach contract ABIs, letting wallets decode calldata and show users what they are signing instead of raw hex.
What problem does it solve?
"Blind signing" is one of Ethereum's biggest user-safety problems. When a dapp asks a wallet to send a transaction, the wallet receives data as an opaque bytestring. To show something meaningful ("transfer 100 tokens to 0xf0c8…") the wallet must guess the contract's ABI, either from a database of 4-byte selectors (which fails for new contracts and can be fooled by deliberate selector collisions) or from a verified-source service (which is centralised).
Transaction simulation helps but cannot predict every outcome. The dapp, on the other hand, always knows the ABI it used to build the call. This EIP lets it hand that ABI to the wallet.
How it works
It extends the batch-call API of EIP-5792 with a new capability called interfaces:
- In a
wallet_sendCallsrequest,capabilities.interfacesmaps contract addresses (normally thetoaddresses incalls) to{ version, spec }. - Two versions are defined:
abi-v1andabi-v2, matching Solidity's ABI coder v1 and v2. Thespecis the standard Solidity JSON ABI array. It may include events and errors, but should be trimmed to what is relevant. - Dapps should set
optional: trueso the request still works on wallets that do not support the capability. - Wallets that support it should decode each call's
datawith the supplied ABI and display the arguments. They may cross-check the ABI against a database of verified or trusted specs. wallet_getCapabilitiesadvertises support with aversionsarray, e.g.["abi-v1", "abi-v2"].
Sample code
A wallet_sendCalls request with an attached ABI for an ERC-20 transfer:
await provider.request({
method: "wallet_sendCalls",
params: [{
version: "1.0",
from: account,
chainId: "0x1",
calls: [{ to: token, value: "0x0", data: transferCalldata }],
capabilities: {
interfaces: {
optional: true,
[token]: {
version: "abi-v2",
spec: [{
type: "function", name: "transfer", stateMutability: "nonpayable",
inputs: [{ name: "to", type: "address" }, { name: "value", type: "uint256" }],
outputs: [{ name: "", type: "bool" }],
}],
},
},
},
}],
});
Checking wallet support first:
{ "0x0": { "interfaces": { "supported": true, "versions": ["abi-v1", "abi-v2"] } } }
Things to know
- Status: Stagnant. The proposal has seen no recent activity and its Rationale and Security Considerations sections were left as TODO. Wallet support should not be assumed.
- An attached ABI is supplied by the dapp, which may itself be malicious. It improves readability, not trust; wallets are encouraged to validate it against trusted sources.
- Addresses in
interfacesare compared totoaddresses case-sensitively, so use consistent casing. - Builds on EIP-5792, which wallets expose through the standard EIP-1193 provider.