Skip to main content

Overview

ValidatorIndex represents a validator’s unique index in the beacon chain state registry. Each validator receives an immutable index when they activate, which persists for their entire lifecycle. Type: number & { readonly [brand]: "ValidatorIndex" }

Key Concepts

  • Immutable: Index assigned at activation, never changes
  • Sequential: Indices assigned sequentially starting from 0
  • Permanent: Index retained even after validator exits
  • Registry: Maps to validator entry in beacon state

Methods

ValidatorIndex.from(value)

Create ValidatorIndex from number, bigint, or string.

ValidatorIndex.toNumber(index)

Convert ValidatorIndex to number.

ValidatorIndex.equals(a, b)

Check if two validator indices are equal.

Usage Examples

Work with validator data

Track validator committees

  • Withdrawal - References validator by index
  • Slot - Validators assigned to specific slots
  • Epoch - Committee assignments per epoch

References