Sending EIP-4844 Blob Transactions with ethers.js and kzg-wasm
Source: Dev.to
Introduction
EIP‑4844 introduces blob transactions (Type 3) as part of Proto‑Danksharding. Sending blob transactions in practice comes with constraints around tooling, RPC support, and transaction preparation. This article summarizes hands‑on experimentation with ethers.js v6 and kzg‑wasm, focusing on what works, what does not, and how to get a minimal setup running.
If you just want to create a blob without diving into code, https://blobsender.xyz lets anyone write a message and submit it as a blob on Ethereum. Browser wallets and connectors do not support blob transactions yet.
RPC support on Sepolia
RPC support was one of the main friction points. About 20 Sepolia RPC providers were tested; many rejected blob transactions or lacked EIP‑4844 support. The following public RPC endpoints worked reliably:
https://sepolia.infura.io/v3/YOUR_API_KEYhttps://ethereum-sepolia-rpc.publicnode.comhttps://eth-sepolia.api.onfinality.io/publichttps://0xrpc.io/sephttps://sepolia.drpc.org
This list is included in the repository to save others testing time.
Repository and scripts
All working examples live here: https://github.com/0xKurt/eip-4844-ethers-examples
The repository contains two scripts, both using ethers.js v6 and kzg‑wasm to send Type 3 transactions:
send-blob.ts
A simple blob transaction that prepares a fixed‑size blob, generates a KZG commitment and proof, and sends the transaction.
send-blob-contract.ts
A blob transaction combined with a contract call, demonstrating how to include blob data alongside contract interaction.
Sending a blob transaction (high‑level steps)
- Preparing a fixed‑size blob.
- Generating a KZG commitment and proof.
- Sending a transaction with
type: 3.
Inspecting blobs with Blobscan
Blobscan allows inspection of:
- Blob versioned hashes
- Blob gas prices
- Other blob‑related metadata
The scripts print direct links to Blobscan using the blob versioned hash returned by ethers, making verification and inspection easy.
Further reading
A complete step‑by‑step walkthrough of setup, code, and transaction flow is available in the original Medium article: https://medium.com/@Kurt0x/sending-eip-4844-blob-transactions-using-ethers-js-and-kzg-wasm-d84224be6b81