Block information

This set of instructions is related to retrieving various attributes associated with a block. These opcodes are available in the range of 0x40 to 0x45:

Mnemonic

Value

POP

PUSH

Gas

Description

BLOCKHASH

0x40

1

1

20

Gets the hash of one of the 256 most recently completed blocks

COINBASE

0x41

0

1

2

Retrieves the address of the beneficiary set in the block

TIMESTAMP

0x42

0

1

2

Retrieves the timestamp set in the blocks

NUMBER

0x43

0

1

2

Gets the block's number

DIFFICULTY

0x44

0

1

2

Retrieves the block difficulty

GASLIMIT

0x45

0

1

2

Gets the gas limit value of the block

Get Mastering Blockchain - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.