hiero-ledger / hiero-ledger/hiero-sdk-java
Support Pectra EVM Type 4 Transaction Encoding (EIP-7702)
- Dominant language
- Java
- Stars
- 264
- Forks
- 192
- Avg merge
- 2d
- Merged PRs (30d)
- 39
Description
## Context
Ethereum's [Pectra upgrade](https://ethereum.org/roadmap/pectra/) (EIP-7600) activated on May 7, 2025. To maintain EVM compatibility, Hiero must adopt the applicable EIPs from this release.
[HIP-1341](https://hips.hedera.com/hip/hip-1341) defines the Hiero adoption of the Pectra release, distinguishing which EIPs are applicable to Hiero versus non-applicable. Of the twelve Pectra EIPs, three are applicable:
| EIP | Title | SDK Impact |
|-----|-------|-----------|
| [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) | Set EOA Account Code | **Yes** — see [HIP-1340](https://hips.hedera.com/hip/hip-1340) |
| [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) | Precompile for BLS12-381 curve operations | No — consensus node change only |
| [EIP-7623](https://eips.ethereum.org/EIPS/eip-7623) | Increase calldata cost | No — consensus node and JSON-RPC relay change only |
The remaining nine EIPs are non-applicable to Hiero (blob support, Ethereum validators, or ETH 2.0 features not present in Hiero).
## Dependencies
- [HIP-1341: Support for Ethereum Pectra Release](https://hips.hedera.com/hip/hip-1341) — umbrella HIP
- [HIP-1340: EOA Code Delegation](https://hips.hedera.com/hip/hip-1340) — SDK design specification for EIP-7702
- [Consensus node epic #20043](https://github.com/hiero-ledger/hiero-consensus-node/issues/20043) — upstream consensus node work; SDK integration requires a consensus node release that includes EIP-7702 support
## What the SDKs Will Implement
All SDK work is driven by [HIP-1340](https://hips.hedera.com/hip/hip-1340), which implements EIP-7702 (EOA Code Delegation). This feature allows EOAs to delegate code execution to a smart contract, enabling advanced account abstraction use cases such as transaction batching, gas sponsorship, and privilege de-escalation.
### New Types
**`Authorization`** — Represents an EIP-7702 authorization tuple used to delegate code execution from an EOA to a smart contract address.
**`EthereumTransactionDataEip7702`** — Encodes an Ethereum Type 4 transaction (EIP-7702) that includes an authorization list.
### Updated APIs
**`AccountCreateTransaction`** — New `delegationAddress` field (nullable `EvmAddress`) that sets the EOA code delegation on account creation.
**`AccountUpdateTransaction`** — New `delegationAddress` field (nullable `EvmAddress`) that sets or clears the EOA code delegation. Setting to 20 zero-bytes or `null` clears any existing delegation.
**`AccountInfo`** — New `delegationAddress` field (nullable, immutable `EvmAddress`) returned when querying an account that has a delegation set.
Full API specification is in [`proposals/hips/hip-1340.md`](https://github.com/hiero-ledger/sdk-collaboration-hub/blob/main/proposals/hips/hip-1340.md).
## SDK Implementation Tasks
Each SDK must:
- [ ] Add `Authorization` type
- [ ] Add `EthereumTransactionDataEip7702` type
- [ ] Update `AccountCreateTransaction` with `delegationAddress` setter/getter
- [ ] Update `AccountUpdateTransaction` with `delegationAddress` setter/getter (including null/zero-address clear)
- [ ] Update `AccountInfo` with `delegationAddress` field
- [ ] Add unit tests
- [ ] Add integration tests (against a network that supports Pectra)
Contributor guide
Assessment
This issue has not been assessed yet.