Enclave is now The Interfold. Documentation is being updated.
Ciphernode Operators
Tickets & Sortition

Tickets & Sortition

Tickets determine your probability of being selected for E3 committees. This guide explains the ticket system and sortition algorithm.

Ticket Overview

TokenPurposeTransferable
ENCLLicense bond - required to registerYes
ETKTicket token - determines committee selection oddsNo
USDCUnderlying asset for tickets (fee token)Yes

Tickets are priced in stablecoins and minted into non-transferable ETK balances:

availableTickets = floor(ticketTokenBalance / ticketPrice)

Managing Tickets

Buy Tickets

Deposit stablecoins to mint tickets:

# Buy tickets worth 100 USDC
enclave ciphernode tickets buy --amount 100

This:

  1. Approves the ticket contract to spend your USDC (if needed)
  2. Deposits the stablecoin
  3. Mints equivalent ETK to your balance

Burn Tickets

Withdraw the underlying stablecoin:

# Burn tickets and withdraw 50 USDC worth
enclave ciphernode tickets burn --amount 50

Burning tickets takes effect immediately. Dropping below the minimum ticket balance makes you inactive until you top up again.

Check Balance

enclave ciphernode status

Look for the "Ticket balance" and "available" fields in the output.

Ticket Economics

  • Committee probability scales linearly with your available tickets relative to other operators
  • Doubling your tickets doubles your odds (assuming peers stay constant)
  • Balances are snapshotted at requestBlock - 1 - adding tickets after a request won't help that round
  • Idle tickets have opportunity cost - rewards only accrue when you're selected and complete duties

Rebalancing Tips

  • Add tickets one or two requests ahead of anticipated demand to avoid gas spikes
  • Keep a small buffer so slashing or removals don't instantly deactivate you
  • Monitor ticketPrice() and minTicketBalance() before automating deposits on multiple networks

Sortition Algorithm

The sortition process selects committees deterministically based on a random seed:

1. Eligibility Check

When CommitteeRequested fires, nodes check if they're eligible:

  • Registered and not banned
  • isActive (bond + ticket minimums satisfied)
  • No exit in progress

2. Score Calculation

For each ticket you hold, a score is calculated:

score = keccak256(node, ticketNumber, e3Id, seed)

The lowest score wins — each node submits its single best (lowest-scoring) ticket. The same inputs always produce the same scores, so all honest nodes converge on the same committee.

3. Ticket Submission

Operators submit their winning tickets during the submission window (10 seconds on Sepolia):

# The CLI handles this automatically when running
submitTicket(e3Id, ticketNumber)

Each submission emits TicketSubmitted(e3Id, node, ticketId, score).

The sortition algorithm actually selects threshold_n + buffer nodes, where the buffer provides backup nodes in case of failures. The buffer size depends on the threshold_m / threshold_n ratio:

  • Ratio ≥ 0.8 → buffer = (n - m) + 3
  • Ratio ≥ 0.6 → buffer = (n - m) + 2
  • Ratio < 0.6 → buffer = (n - m) + 1

4. Committee Finalization

After the window closes and ≥ threshold_n tickets are present:

  1. Anyone can call finalizeCommittee(e3Id)
  2. If enough operators submitted, the registry emits CommitteeFinalized(e3Id, committee)
  3. If the threshold isn't met, CommitteeFormationFailed is emitted and the E3 fails
  4. Selected nodes generate and publish key shares
  5. Aggregated public key is published via publishCommittee

Parameters

ParameterSepolia ValueDescription
ticketPrice10 USDCCost per ticket
minTicketBalance1 ticketMinimum to be active
sortitionSubmissionWindow10 secondsTime to submit winning tickets
threshold_mVariesMinimum operators needed for duties
threshold_nVariesTotal committee size

Monitoring

Events to Watch

EventMeaning
CommitteeRequestedNew committee formation started
TicketSubmittedA ticket was submitted for selection
CommitteeFinalizedCommittee members confirmed
CommitteeFormationFailedNot enough operators submitted tickets
CommitteePublishedAggregated public key ready

Log Messages

Watch your node logs for:

  • "This node was SELECTED for sortition" - You have a winning ticket for an E3
  • "This node was NOT selected for sortition" - Your tickets didn't score low enough
  • "Ticket generated for score sortition" - Winning ticket emitted to the event bus
  • "Ciphernode was not selected" - Node wasn't in the selection set
  • "Performing Sortition with buffer" - Sortition started (shows threshold_m, threshold_n, buffer)
  • "Node is in finalized committee" - Committee confirmed, CiphernodeSelected emitted

Troubleshooting

SymptomPossible CauseSolution
Never being selectedLow ticket count relative to peersAdd more tickets
isActive is falseBelow minimum tickets or license bondTop up tickets or rebond license
SubmissionWindowClosed errorsRPC latency or slow submissionUse faster RPC, check network
Committee missing your operatorSubmission didn't succeedCheck logs, retry next round

Best Practices

  1. Stagger ticket top-ups - Avoid last-minute gas competition
  2. Alert on missed submissions - Human intervention before committee deadlines
  3. Batch networks separately - Run separate CLI instances per chain
  4. Track governance changes - sortitionSubmissionWindow, ticketPrice, and licenseRequiredBond may change

Next Steps