Bắt đầu với TheRPC
Tham khảo API
Ethereum API
Core API
Hướng dẫn
Ethereum/Core API/eth_getUncleByBlockHashAndIndex

eth_getUncleByBlockHashAndIndex

The eth_getUncleByBlockHashAndIndex method returns information about an uncle (ommer) block by a block hash and uncle index position.

Use Cases

  • Analyzing blockchain network health
  • Verifying uncle rewards distribution
  • Researching mining/validation competition
  • Studying blockchain throughput and latency
  • Understanding network security through uncle rate
  • Mining strategy analysis
  • Historical blockchain research
  • Block confirmation verification

Method Details

Returns information about the uncle (ommer) block by the block hash and uncle index position.

Tham số:

Hash of the block containing the uncle

The index position of the uncle (hex)

Trả về:

Uncle block object, or null if no uncle exists at that index

Uncle block's number (hex)

Hash of the uncle block

Hash of the parent block

Nonce used in block mining/validation (PoW blocks only)

SHA3 hash of the uncles data in the block

Bloom filter for light clients to quickly retrieve related logs

Root of the transaction trie for this block

Root of the state trie for this block

Root of the receipts trie for this block

Address that received the mining reward

Difficulty target for this block (hex)

Total difficulty of chain up to this block (hex)

Extra data included by the miner in the block

Block size in bytes (hex)

Maximum gas allowed in this block (hex)

Total gas used by all transactions in this block (hex)

Unix timestamp when block was collated (hex)

Array of uncle hashes (will be empty for uncle blocks)

Response Example

{
	"jsonrpc": "2.0",
	"id": 1,
	"result": {
		"difficulty": "0x57f17a09378",
		"extraData": "0x476574682f76312e302e302f6c696e75782f676f312e342e32",
		"gasLimit": "0x1388",
		"gasUsed": "0x0",
		"hash": "0x932bdf904546a2287a2c9b2ede37925f698a7657484b172d4e5184f80bdd464d",
		"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
		"miner": "0xbb7b8287f3f0a933474a79eae42cbca977791171",
		"mixHash": "0x4500aa4ee2b3044a155252e35273770edeb2ab6f8cb19ca8e732771484462169",
		"nonce": "0x24732773618271bc",
		"number": "0x299",
		"parentHash": "0xa779859b1ee558258b7008bbabff272280136c5dd3eb3ea3bfa8f6ae03bf91e5",
		"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
		"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
		"size": "0x21d",
		"stateRoot": "0x2604fbf5183f5360da249b51f1b9f1e0f315d2ff3ffa1a4143ff221ad9ca1fec",
		"timestamp": "0x55ba4827",
		"totalDifficulty": null,
		"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
		"uncles": []
	}
}

Understanding Uncle Blocks

Uncle blocks (also called ommers) are valid blocks that were mined but not included in the main blockchain. This happens when two miners find a valid block at nearly the same time, but only one can be accepted into the main chain.

Why Uncle Blocks Matter

  • Network Security: A high uncle rate may indicate network latency or high mining competition
  • Rewards: Miners of uncle blocks receive partial rewards (2/32 of block reward pre-EIP-1559)
  • Block Inclusion: Uncles are referenced in regular blocks (up to 2 per block)
  • Chain Confirmation: Uncles contribute to blockchain security despite not being in the main chain

Uncle Rewards Calculation

Uncle block miners receive rewards based on the formula:

((Uncle Block Number + 8) - Main Block Number) * (Block Reward / 8)

Where:

  • Uncle Block Number is the block number of the uncle block
  • Main Block Number is the block number that included the uncle reference
  • Block Reward is the standard block reward (varies by network upgrade)

Important Notes

  • Uncle blocks contain header information only, no transactions
  • Uncles must be within 6 blocks of the including block
  • Post-Merge (PoS), uncles no longer exist as validators produce blocks in slots
  • The uncle rate is an important network health metric
  • Uncle information can be vital for analyzing historical blockchain data

See also

Giúp chúng tôi trở nên tốt hơn!
Chia sẻ trang này và giúp chúng tôi tạo ra sản phẩm tốt hơn cho bạn.