> ## Documentation Index
> Fetch the complete documentation index at: https://kleros-mintlify-6ebc7975.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sortition Module Specification

> Kleros V2 Sortition Module spec: PNK-weighted juror selection, sum tree data structure, staking phases, RNG source, and delayed stake changes.

The Sortition Module handles juror selection through weighted random draws based on staked PNK.

## Phase System

1. **Staking Phase**: Jurors update stakes. Stake changes take effect **immediately** and update the sortition sum tree in real-time.
2. **Generating Phase**: Random number requested from RNG source. Stake changes submitted during this phase are **delayed** - they will not affect the current drawing round.
3. **Drawing Phase**: Jurors drawn using the random number and stake weights from the end of the Staking phase. Stake changes remain delayed.

<Warning>
  Stake changes made during the Generating or Drawing phases are queued and only take effect at the start of the next Staking phase. The Court UI shows whether stakes are "Current" or "Delayed."
</Warning>

## Drawing Mechanism

Uses a sortition sum tree where each leaf represents a juror's stake. Drawing probability is proportional to stake:

* A juror with 10% of total staked PNK in a court has \~10% chance per draw
* Multiple draws per dispute (one per juror slot)
* Same juror can be drawn multiple times (gets multiple votes)

## Stake Management

* Stakes are organized per court in the tree
* Jurors can stake in multiple courts simultaneously (subject to `MAX_STAKE_PATHS` limit)
* Minimum stake requirement per court (`minStake`)
* Stake changes may be delayed when in Drawing phase
