eth_getBlockByHash
Retrieve comprehensive block information by its hash on the Bittensor network. This method provides detailed block data including transactions, block metadata, and all network-specific properties for the Bittensor blockchain.
Parameters​
Parameter | Type | Required | Description |
---|---|---|---|
blockHash | string | Yes | The hash of the block to retrieve (32-byte hex string with 0x prefix) |
fullTransactionObjects | boolean | Yes | If true , returns full transaction objects; if false , returns only transaction hashes |
Returns​
Returns a block object with the following fields:
Field | Type | Description |
---|---|---|
number | string | Block number (hex-encoded) |
hash | string | Block hash (32 bytes) |
parentHash | string | Hash of the parent block (32 bytes) |
nonce | string | Proof-of-work nonce (8 bytes) |
sha3Uncles | string | SHA3 hash of the uncles data in the block |
logsBloom | string | Bloom filter for block logs (256 bytes) |
transactionsRoot | string | Root of the transaction trie (32 bytes) |
stateRoot | string | Root of the final state trie (32 bytes) |
receiptsRoot | string | Root of the receipts trie (32 bytes) |
miner | string | Address of the block validator/miner |
difficulty | string | Difficulty level for this block |
totalDifficulty | string | Total difficulty of the chain until this block |
extraData | string | Extra data field of this block |
size | string | Size of this block in bytes |
gasLimit | string | Maximum gas allowed in this block |
gasUsed | string | Total gas used by all transactions in this block |
timestamp | string | Unix timestamp for when the block was collated |
transactions | array | Array of transaction objects or hashes (depending on fullTransactionObjects parameter) |
uncles | array | Array of uncle hashes |
baseFeePerGas | string | Base fee per gas (EIP-1559, if applicable) |
mixHash | string | 256-bit hash for proof-of-work verification |
Implementation Example​
- cURL
- JavaScript
- Python
curl -X POST https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0x7a8f2c5b9d3e6f1a4c7b9e2f5d8a1b4c7f0e3a6d9c2b5e8f1a4d7c0b3e6f9a2",
true
],
"id": 1
}'
const response = await fetch('https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method: 'eth_getBlockByHash',
params: [
'0x7a8f2c5b9d3e6f1a4c7b9e2f5d8a1b4c7f0e3a6d9c2b5e8f1a4d7c0b3e6f9a2',
true
],
id: 1
})
});
const data = await response.json();
console.log('Bittensor block data:', data.result);
import requests
import json
url = 'https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY'
headers = {'Content-Type': 'application/json'}
payload = {
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0x7a8f2c5b9d3e6f1a4c7b9e2f5d8a1b4c7f0e3a6d9c2b5e8f1a4d7c0b3e6f9a2",
True
],
"id": 1
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
block_data = response.json()
print("Bittensor block data:", json.dumps(block_data['result'], indent=2))
Response Example​
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"number": "0x2d4",
"hash": "0x7a8f2c5b9d3e6f1a4c7b9e2f5d8a1b4c7f0e3a6d9c2b5e8f1a4d7c0b3e6f9a2",
"parentHash": "0x3f5e8d2a1b7c9e4f6a0d3c8b5e7f1a4c9d2b6e8f0a3c7d5e9b2f4a7c0e3b6f9",
"nonce": "0x0000000000000123",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xa4b2c9e8f5d7a1c6e9b3f8d2a7c5b8e1f4d7a0c3b6e9f2a5d8c1b4e7f0a3c6",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"miner": "0x0000000000000000000000000000000000000000",
"difficulty": "0x800000000",
"totalDifficulty": "0x800000000",
"extraData": "0x426974746e736f72",
"size": "0x298",
"gasLimit": "0x2625a00",
"gasUsed": "0x0",
"timestamp": "0x64f5a2e1",
"transactions": [],
"uncles": [],
"baseFeePerGas": "0xa",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
}
Use Cases​
- Network Analysis: Analyze Bittensor network performance and block propagation
- TAO Tracking: Monitor TAO token transactions and network activity
- Subnet Validation: Verify subnet-related transactions and validator activity
- AI Development: Integrate Bittensor blockchain data into AI/ML applications
- Mining Analytics: Track mining/validation performance on the Bittensor network
Bittensor-Specific Features​
The Bittensor network includes unique characteristics:
- Subnet Architecture: Blocks may contain subnet-specific transaction data
- Validator Networks: Mining addresses represent validators in the TAO ecosystem
- AI Incentives: Transactions often relate to AI model training and validation rewards
- Decentralized Intelligence: Block data reflects the network's AI-focused consensus mechanism
Need help? Contact our support team or check the Bittensor documentation.