Precompile 0x21: Get KYVE-archived Ethereum blobs natively from the smart contract layer

Precompile 0x21: Get KYVE-archived Ethereum blobs natively from the smart contract layer

August 27, 2024

Today we’re excited to introduce our fourth precompile that connects WeaveVM with KYVE’s Trustless API: a way to access KYVE’s historical Ethereum blobs from the WeaveVM smart contract layer.

KYVE Network provides a decentralized Arweave-based data lake to archive and validate data, making trustless data from L1s and L2s easily accessible via solutions like KYVE’s data pipeline. KYVE doesn’t just provide blob data, though. Any data stream can be pushed to KYVE and stored in a decentralized way, and the team are already expanding support to other EVM chains like Optimism and Linear.

Integrating KYVE’s Trustless API into WeaveVM provides access to blob data from inside smart contracts and gives L2s permanent blob storage.

What the KYVE precompile (0x21) enables

  • Native access to blob data from smart contract layer
  • Access to permanently archived blobs
  • Opens up longer verification windows for rollups using KYVE for archived blobs and WeaveVM for settlement layer
  • Enables using blobs for purposes beyond rollups DA, opening doors for data-intensive blob-based applications with permanent blob access

Context: a primer on proto-danksharding (EIP-4844)

This integration with KYVE focuses on enabling retrieval of “blobs”. For context, EIP-4844 introduced a new kind of transaction type to Ethereum which accepts blobs of data to be persisted in the beacon node for a short period of time. These changes are forward-compatible with Ethereum’s scaling roadmap and enable L2s to cheaply post data to L1. Proto-danksharding introduced a separate transaction type that can hold cheaper data in large fixed-size blobs, with a limit on how many blobs can be included per block. These blobs are not accessible from the EVM (only commitments to the blobs are), leaving L2s without a practical way to recall their own history from the L1. The KYVE team also wrote a deep dive into blob archival with more context here.

WeaveVM’s approach for blob data access from the smart contract layer

Currently, there are several efforts to create incentivized protocols to hold blob data for more than 14-17 days. With the 0x21 Precompile, WeaveVM will be providing access to a permanent archive of blobs maintained by the KYVE network from inside the smart contract API itself.

Introducing Precompile 0x21 – access to Ethereum archived blobs

The WeaveVM’s KYVE integration – the precompile at address 0x21 – is a unique solution for native access to blobs data (not just commitments) from the smart contract layer. The 0x21 precompile fetches blob data from networks supported by KYVE via the KYVE Trustless API.

Therefore, with WeaveVM’s 0x21, KYVE clients will have, for the first time, the ability to fetch their archived blobs from an EVM smart contract layer instead of wrapping the Trustless API in oracles and making expensive calls.

How it works

0x21 lets you fetch KYVE’s Ethereum blob data starting at Ethereum’s block 19426589 - the first block with a recorded EIP-4844 transaction. To retrieve a blob from the Trustless API, in the 0x21 staticcall you need to specify the Ethereum block number, blob index in the transaction, and the blob field you want to retrieve, in this format: block_number;blob_index.field

N.B: blob_index represents the blob index in the KYVE’s Trustless API JSON response.

0x21 Solidity function

The eip-4844 transaction fields that you can access from the 0x21 query are:

  • blob (raw blob data, the body)
  • kzg_commitment
  • kzg_proof
  • slot

Check out the 0x21 precompile source code here

Precompile 0x21 status

This precompile has been successfully merged in WeaveVM’s Alphanet v0.1.1 – check out the network release here

Conclusion

Blobs are a great scaling solution for Ethereum’s rollup centric roadmap, however blobs are cheaper for reasons that come with inherent drawbacks: accessibility and lifetime.

WeaveVM’s 0x21 precompile facilitates native access to archived blob data from the smart contract layer, allowing rollups and devs to make use of easily accessible and permanently available blobs!

ICYMI