Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 62 additions & 48 deletions KIPs/kip-279.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ created: 2025-11-24

## Abstract

Introduce the Blob transaction type that represents the existence of data blobs, corresponding KZG commitments and proofs. This KIP follows the latest Ethereum Fusaka specs and will be included in Kaia's Osaka Hardfork. Therefore, [EIP-4844](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md) is the baseline, but also includes the [EIP-7516](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7516.md) BLOBBASEFEE opcode and [EIP-7594](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7594.md) cell proof format. The blob per block limit was lowered to fit in Kaia's short 1-second block time. Since the limit is low, the target gas mechanism was removed for simplicity.
Introduce the Blob transaction type that represents the existence of data blobs, corresponding KZG commitments and proofs. This KIP follows the latest Ethereum Fusaka specs and will be included in Kaia's Osaka Hardfork. Therefore, [EIP-4844](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md) is the baseline, but also includes the [EIP-7516](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7516.md) BLOBBASEFEE opcode, [EIP-7594](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7594.md) cell proof format, and [EIP-7918](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7918.md) blob base fee calculation. The blob per block limit was lowered to fit in Kaia's short 1-second block time. Since the limit is low, the target gas mechanism was removed for simplicity.

## Motivation

Expand Down Expand Up @@ -38,7 +38,7 @@ Kaia wants to accommodate rollups for scalability and specialized features in L2
| `BYTES_PER_BLOB` | `BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB` = 131072 | 128 KB
| `GAS_PER_BLOB` | 131072 | (blobgas/blob). 1 blobgas/byte |
| `MAX_BLOB_GAS_PER_BLOCK` | 131072 | max 1 blob/block |
| `MIN_BASE_FEE_PER_BLOB_GAS` | 300000000000 | 300 gkei/blobgas |
| `BLOB_BASE_FEE_MULTIPLIER` | 8 | baseFeePerBlobGas = 8*baseFeePerGas |
| `BLOB_SIDECARS_RETENTION` | 1814400 | 21 days in blocks |

**Cell proof parameters**
Expand Down Expand Up @@ -73,7 +73,7 @@ All fields follow the same semantics as EIP-4844. Note that the `to` field canno

### Block header

The block header is extended with two new fields blob_gas_used and excess_blob_gas.
The block header is extended with two new fields blobGasUsed and excessBlobGas.

