-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add ERC-7715 concept page #2345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ba12a01
Add ERC-7715 concept page
alexandratran c8cf451
Merge branch 'main' into 2238-7715-concepts
alexandratran 411af6f
add technical overview
alexandratran 6ba401b
minor edits
alexandratran 7171b85
Merge branch 'main' into 2238-7715-concepts
alexandratran 6f73317
Merge branch 'main' into 2238-7715-concepts
alexandratran 7e85442
edits and add image
alexandratran b5c76eb
edits
alexandratran 11d630a
minor edit
alexandratran fa326ad
minor edits
alexandratran 3c262d3
Merge branch 'main' into 2238-7715-concepts
alexandratran 7730883
edits
alexandratran 994fccd
Merge branch 'main' into 2238-7715-concepts
alexandratran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
description: Learn about MetaMask ERC-7715 permissions. | ||
keywords: [ERC-7715, 7715, permissions, wallet, smart account] | ||
--- | ||
|
||
# ERC-7715 permissions | ||
|
||
The Delegation Toolkit supports [ERC-7715](https://eips.ethereum.org/EIPS/eip-7715), which lets you request fine-grained permissions from a MetaMask user to execute transactions on their behalf. | ||
For example, a user can grant your dapp permission to spend 10 USDC per day to buy ETH over the course of a month. | ||
Once the permission is granted, your dapp can use the allocated 10 USDC each day to purchase ETH directly from the MetaMask user's account. | ||
|
||
ERC-7715 eliminates the need for users to approve every transaction, which is useful for highly interactive dapps. | ||
It also enables dapps to execute transactions for users without an active wallet connection. | ||
|
||
:::note | ||
This feature requires [MetaMask Flask 12.14.2](/snaps/get-started/install-flask) or later. | ||
::: | ||
|
||
## ERC-7715 technical overview | ||
|
||
[ERC-7715](https://eips.ethereum.org/EIPS/eip-7715) defines a JSON-RPC method `wallet_grantPermissions`. | ||
Dapps can use this method to request a wallet to grant the dapp permission to execute transactions on a user's behalf. | ||
`wallet_grantPermissions` requires a `signer` parameter, which identifies the entity requesting or managing the permission. | ||
Common signer implementations include wallet signers, single key and multisig signers, and account signers. | ||
|
||
The Delegation Toolkit supports multiple types of signers, but [an account signer is used in this documentation's examples](../guides/erc7715/execute-on-metamask-users-behalf.md) as a common implementation. | ||
With an account signer, a session account is created and used for the single purpose of requesting and redeeming ERC-7715 permissions, and does not contain tokens. | ||
The session account can be granted with permissions and redeem them as specified in [ERC-7710](https://eips.ethereum.org/EIPS/eip-7710). | ||
The session account can be a smart account or an externally owned account (EOA). | ||
|
||
The MetaMask user that the session account requests permissions from must be upgraded to a [MetaMask smart account](smart-accounts.md). | ||
|
||
## ERC-7715 vs. delegations | ||
|
||
ERC-7715 expands on regular [delegations](delegation/index.md) by enabling permission sharing *via the MetaMask browser extension*. | ||
|
||
With regular delegations, the dapp constructs a delegation and requests the user to sign it. | ||
These delegations are not human-readable, so it is the dapp's responsibility to provide context for the user. | ||
Regular delegations cannot be signed through the MetaMask extension, because if a dapp requests a delegation without constraints, the whole wallet can be exposed to the dapp. | ||
|
||
In contrast, ERC-7715 enables dapps (and AI agents) to request permissions from a user directly via the MetaMask extension. | ||
ERC-7715 requires a permission configuration which displays a human-readable confirmation for the MetaMask user. | ||
The user can modify the permission parameters if the request is configured to allow adjustments. | ||
|
||
For example, the following ERC-7715 permission request displays a rich UI including the start time, amount, and period duration for an [ERC-20 token periodic transfer](../guides/erc7715/use-permissions/erc20-token.md#erc-20-periodic-permission): | ||
|
||
<p align="center"> | ||
<img src={require("../assets/erc7715-request.png").default} alt="ERC-7715 request" width="450px" class="appScreen" /> | ||
</p> | ||
|
||
## ERC-7715 permissions lifecycle | ||
|
||
The ERC-7715 permissions lifecycle is as follows: | ||
|
||
1. **Set up a session account** - Set up a session account to execute transactions on behalf of the MetaMask user. | ||
It can be a [smart account](smart-accounts.md) or an externally owned account (EOA). | ||
|
||
2. **Request permissions** - Request permissions from the user. | ||
The Delegation Toolkit supports [ERC-20 token permissions](../guides/erc7715/use-permissions/erc20-token.md) and | ||
[native token permissions](../guides/erc7715/use-permissions/native-token.md). | ||
|
||
4. **Redeem permissions** - Once the permission is granted, the session account can redeem the permission, executing on the user's behalf. | ||
|
||
See [how to perform executions on a MetaMask user's behalf](../guides/erc7715/execute-on-metamask-user-behalf.md) to get started with the ERC-7715 lifecycle. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ const sidebar = { | |
'concepts/delegation/caveat-enforcers', | ||
], | ||
}, | ||
'concepts/erc7715', | ||
], | ||
}, | ||
{ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.