This page is a placeholder. All examples on this page are currently AI-generated and are not correct. This documentation will be completed in the future with accurate, tested examples.
Overview
Opcode: 0x49
Introduced: Cancun (EIP-4844)
BLOBHASH retrieves a versioned blob hash from the current transaction’s blob list by index. This enables proto-danksharding support, allowing contracts to verify blob commitments for Layer 2 data availability.
Specification
Stack Input:
Stack Output:
Gas Cost: 3 (GasFastestStep)
Operation:
Hardfork: Available from Cancun onwards (EIP-4844)
Behavior
BLOBHASH retrieves a versioned hash from the transaction’s blob array:
Versioned hashes are commitment hashes with a version byte prefix:
Examples
Basic Usage
Pre-Cancun Error
Out of Bounds Access
Multiple Blob Access
Index Overflow Handling
Gas Cost
Cost: 3 gas (GasFastestStep)
BLOBHASH is very cheap, matching the cost of basic arithmetic operations.
Comparison:
BLOBHASH: 3 gas
BLOBBASEFEE: 2 gas
ADD, SUB: 3 gas
BLOCKHASH: 20 gas
The low cost enables efficient blob verification without significant overhead.
Common Usage
Blob Commitment Verification
L2 Data Availability
Multi-Blob Processing
Rollup Batch Commitment
Blob Data Anchoring
Security Considerations
Blob Availability Window
Blobs are only available for a limited time (~18 days on Ethereum):
Index Validation
Always check for zero return (out of bounds):
Commitment vs Data
BLOBHASH returns commitment hash, not actual blob data:
Transaction Context
BLOBHASH only works in blob transactions:
EIP-4844 Context
Maximum Blobs per Transaction
Implementation
Edge Cases
Pre-Cancun Execution
No Blobs in Transaction
Maximum Blob Index
Index Overflow
Benchmarks
Performance:
- Index bounds check: O(1)
- Array access: O(1)
- Hash to u256 conversion: O(32)
Gas efficiency:
- 3 gas per query
- ~333,333 queries per million gas
References