-
Notifications
You must be signed in to change notification settings - Fork 8
docs: updating 7702 details #942
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
base: main
Are you sure you want to change the base?
Conversation
🌿 Documentation Preview
|
| - Transaction APIs detect whether a user must first delegate via EIP-7702 | ||
| - If delegation is required, Transaction APIs prepare the correct authorization payload | ||
| - Your application prompts the user to sign when required | ||
| - We combines the delegation and transaction into a single onchain submission |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
| - We combines the delegation and transaction into a single onchain submission | |
| - We combine the delegation and transaction into a single onchain submission |
| EIP-7702 enables EOAs (Externally Owned Accounts) to delegate control to smart wallets that can execute code directly from their addresses. Users simply sign an authorization | ||
| payload to delegate, then their account can function as a smart wallet with access to all of the user's assets. Wallet APIs will prompt the user to sign this authorization | ||
| when the delegation is missing on the chain they're interacting with. | ||
| EIP-7702 enables EOAs (Externally Owned Accounts) to delegate control to smart wallets that can execute code directly from their addresses. When using Transaction APIs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we capitalize this here? it's capitalized below.
| EIP-7702 enables EOAs (Externally Owned Accounts) to delegate control to smart wallets that can execute code directly from their addresses. When using Transaction APIs: | |
| EIP-7702 enables EOAs (Externally Owned Accounts) to delegate control to Smart Wallets that can execute code directly from their addresses. When using Transaction APIs: |
|
|
||
| 1. An authorization signature request | ||
| 2. A user operation signature request | ||
| The authorization signature is **not** a `personal_sign` or `eth_sign` payload. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't 100% true.
The prepared authorization is technically in this shape:
{
type: "authorization",
data: {
address: "0xDelegationAddress",
nonce: "0xNonce",
},
chainId: "0xChainId",
signatureRequest: {
type: "eip7702Auth",
rawPayload: "0xRawHashToSignWithEthSign"
}
}The rawPayload can be signed by eth_sign if desired. But it's recommended to sign the authorization using the address, nonce, and chainId to remove trust assumptions.
| Signing an authorization signature request requires logic specific to the wallet being used. Examples: | ||
| Examples of signing utilities: | ||
| - [Viem](https://viem.sh/docs/eip7702/signAuthorization) | ||
| - [Cast](https://getfoundry.sh/cast/reference/wallet/sign-auth/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommending cast wallet sign-auth kinda opens a can of worms, because it technically returns an RLP-encoded authorization_list, which CONTAINS the authorization signature.
If you use that, you'd have to decode it like this (viem example):
import { fromRlp, serializeSignature } from "viem"
const getSig = (authorizationList: Hex) => {
const decoded = fromRlp(authorizationList);
const [chainId, address, nonce, yParity, r, s] = decoded;
const sig = serializeSignature({
r,
s,
yParity: yParity === "0x" ? 0 : Number(yParity),
});
return sig;
};| for Modular Account v2. If you wish to replace or remove this delegation, you'll need to relay the delegation yourself or use a third party service. | ||
| Viem has a guide for this [here](https://viem.sh/docs/eip7702/contract-writes). | ||
| Currently, Wallet APIs only support delegation to the following contract: | ||
| `0x69007702764179f14F51cdce752f4f775d74E139` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think it's worth mentioning here what this contract is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it would be good to mention here that it's MAv2 and removing the Wallet APIs currently only support relaying delegations for Modular Account v2. below since it's a bit repetitive.
Description
Related Issues
Changes Made
Testing
pnpm run validate)