Skip to main content

Overview

Slot represents a consensus layer slot number in Ethereum’s proof-of-stake system. Each slot is 12 seconds and represents an opportunity for a validator to propose a block. Type: bigint & { readonly [brand]: "Slot" }

Key Concepts

  • Duration: Each slot is exactly 12 seconds
  • Epochs: 32 slots = 1 epoch (6.4 minutes)
  • Validator duties: Validators are assigned to propose/attest in specific slots
  • Post-merge: Slots are the fundamental unit of time in PoS Ethereum

Methods

Slot.from(value)

Create Slot from number, bigint, or string.

Slot.toNumber(slot)

Convert Slot to number. Throws if exceeds MAX_SAFE_INTEGER.

Slot.toBigInt(slot)

Convert Slot to bigint.

Slot.equals(a, b)

Check if two slots are equal.

Slot.toEpoch(slot)

Convert slot to its corresponding epoch (slot / 32).

Usage Examples

Calculate slot timing

Work with epochs

References