Try it Live
Run Blob examples in the interactive playground
Type Definition
BrandedUint8Array representing EIP-4844 blob data (exactly 131,072 bytes = 128 KB).
Related Types
Constants
API Methods
Constructors
from- Universal constructor from any input (auto-encodes if needed)fromData- Encode arbitrary data into blob format with length prefix
Data Encoding/Decoding
toData- Extract original data from blob (reads length prefix)splitData- Split large data into multiple blobsjoinData- Join data from multiple blobs
KZG Cryptography
toCommitment- Compute 48-byte KZG commitment for blobtoProof- Generate 48-byte KZG prooftoVersionedHash- Compute versioned hash (0x01 + SHA256 of commitment)verify- Verify KZG proof for blob and commitmentverifyBatch- Batch verify multiple blob proofs
Validation
isValid- Check if data is valid blob (exactly 131,072 bytes)isValidVersion- Validate versioned hash format and version byte
Gas Estimation
calculateGas- Calculate blob gas cost given blob count and base feeestimateBlobCount- Estimate number of blobs needed for data
Nested Namespaces
- Blob.Commitment - Commitment validation and conversion
- Blob.Proof - Proof validation utilities
- Blob.VersionedHash - Versioned hash utilities and version extraction
Types
- BrandedBlob
- Commitment
- Proof
- VersionedHash
Usage Patterns
Creating Blobs from Data
Handling Large Data
Versioned Hashes for Transactions
Gas Cost Estimation
Batch Verification
Tree-Shaking
Import only what you need for optimal bundle size:Related
Core Documentation
- Fundamentals - EIP-4844 blob structure and proto-danksharding
- EIP-4844 - Detailed EIP-4844 specification coverage
- KZG - KZG commitment scheme explanation
Advanced Features
- Usage Patterns - Real-world blob transaction examples
- WASM - WASM acceleration for KZG operations
Related Primitives
- Transaction - EIP-4844 transaction type (0x03)
- Keccak256 - SHA256 and keccak256 hashing for commitments
- Hex - Hex encoding for versioned hashes
Specification
- EIP-4844: Shard Blob Transactions - Proto-danksharding specification
- KZG Ceremony - Trusted setup for KZG commitments
- c-kzg-4844 - Reference KZG implementation
- Blob Transaction Format - Transaction structure

