eip7702

Delegate smart contract code to EOAs using EIP-7702 Type 4 transactions in .NET.

2.3k|744|Updated Nov 23, 2015
One-click install
npx skills add https://github.com/Nethereum/Nethereum --skill eip7702
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: eip7702
Source: https://github.com/Nethereum/Nethereum/tree/main/plugins/nethereum-skills/skills/eip7702
Command: npx skills add https://github.com/Nethereum/Nethereum --skill eip7702

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Nethereum.Web3, Nethereum.Accounts.

What problem does it solve?

Ethereum externally owned accounts (EOAs) cannot execute smart contract logic, forcing developers to deploy separate smart accounts for features like batching and sponsored transactions. This Skill shows how to use Nethereum to implement EIP-7702 delegation, letting an EOA temporarily run delegate contract code while keeping its address, balance, and storage.

Core Features & Use Cases

  • Self-Delegation and Removal: Authorize an EOA to delegate execution to a smart contract, query delegation state via the 0xef0100 prefix, and remove delegation when no longer needed.
  • Sponsored and Batch Delegation: Let a sponsor account pay gas while sponsored accounts only sign authorizations, including batch sponsorship of multiple accounts in one transaction.
  • Low-Level Type 4 Transactions: Manually build, sign, and broadcast Transaction7702 with custom authorization lists, EIP-1559 fees, and inline authorizations attached to contract calls.
  • Use Case: Upgrade an existing EOA into a smart account supporting batched calls and gas sponsorship, then combine it with ERC-4337 account abstraction flows.

Quick Start

Ask the AI to generate C# code using Nethereum that delegates your EOA to a delegate contract address with EIP-7702 and then queries the delegation state.

Frequently Asked Questions about eip7702

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I delegate an EOA to a smart contract with EIP-7702 in .NET?

Use Nethereum's EIP7022 authorisation service from web3.Eth and call AuthoriseRequestAndWaitForReceiptAsync with the delegate contract address. The EOA's code is set to the 0xef0100 delegation prefix plus the contract address, so calls execute the delegate's code in the EOA's context.

How to sponsor EIP-7702 delegation gas fees for another account?

Use EIP7022SponsorAuthorisationService with the sponsor's transaction manager. The sponsored account signs only the authorization with its EthECKey, while the sponsor submits and pays for the transaction, and batch sponsorship accepts an array of keys.

Does EIP-7702 delegation persist across transactions?

Yes, delegation persists until explicitly removed by submitting a removal authorization. You can check the current state with IsDelegatedAccountAsync or GetDelegatedAccountAddressAsync, which inspect the account code for the 0xef0100 prefix.

Can hardware wallets sign EIP-7702 Type 4 transactions?

Yes, Ledger and Trezor hardware wallets, as well as AWS and Azure cloud KMS, support signing Transaction7702 through SignAsync. This allows delegation authorizations without exposing private keys in application code.

What are the gas costs and limitations of EIP-7702 authorizations?

Each authorization costs a 12,500 gas base plus 25,000 gas per account, whether new or existing. Delegation chaining is not supported, so only the first delegation level is resolved, and gas must be set manually for inline authorizations on contract calls.