Skip to main content

eth_getBlockByHash

Retrieve detailed block information by its hash on the Unichain network. This method returns comprehensive block data including transactions, block metadata, and DeFi-specific properties for the Unichain blockchain ecosystem.

Parameters​

ParameterTypeRequiredDescription
blockHashstringYesThe hash of the block to retrieve (32-byte hex string with 0x prefix)
fullTransactionObjectsbooleanYesIf true, returns full transaction objects; if false, returns only transaction hashes

Returns​

Returns a block object with the following fields:

FieldTypeDescription
numberstringBlock number (hex-encoded)
hashstringBlock hash (32 bytes)
parentHashstringHash of the parent block (32 bytes)
noncestringProof-of-work nonce (8 bytes)
sha3UnclesstringSHA3 hash of the uncles data in the block
logsBloomstringBloom filter for block logs (256 bytes)
transactionsRootstringRoot of the transaction trie (32 bytes)
stateRootstringRoot of the final state trie (32 bytes)
receiptsRootstringRoot of the receipts trie (32 bytes)
minerstringAddress of the block producer/validator
difficultystringDifficulty level for this block
totalDifficultystringTotal difficulty of the chain until this block
extraDatastringExtra data field of this block
sizestringSize of this block in bytes
gasLimitstringMaximum gas allowed in this block
gasUsedstringTotal gas used by all transactions in this block
timestampstringUnix timestamp for when the block was collated
transactionsarrayArray of transaction objects or hashes (depending on fullTransactionObjects parameter)
unclesarrayArray of uncle hashes
baseFeePerGasstringBase fee per gas (EIP-1559, if applicable)
mixHashstring256-bit hash for proof-of-work verification
withdrawalsRootstringRoot hash of withdrawals (if applicable)

Implementation Example​

curl -X POST https://api-unichain-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0x9c6e4f2a8b7d1e5c3f8a2b9d6e4f7a0c3e6b9f2a5d8c1b4e7f0a3c6d9e2f5a8",
true
],
"id": 1
}'

Response Example​

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"number": "0x3a8",
"hash": "0x9c6e4f2a8b7d1e5c3f8a2b9d6e4f7a0c3e6b9f2a5d8c1b4e7f0a3c6d9e2f5a8",
"parentHash": "0x1f4c8e2a5d7b0e3f9c6a4d8b1e5f2c9a6d3b7e0f4c8a1e5d9b2f6c0a4e7b1d5",
"nonce": "0x0000000000000456",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0x6b9f3d7a2c5e8b1f4d7a0c3e6f9b2a5d8c1b4e7f0a3c6d9e2f5a8b1c4d7e0f3",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"miner": "0x0000000000000000000000000000000000000000",
"difficulty": "0x0",
"totalDifficulty": "0x0",
"extraData": "0x556e696368616e",
"size": "0x2c0",
"gasLimit": "0x1c9c380",
"gasUsed": "0x0",
"timestamp": "0x650a1b2c",
"transactions": [],
"uncles": [],
"baseFeePerGas": "0x5",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
}
}

Use Cases​

  • DeFi Analytics: Analyze decentralized finance transactions and protocols on Unichain
  • Liquidity Tracking: Monitor liquidity pool transactions and AMM activity
  • MEV Analysis: Track Maximum Extractable Value opportunities and transactions
  • Cross-Chain Bridge: Analyze bridge transactions and asset transfers
  • Protocol Integration: Integrate Unichain block data into DeFi applications

Unichain-Specific Features​

The Unichain network includes DeFi-optimized characteristics:

  • Low Gas Fees: Optimized for high-frequency DeFi transactions with minimal fees
  • MEV Protection: Built-in mechanisms to protect users from MEV exploitation
  • Fast Finality: Quick block confirmation times for better user experience
  • DeFi-Native: Designed specifically for decentralized finance applications
  • Cross-Chain Compatibility: Seamless integration with other blockchain networks

Network Performance​

  • Block Time: Optimized for fast transaction processing
  • Throughput: High transaction per second capability for DeFi operations
  • Scalability: Built to handle high-volume trading and DeFi interactions
  • Security: Robust validation mechanisms for financial transactions

Need help? Contact our support team or check the Unichain documentation.