```py
class Header:
Expand Down Expand Up @@ -200,7 +200,7 @@ Rules below are similar to the EIP-4844 'Execution layer validation' specificati
```
4. For each BlobTx, `tx.maxFeePerBlobGas` is at least the calculated `baseFeePerBlobGas`.
```py
baseFeePerBlobGas = MIN_BASE_FEE_PER_BLOB_GAS
baseFeePerBlobGas = BLOB_BASE_FEE_MULTIPLIER * block.header.baseFeePerGas
for tx in block.transactions:
if tx.type == BLOB_TX_TYPE:
assert tx.maxFeePerBlobGas >= baseFeePerBlobGas
Expand Down Expand Up @@ -341,69 +341,82 @@ A new JSON-RPC API `eth_getBlobSidecarByTxHash` returns the stored `BlobTxSideca
}
```

#### eth_blobBaseFee

A new JSON-RPC API `eth_blobBaseFee` returns the expected next block's `baseFeePerBlobGas`. Clients may use this value to choose an appropriate `tx.maxFeePerBlobGas`. The expected value is `BLOB_BASE_FEE_MULTIPLIER * next baseFeePerGas`.

- Parameters: none
- Returns:
- `result`: The expected blob base fee in kei in hex string.
- Example
```sh
curl http://localhost:8551 -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0", "id":1, "method":"eth_blobBaseFee", "params":[]}' \
```
```json
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x2e90edd000"
}
```

#### eth_feeHistory, kaia_feeHistory

The `eth_feeHistory` and `kaia_feeHistory` APIs MAY return an additional array field `baseFeePerBlobGas` that contains the historic blob base fee over the requested block range.

## Rationale

### Blob gas fee
### Blob capacity

Consider the long-term infrastructure costs of accepting a blob-sized data into blockchain as calldata and blob. Assuming a 128 KB blob is constantly added every block (every second). Over a month, about 330GB of data via 2,600,000 blocks. Over a year, 4,000GB via 31,000,000 blocks.
Ethereum blobspace supply is 0.5 blobs/sec since Pectra hardfork's [EIP-7691](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7691.md) (target 6 blobs per block, 12 second block time). [Ethereum's blobspace utilization is currently at around 60%](https://www.binance.com/en/square/post/24317625438034). Ethereum is planning to reach 1.2 blobs/sec in the future after [EIP-7892 BPO2](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7892.md) hardfork.

There could be two ways to post blob data to blockchain.
This KIP proposes higher or similar capacity of 1 blobs/sec. This will be sufficient enough to accommodate several L2s.

- Storing in calldata: Send a regular transaction (e.g. type 0 LegacyTx or type 2 DynamicFeeTx) with calldata filled with 128 KB data.
- Sending BlobTx: Send a type 3 BlobTxWithBlobs. Its size is 134 KB as it includes 128 cell proofs.
The network should easily handle 1 blob per block because one blob (134 KB including cell proofs) is much smaller than the [theoretical block size limit of 10 MB](https://github.com/kaiachain/kaia/blob/f882207448f239d2d148e057ca1b950b031d5a46/params/protocol_params.go#L220-L222).

Estimate the computation, storage, and network costs for both methods.
### Blob base fee as a multiple of base fee

- Computing cost mainly consist of KZG proof verification
- Large calldata itself does not incur EVM execution.
- According to the estimation in [EIP-7918](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7918.md), batch-verifying `CELLS_PER_EXT_BLOB (128)` proofs costs roughly 15 times the `POINT_EVALUATION_PRECOMPILE (50000 gas)`. i.e. Verifying a blob costs about 750,000 gas.
- Storage cost is estimated as the cloud disk cost of 50 consensus nodes to persist the data
- Currently, calldata are indefinitely persisted. In the future, [EIP-4444 might](https://eips.ethereum.org/EIPS/eip-4444) be implemented so nodes store 1 year’s worth of data. i.e., large calldata constantly takes up 4,000 GB. We assume EIP-4444 in this calculation.
- With BlobTx, 21 days’ worth of data is constantly persisted. It calculates to 240GB.
- AWS Singapore region, EBS gp3 is priced at 0.096 USD per GB per month.
- Network cost is estimated as the cloud data transfer cost of a proposer sending the data to 50 consensus nodes every block.
- In both methods, the proposal includes the data as block body.
- AWS Singapore region, Outbound transfer to Internet priced at 0.12 USD per GB
- Gas cost is calculated according to Kaia Prague hardfork rules.
- Calldata pricing follows KIP-223 and EIP-7623. Assuming the calldata is random, mostly non-zero bytes. Then the floor data gas costs 40 gas per byte.
- Gas fee is calculated at the Mainnet’s lower bound base fee of 25 gkei, and the proposed min blob base fee of 300 gkei.
This KIP proposes the max 1 blobs per block (`MAX_BLOB_GAS_PER_BLOCK = TARGET_BLOB_GAS_PER_BLOCK = 1 * GAS_PER_BLOB`) parameter. Under this configuration, excessBlobGas is always zero.

| Infrastructure cost | 128KB calldata LegacyTx every block | 128KB BlobTx every block |
|-|-|-|
| Storage cost | $19,000 | $1,100 |
| Network cost | $2,000 | $2,100 |
| Infra cost per month | $21,000 | $3,200 |
| **Infra cost per transaction** | $0.0081 | $0.0012 |
| **Computing cost per transaction** | ~0 gas | 750,000 gas |
| Gas cost per transaction | 5,242,880 gas | 131,072 blobgas |
| **Gas fee per transaction** | 0.131 KAIA | 0.0393 KAIA |
EIP-4844 adjusts the blob base fee based on previous block's excessBlobGas. This mechanism cannot work in this KIP because MAX equals the TARGET.

Suppose gas fee is proportional to the sum of infrastructure cost and computing cost. Solving the following proportional expression implies that an appropriate gas fee of a blob is 0.038 KAIA.
EIP-7918 imposes an implicit lower bound ("reserve price") to the blob base fee. It is implicit in a way that excessBlobGas does not drop when the blob base fee is lower than the reserve price. Again, this mechanism cannot be applied as-is in this KIP because excessBlobGas does not rise at the first place. The reserve price here is a certain multiple of base fee.

```
Calldata: Infra $0.0081 + Compute 0 gas ~ 5,242,880 gas + 0 gas ~ 0.131 KAIA
BlobTx: Infra $0.0012 + Compute 750k gas ~ 777,000 gas + 750,000 gas ~ [0.038] KAIA
```
This KIP directly defines the blob base fee as a multiple of base fee, skipping the excessBlobGas logic. It inherits the the rationale of EIP-7918 to make BlobTxs pay for the computing cost it incurs.

Finally, derive the appropriate the blob base fee.
### Blob base fee multiplier

```
1,527,000 gas * 25 gkei/gas ~ 0.038 KAIA ~ 131,072 blobgas * 290 gkei/blobgas
```
The blob fee is priced relative to a large-calldata transaction price.

Therefore, `MIN_BASE_FEE_PER_BLOB_GAS` was decided to be 300 gkei, so that BlobTx cost is about 3.4x cheaper than calldata posting.
- Storing in calldata: Send a regular transaction with a 128 KB calldata.
- Sending BlobTx: Send a BlobTxWithBlobs. Its size is 134 KB including the 128 cell proofs.

### Blob capacity
#### Computing cost

Ethereum blobspace supply is 0.5 blobs/sec since Pectra hardfork's [EIP-7691](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7691.md) (target 6 blobs per block, 12 second block time). [Ethereum's blobspace utilization is currently at around 60%](https://www.binance.com/en/square/post/24317625438034). Ethereum is planning to reach 1.2 blobs/sec in the future after [EIP-7892 BPO2](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7892.md) hardfork.
Broadcasting a BlobTx incurs KZG proof verification to every node in the network. According to the estimation in [EIP-7918](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7918.md), batch-verifying `CELLS_PER_EXT_BLOB (128)` proofs costs roughly 15 times the `POINT_EVALUATION_PRECOMPILE (50000 gas)`. Therefore, we can estimate that verifying a blob costs about 750,000 gas.

This KIP proposes higher or similar capacity of 1 blobs/sec. This will be sufficient enough to accommodate several L2s.
#### Storage cost

The network should easily handle 1 blob per block because one blob (134 KB including cell proofs) is much smaller than the [theoretical block size limit of 10 MB](https://github.com/kaiachain/kaia/blob/f882207448f239d2d148e057ca1b950b031d5a46/params/protocol_params.go#L220-L222).
A significant storage burden is saved with BlobTx because sidecars are only persisted for a short period of time. In contrast, transaction calldata are stored indefinitely. For comparion, let us assume that [EIP-4444](https://eips.ethereum.org/EIPS/eip-4444) is activated in the future so that transaction calldata are stored for a year.

Storing a 128 KB calldata indefinitely (but 1 year in this calculation) is priced at 5,242,880 gas. With [KIP-223](https://github.com/kaiachain/kips/blob/main/KIPs/kip-223.md) and [EIP-7623](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7623.md), nonzero byte costs 40 gas per byte. Usually L2 rollup data are compressed blobs, so they are mostly nonzero random bytes. Therefore, `40 * 128 * 1024 = 5,242,880 gas`.

Proportionally, storing a 134 KB blob for 21 days should be priced at `(21day * 134KB) / (1year * 128KB) * 5,242,880 = 315,785 gas`

### Simplified fee mechanism
#### Blob base fee

Based on the computing and storage costs, a blob fee should be equivalent to paying an execution gas fee of `750,000 + 315,785 = 1,065,785 gas`. This is around 5 times cheaper than sending a large calldata. Now translate the gas cost to the unit of blob base fee.

```
(1,065,785 gas) * (baseFee kei/gas) ~ (1 blob) * (131072 blobgas/blob) * (blobBaseFee kei/blobgas)
blobBaseFee ~= (8.13 gas/blobgas) * (baseFee kei/gas)
```

This KIP proposes the max 1 blobs per block (`MAX_BLOB_GAS_PER_BLOCK = 1 * GAS_PER_BLOB`) parameter. Then target blobs, excess blob gas, dynamic blob base fee mechanisms become meaningless. Therefore, `baseFeePerBlobGas` is simply defined as the constant value `MIN_BASE_FEE_PER_BLOB_GAS = 300 gkei/blobgas`.
Therefore, `baseFeePerBlobGas = BLOB_BASE_FEE_MULTIPLIER (8) * baseFeePerGas`. For instance:
- When baseFeePerGas = 25 gkei,
- Calldata gas fee = `5,242,880 * 25gkei = 0.131 KAIA`
- BlobTx blob fee = `131072 * 8 * 25gkei = 0.026 KAIA` is 5x cheaper.

### Reject sidecar V0

Expand All @@ -423,6 +436,7 @@ Ethereum provides the sidecars via its [Beacon API `/eth/v1/beacon/blobs/{block_
- [EIP-4844: Shard Blob Transactions](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md)
- [EIP-7516: BLOBBASEFEE instruction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7516.md)
- [EIP-7594: PeerDAS - Peer Data Availability Sampling](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7594.md)
- [EIP-7918: Blob base fee bounded by execution cost](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7918.md)
- [Ethereum Deneb consensus specs](https://github.com/ethereum/consensus-specs/tree/master/specs/deneb)
- [Ethereum Fulu consensus specs](https://github.com/ethereum/consensus-specs/tree/master/specs/fulu)
- [Kaia BLOBHASH, BLOBBASEFEE, KZG precompile implementation](https://github.com/klaytn/klaytn/pull/2032)
Expand Down
Loading