Skip to content

Commit

Permalink
Update ERC-7682: Add assets
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
lukasrosario authored Aug 5, 2024
1 parent 2922ed2 commit def486b
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions ERCS/erc-7682.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
eip: 7682
title: Auxiliary Funds Capability
description: A way for wallets to indicate to apps that they have access to additional funds
description: A capability allowing wallets to indicate that they have access to additional funds.
author: Lukas Rosario (@lukasrosario), Wilson Cusack (@wilsoncusack)
discussions-to: https://ethereum-magicians.org/t/erc-7682-auxiliary-funds-capability/19599
status: Draft
Expand All @@ -15,6 +15,11 @@ requires: 5792

An [EIP-5792](./eip-5792.md) compliant capability that allows wallets to indicate to apps that they have access to funds beyond those that can be accounted for by looking up balances onchain given the wallet's address.

A wallet's ability to access auxiliary funds is communicated to apps as part of its response to an [EIP-5792](./eip-5792.md) `wallet_getCapabilities` request. The following standard does not specify the source of these auxiliary funds, but some examples are:

- Funds from offchain sources that can be onramped and used just-in-time
- Wallets that manage many accounts, where assets across those accounts can be transfered to the required account before submitting a transaction requested by an app

## Motivation

Many applications check users' balances before letting them complete some action. For example, if a user wants to swap some amount of tokens on a dex, the dex will commonly block the user from doing so if it sees that the user does not have that amount of tokens at their address. However, more advanced wallets have features that let users access funds from other sources. Wallets need a way to tell apps that they have access to additional funds so that users using these more advanced wallets are not blocked by balance checks.
Expand All @@ -25,13 +30,20 @@ One new [EIP-5792](./eip-5792.md) wallet capability is defined.

### Wallet Implementation

To conform to this specification, wallets that wish to indicate that they have access to auxiliary funds MUST respond to `wallet_getCapabilities` calls with an `auxiliaryFunds` object with a `supported` field set to `true` for each chain they have access to auxiliary funds on. This specification does not put any constraints on the source of the auxiliary funds.
To conform to this specification, wallets that wish to indicate that they have access to auxiliary funds MUST, for each chain they have access to auxiliary funds on, respond to `wallet_getCapabilities` calls with an `auxiliaryFunds` object with a `supported` field set to `true`.

Wallets may also optionally specify which assets they have additional access to with an `assets` field, which maps to an array of addresses representing the assets the wallet might have additional access to. If a wallet does not respond with this optional array of assets, the application SHOULD assume the wallet has additional access to any asset.

This specification does not put any constraints on the source of the auxiliary funds.

In this specification, a chain's native asset (e.g. Ether on Ethereum) MUST be represented by "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" as specified by [EIP-7528](./eip-7528).

#### `wallet_getCapabilities` Response Specification

```typescript
type AuxiliaryFundsCapability = {
supported: boolean;
assets?: `0x${string}`[];
}
```
Expand All @@ -41,12 +53,20 @@ type AuxiliaryFundsCapability = {
{
"0x2105": {
"auxiliaryFunds": {
"supported": true
},
"supported": true,
"assets": [
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
]
}
},
"0x14A34": {
"auxiliaryFunds": {
"supported": true
"supported": true,
"assets": [
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"0x036CbD53842c5426634e7929541eC2318f3dCF7e"
]
}
}
}
Expand All @@ -66,10 +86,6 @@ An alternative we considered is defining a way for apps to fetch available auxil
The shape of this capability allows for a more advanced extension if apps feel more functionality is needed.
#### Auxiliary Funds per Asset
We could also specify auxiliary funds support per asset. We decided against this because this list could get quite large if a wallet has auxiliary funds supports for many assets, and a single boolean should be enough for apps to not block users from taking actions.
## Security Considerations
Apps MUST NOT make any assumptions about the source of auxiliary funds. Apps' smart contracts should still, as they would today, make appropriate balance checks onchain when processing a transaction.
Expand Down

0 comments on commit def486b

Please sign in to comment.