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!