PRACTICE
EIP-7702: universal Gas sponsorship and execution checks
The user confirmed once — but the wallet or quote changed since then. Can that approval still drive an execution? How universal Gas sponsorship stays both smooth and safe.
Practice scope: iOS transaction orchestration and cross-platform rule alignment
Why a confirmation can expire
This case covers universal Gas sponsorship for red packets, DApps, and native contract interactions.
A confirmation binds a wallet, chain, environment, target, and fee limit at a particular time. Later stages must check that these conditions still hold. Remembering that the user once approved a screen is insufficient to authorize changed execution.
An authorization target supplied by an external request or quote cannot automatically receive signing permission. Quoting, authentication, signing, and submission happen at different times, during which wallets, environments, and fees can change. The earlier flow also forced another quote after signing: even falling fees could cause repeated confirmation and eventually block execution.
Implementation and tradeoffs
Bind authorization checks to the trusted native environment
- Validate environment and target
- Confirm quote and fee limit
- Recheck wallet, environment and expiry
- Submit only while conditions hold
Switching away and back does not revive an old generation.
Before decryption and signing, validate the actual business environment, chain, and permitted target together. A page-provided network description cannot select the allowed targets. Quotes retain a native environment snapshot and generation, checked again at execution; switching away and back does not revive an old confirmation. Wallet changes also invalidate the original execution conditions.
This places authorization checks at the native execution boundary. Unknown combinations are rejected, so adding a chain requires configuration and verification rather than automatic acceptance of a remote quote.
Reuse confirmed material while the quote remains valid
For sponsored execution, a valid quote with unchanged context can retain its confirmed material and maximum fee. This avoids repeatedly changing the basis for confirmation just to obtain a newer quote. Expiry and environment or wallet changes still block execution. Self-funded execution retains nonce, fee, and gas-estimate checks; exceeding the confirmed budget requires confirmation again. Reuse applies to constrained execution material, not a lasting permission to sign.
Preserve ownership across batch calls and unknown outcomes
Authorization and subsequent calls retain the operation’s chain and targets. Principal and service fees use their respective asset precision. If a response disappears after submission, preserve ownership and investigate the original outcome before allowing a new intent to overwrite recovery. The operation-confirmation case covers request redelivery and terminal responses separately.
Testing the mechanism
Change the wallet, environment, and fee after confirmation. Check that switching away and back cannot revive old approval, and test valid, expired, and over-budget quotes separately.
ENGINEERING SCENARIO
Key engineering scenarios
Illustrative scenarios · not real product interfaces
The environment changes after confirmation
The original confirmation needs another check
The wallet, chain, or business environment may change between obtaining a quote and signing. Previously confirmed UI state does not automatically authorize a new execution.
Handling principleCheck the current operation context and stop if the conditions no longer match.
The quote is still valid
Keep the confirmed material and fee cap
Requesting another quote should not invalidate an otherwise valid confirmation. Reuse depends on the quote remaining valid and execution conditions staying consistent.
Handling principleReuse when conditions match; request confirmation again when the quote expires or limits are exceeded.
A batch has been submitted, but no result is available
Recover the original operation first
A missing immediate response does not mean execution never occurred onchain. Authorization, calls, and business outcomes must stay associated with the same operation.
Handling principlePreserve operation ownership and investigate the outcome before deciding what to do next.
- Check the authorization environment and targets
- Obtain and confirm the quote for this operation
- Build authorization and calls using each asset’s precision
- Execute or recover the original operation’s outcome
Expand a scenario to explore its state and how it is handled.