EIP-7896 wallet_sendCalls ABI attachment feature (ABI attachment in `wallet_sendCalls`)

No call decision · Security & privacy · EIP status Stagnant · created 2025-02-27

An EIP-5792 extension that lets an app attach a contract ABI to a wallet_sendCalls request, so the wallet can decode the transaction data and show it to the user.

Why it is needed

Right now wallets only receive a transaction's data field as a raw byte string. They cannot tell which function is being called or what values are being passed, so users end up approving without properly confirming what they are signing. This kind of 'blind signing' is widespread. Wallets either guess from a list of known function selectors or pull the ABI from a centralized source-code verification repository, and both approaches fail for newly deployed contracts or when an attacker has deliberately caused a selector collision. The app (dApp) requesting the transaction, on the other hand, already knows the ABI of the contract it is calling, so attaching it directly to the request lets the wallet decode the calldata using trustworthy information and show it to the user.

What changes

Today

After EIP-7896

Who is affected

In depth

interfaces capability structure

A global capability called interfaces is added to the wallet_sendCalls request defined in EIP-5792. This field is an object keyed by contract address, with values holding a version and a spec. It is recommended (SHOULD) that addresses be compared against the to field in the calls array with exact case matching, and it is acceptable (MAY) for an address in calls to be absent from interfaces or for interfaces to contain addresses not present in calls.

abi-v1 and abi-v2 versions

Two versions are initially defined: abi-v1 and abi-v2. Both refer to the Contract ABI defined by Solidity and adopted by other languages, and the spec must (MUST) be provided as the array form described in the 'Contract ABI Specification · JSON' section of the Solidity documentation. The v1-v2 distinction corresponds to Solidity's pragma abicoder v1/v2 (or experimental ABIEncoderV2), and Vyper implements abi-v2. The array may also include event and error descriptions besides functions, but apps should (SHOULD) exclude irrelevant entries.

The optional flag

Apps are recommended (SHOULD) to mark the interfaces field as optional. This lets the user proceed with the request even if the wallet does not support that capability or a particular spec version. When marked optional, the wallet may (MAY) ignore interface versions it does not support.

Wallet decoding and verification

Wallets are recommended (SHOULD) to use the provided interface spec to decode the data of each entry in the calls array and show the function arguments to the user. Wallets may (MAY) also verify the provided spec against a trusted or verified spec database. This serves as a safeguard against apps attaching an incorrect ABI to deceive the user.

wallet_getCapabilities response

Wallets must (MUST) include, under the interfaces capability in the wallet_getCapabilities response, whether it is supported along with a versions array listing the supported spec versions. An example response looks like {"interfaces": {"supported": true, "versions": ["abi-v1", "abi-v2"]}}.

What remains undecided

This EIP currently has a status of Stagnant, and its Rationale and Security Considerations sections are left empty as 'TODO' and 'Needs discussion' respectively, so it has not yet been sufficiently discussed. No fork inclusion decisions or further debate have been found in call records either. The specification content may change or be refined going forward.

Original EIP · ← EIPs