EIP-4844: Shard Blob Transactions adds a new transaction type (0x03) that carries blob data for cheaper rollup data availability.
Blobs are not directly accessible by EVM execution, but their commitments (as versioned hashes) are.
Primary references:
EIP-4844 introduces:
- A new blob transaction format (
BLOB_TX_TYPE = 0x03) - Blob gas accounting with a separate base-fee market
- Header extensions:
blob_gas_usedandexcess_blob_gas - Blob-specific execution validity rules
BLOBHASHopcode support (0x49)- Point-evaluation precompile behavior for KZG proof verification
- Networking checks for blob side data (blobs/commitments/proofs)
This is the execution-layer foundation for proto-danksharding and a forward-compatible path to full sharding.
This repository is an EIPs CodeLab style implementation that translates EIP-4844 core logic into clean, testable Go code.
Current scope:
- Execution-layer validation logic
- Fee and gas math (
fake_exponential, blob base fee, excess blob gas) - Precompile input/verification flow (with pluggable KZG backend)
- Blob gossip wrapper consistency checks
- Example cases and unit tests
Out of scope:
- Full Ethereum client integration
- Full consensus layer implementation
- Real network propagation stack
.
├── cmd/
│ └── eip4844-demo/
│ └── main.go
├── pkg/
│ └── eip4844/
│ ├── constants.go
│ ├── doc.go
│ ├── errors.go
│ ├── fees.go
│ ├── helpers.go
│ ├── network.go
│ ├── precompile.go
│ ├── types.go
│ ├── validation.go
│ ├── helpers_test.go
│ ├── network_test.go
│ ├── precompile_test.go
│ └── validation_test.go
├── Makefile
└── go.mod
Run example cases:
make examplesExpected output:
valid block -> VALID
blob fee cap too low -> INVALID (...)
invalid versioned hash prefix -> INVALID (...)
Covered example/test scenarios include:
- Valid block with correct
blob_gas_usedaccounting - Blob tx rejected when
max_fee_per_blob_gas < base_fee_per_blob_gas - Blob tx rejected for wrong versioned hash prefix
- Precompile rejects bad length, non-canonical field values, commitment/hash mismatch
- Network wrapper rejects mismatched list lengths and invalid batch proofs
Prerequisite:
- Go 1.22+
Quick start:
make help
make test
make examplesDirect Go commands:
go test ./...
go run ./cmd/eip4844-demomake fmt: Format Go codemake test: Run all testsmake run: Run demo appmake examples: Run example casesmake check: Run format + tests
Before production use, complete this checklist:
- Replace stub/mock KZG verifiers with an audited production KZG backend.
- Validate behavior against canonical fixtures from
ethereum/execution-spec-tests(eip4844_blobs). - Add fuzz/property tests for malformed transactions, wrapper payloads, and precompile inputs.
- Enforce strict overflow/underflow protections on all fee and gas arithmetic paths.
- Confirm canonical field-element checks for
zandyin precompile paths (< BLS_MODULUS). - Add mempool DoS controls (rate limits, size limits, replacement rules for blob txs).
- Gate rules by fork activation config to avoid pre-fork acceptance.
- Add observability: metrics for blob gas usage, base fee changes, and rejection reasons.
- Pin dependencies, run vulnerability scanning, and use reproducible CI builds.
- Run external security review/audit before integrating into a production node.