hadv / hadv/ethaura

Integrate EIP-7791 (GAS2ETH opcode) after Glamsterdam upgrade on Sepolia

Open
#133 0 comments 0 reactions 0 assignees View on GitHub
enhancement smart-contracts
Dominant language
JavaScript
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Overview

Track integration of EIP-7791 (GAS2ETH opcode) into EthAura smart accounts once the Glamsterdam upgrade is activated on Sepolia testnet.

## Background

EIP-7791 introduces a new `GAS2ETH` opcode (0xFC) that enables smart contracts to convert gas directly into ETH and send it to a specified address. This provides a native fee mechanism for decentralized applications.

**EIP Status**: Draft
**Proposed Upgrade**: Glamsterdam
**Reference**: https://eips.ethereum.org/EIPS/eip-7791

## Key Features of GAS2ETH

- Converts gas to ETH at current transaction's gas price
- Separate budget (initialized to tx.gas_limit) that doesn't affect normal execution gas
- Transfers ETH directly without executing recipient code (like beacon withdrawals)
- Automatically refunds on reverts
- DoS protection through budget limits

## Potential Use Cases for EthAura

### 1. Developer Fee Collection 💰
- Add optional developer fees to transactions
- Revenue scales with network usage
- Transparent, gas-based pricing

### 2. Passkey Infrastructure Funding 🔐
- Small fees for premium security features
- Fee for adding additional passkeys
- Fee for guardian-based recovery operations
- Fee for 2FA transactions

### 3. Subsidized Onboarding 🎁
- Collect fees from power users
- Use collected funds to sponsor gas for new users
- Sustainable user acquisition model

### 4. Modular Fee Architecture 🏗️
- Create separate `EthAuraFeeCollector` contract
- Distribute fees to treasury, development fund, etc.
- Flexible fee management

## Implementation Plan

### Phase 1: Monitoring (Current)
- [ ] Monitor EIP-7791 progress on [Ethereum Magicians](https://ethereum-magicians.org/t/eip-7791-gas2eth-opcode/21418)
- [ ] Track Glamsterdam upgrade timeline
- [ ] Watch for Sepolia testnet activation announcement

### Phase 2: Design (After EIP Finalization)
- [ ] Design fee structure and governance model
- [ ] Determine which operations should include fees
- [ ] Create user communication strategy
- [ ] Design `EthAuraFeeCollector` contract architecture

### Phase 3: Implementation (After Sepolia Activation)
- [ ] Add GAS2ETH support to `P256Account.sol`
- [ ] Implement fee collector contract
- [ ] Add fee configuration to factory
- [ ] Update SDK to handle fees
- [ ] Add fee display in UI

### Phase 4: Testing (Sepolia)
- [ ] Deploy updated contracts to Sepolia
- [ ] Test fee collection mechanisms
- [ ] Verify budget limits and DoS protection
- [ ] Test revert scenarios and refunds
- [ ] Gather community feedback

### Phase 5: Mainnet (After Mainnet Activation)
- [ ] Audit fee-related code changes
- [ ] Gradual rollout with optional fees
- [ ] Monitor user acceptance
- [ ] Iterate based on feedback

## Technical Considerations

### Smart Contract Changes

Potential integration points in `P256Account.sol`:

```solidity
function execute(address dest, uint256 value, bytes calldata func) external {
if (msg.sender != address(ENTRYPOINT)) revert OnlyEntryPoint();

// Optional: Charge developer fee using GAS2ETH
// assembly {
// let feeAmount := ... // Calculate fee
// let success := gas2eth(feeCollectorAddress, feeAmount)
// }

_call(dest, value, func);
}
```

### Benefits

✅ **Sustainable Funding**: Revenue scales with usage
✅ **Better UX**: Users already understand gas
✅ **Aligned Incentives**: Benefit when network activity is high
✅ **Transparent Pricing**: Predictable based on gas price
✅ **No Code Execution Risk**: Safer than regular transfers

### Risks & Mitigations

⚠️ **User Acceptance**: Clearly communicate fees to users
⚠️ **Competition**: Other AA wallets might not charge fees - justify value
⚠️ **Fee Optimization**: Ensure fees don't make EthAura uncompetitive

## Resources

- [EIP-7791 Specification](https://eips.ethereum.org/EIPS/eip-7791)
- [Ethereum Magicians Discussion](https://ethereum-magicians.org/t/eip-7791-gas2eth-opcode/21418)
- [Glamsterdam Upgrade Tracker](https://forkcast.org/upgrade/glamsterdam/)

## Next Steps

1. Monitor EIP-7791 progress and Glamsterdam upgrade timeline
2. Subscribe to Ethereum All Core Devs calls for updates
3. Wait for Sepolia testnet activation announcement
4. Begin design phase once EIP moves to "Final" status

---

**Priority**: Low (blocked on network upgrade)
**Timeline**: TBD (depends on Glamsterdam activation)
**Labels**: enhancement, future, smart-contracts, monetization

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.