Skip to main content

Overview

WithdrawalIndex represents the global withdrawal counter in the beacon chain. This counter increments monotonically for each withdrawal processed, providing a unique identifier for every withdrawal since the Shanghai/Capella upgrade. Type: bigint & { readonly [brand]: "WithdrawalIndex" }

Key Concepts

  • Monotonic: Always increases, never resets
  • Global: Single counter for all withdrawals across all validators
  • EIP-4895: Introduced in Shanghai/Capella upgrade
  • Unique: Each withdrawal has a unique index

Methods

WithdrawalIndex.from(value)

Create WithdrawalIndex from number, bigint, or string.

WithdrawalIndex.toNumber(index)

Convert WithdrawalIndex to number. Throws if exceeds MAX_SAFE_INTEGER.

WithdrawalIndex.toBigInt(index)

Convert WithdrawalIndex to bigint.

WithdrawalIndex.equals(a, b)

Check if two withdrawal indices are equal.

Usage Examples

Track withdrawal history

Query withdrawal range

References