Root of a given state

The /eth/v1/beacon/states/{state_id}/root method calculates the HashTreeRoot for a state with a given stateId. The same value will be returned if stateId is a root.

Developers can use this method to compute the HashTreeRoot of a given state, which is useful in various Ethereum operations.

👍

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • state_id — the identifier of the state. This can be one of the following:
    • head — the canonical head in the node's view.
    • genesis — the very first or initial state of the Beacon Chain.
    • finalized — the latest state finalized, meaning the network has accepted it, and a reorganization is extremely unlikely.
    • justified — the recent state that has been justified is the first step before finalization in the Ethereum 2.0 Proof of Stake consensus mechanism. This means that a sufficient number of validators have agreed on this state.
    • <slot> — a slot is a period of time in the Ethereum protocol during which a block can be proposed.
    • <hex encoded stateRoot with 0x prefix> - The state root encoded in hexadecimal.

Response

  • object — an object with the following properties:
    • execution_optimistic — Indicates whether the response references an unverified execution payload. If true, the optimistic information may be invalidated at a later time. If this field is not present, the value should be assumed to be false.
    • finalized — Indicates whether the response references the finalized history of the chain, as determined by the fork choice. If this field is not present, additional calls are necessary to compare the epoch of the requested information with the finalized checkpoint.
    • data — Contains an object with one property:
      • root — The HashTreeRoot of the BeaconState object.
        • format — The format of the root, which is hexadecimal.
        • description — HashTreeRoot of the BeaconState object.
Language
Click Try It! to start a request and see the response here!