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:Behavior
BLOBHASH retrieves a versioned hash from the transaction’s blob array: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 gasBLOBBASEFEE: 2 gasADD,SUB: 3 gasBLOCKHASH: 20 gas
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
Blob Transaction Format
Versioned Hash Format
Maximum Blobs per Transaction
Implementation
- TypeScript
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)
- 3 gas per query
- ~333,333 queries per million gas
Related Instructions
- BLOBBASEFEE (0x4A) - Get blob base fee
- BLOCKHASH (0x40) - Get block hash
- CALLDATALOAD (0x35) - Get calldata
References
- EIP-4844 - Shard Blob Transactions
- Yellow Paper - Section 9.3
- EVM Codes - BLOBHASH
- EIP-4844 FAQ

