For a parachain to be added to Polkadot it must inhabit one of the available parachain slots. The number of parachain slots is not unbounded on Polkadot, as only a limited number are available. A limited number of slots are unlocked every few months through on-chain governance. If a parachain wants to have guaranteed block inclusion at every Relay Chain block, it must acquire a parachain slot. The development of on-demand parachains (previously referred to as parathreads) is in progress.
The parachain slots will be leased according to an unpermissioned candle auction, with several alterations related to improving security while operating on a blockchain. See Rationale for additional details.
Mechanics of a Candle Auction
Candle auctions are a variant of open auctions where bidders submit bids that are increasingly higher. The highest bidder at the conclusion of the auction is considered the winner.
Candle auctions were originally employed in the 16th century for the sale of ships. The name is derived from the system by which the auction length was determined. The phrase "inch of a candle" refers to the length of time required for a candle to burn down 1 inch. When the flame extinguishes and the candle goes out, the auction terminates and the standing bid at that point in time prevails the winner.
When candle auctions are used online, they require a random number to decide the moment of termination. Parachain slot auctions differ slightly from a normal candle auction in that they do not randomly terminate the auction. Instead, they run for an entire fixed duration and the winner is randomly chosen retroactively.
The candle auction on Polkadot is split into two parts:
The opening period which is in effect immediately after the auction starts. This period lasts for one day and eighteen hours and serves as a buffer time for parachain candidates to setup their initial bids, and likely start executing their strategy on how to win the slot auction. During the opening phase, bids will continue to be accepted, but they do not have any effect on the outcome of the auction.
The ending period follows the opening period for five additional days, where the auction is subject to end based on the candle auction mechanism.
The auction’s ending time can occur any time within the ending period. This time is automatically and randomly chosen by the Verifiable Random Function (VRF). The probability of winning the auction is equal to the number of blocks that contain a winning bid, divided by the total number of blocks in the ending period. The random ending is managed by propagating through the entire ending period, where a snapshot is taken at each block within the ending period to capture the winners for that given block. At the end of the period, one of the snapshots is randomly selected to determine the winner of the auction.
Random Function wins the slot auction.
A parachain auction on Polkadot lasts exactly one week from the start: 1 day and 18 hours for the starting period, days for the ending period (candle auction phase) and 6 hours for determining the auction winner.
Crowdloan contributions cannot be made during these six hours when the winning block for the auction is being determined on-chain.
More details on this are available in the Network Implementation section.
Randomness in action
The following example will showcase the randomness mechanics of the candle auction for the ninth auction on Kusama. Keep in mind that the candle phase has a uniform termination profile and has an equal probability of ending at any given block, and the termination block cannot be predicted before or during the auction.
The ending period of auction 9 starts at
The auction has a full duration equal to
block 72000is the "ending period", which is divided into 3600 samples of 20 blocks. Figuratively, the candle is lit, and the candle phase lasts for 72,000 blocks.
The winning sample during the ending period had the
index 1078.Sample 1078 is the winner
Sample 1078 refers to the winner as of
block 9362014 + 21560, which equals
The parent block was a new BABE session in the
Logs, which updated the randomness that was used to select that sample index.Inspecting the block state
You can inspect the state at the end of
block 9434277to see the sample indices with an archive node. The digest in the
9434277is decodable and contains the random value as well as the BABE authorities.
As a result, the winner of this auction was not the highest bid during the full duration.
The open and transparent nature of blockchain systems opens attack vectors that are non-existent in traditional auction formats. Normal open auctions in particular can be vulnerable to auction sniping when implemented over the internet or on a blockchain.
Auction sniping takes place when the end of an auction is known and bidders are hesitant to bid their true price early, in hopes of paying less than they actually value the item.
For example, Alice may value an item at auction for 30 USD. She submits an initial bid of 10 USD in hopes of acquiring the items at a lower price. Alice's strategy is to place incrementally higher bids until her true value of 30 USD is exceeded. Another bidder Eve values the same item at 11 USD. Eve's strategy is to watch the auction and submit a bid of 11 USD at the last second. Alice will have no time to respond to this bid before the close of the auction and will lose the item. The auction mechanism is sub-optimal because it has not discovered the true price of the item and the item has not gone to the actor who valued it the most.
On blockchains this problem may be even worse, since it potentially gives the producer of the block an opportunity to snipe any auction at the last concluding block by adding it themselves while ignoring other bids. There is also the possibility of a malicious bidder or a block producer trying to grief honest bidders by sniping auctions.
For this reason, Vickrey auctions, a type of sealed-bid auction where bids are hidden and only revealed at a later phase, have emerged as a well-regarded mechanic. For example, this mechanism is leveraged to auction human readable names on the ENS. The Candle auction is another solution that does not require a two-step commit and reveal schemes (a main component of Vickrey auctions), which allows smart contracts to participate.
Candle auctions allow everyone to always know the states of the bid, but they do not reveal when the auction has officially ended. This helps to ensure that bidders are willing to make their true bids early. Otherwise, they may find themselves in a situation where the auction was determined to have ended before having an opportunity to bid.
Polkadot will use a random beacon based on the Verifiable Random Function (VRF). The VRF will provide the base of the randomness, which will retroactively determine the end-time of the auction.
The slot durations are capped to 2 years and divided into 3-month periods. Parachains may lease a slot for any combination of periods of the slot duration. Parachains may lease more than one slot over time, meaning that they could extend their lease to the network past the maximum duration by leasing a contiguous slot.
This means that parachains do not need to always inhabit the same slot, however they always must maintain a slot to remain a parachain.
Parachains or parachain teams, bid in the auction by specifying the slot range that they want to lease and the number of tokens they are willing to reserve. Bidders can be either ordinary accounts, or use the crowdloan functionality to source tokens from the community. For a more in-depth comparison between both of these options for gaining a parachain slot, check out this section on Crowdloan Campaigns vs Parachain Auctions.
Parachain slots at genesis
Slot A | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |...
Slot B | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |...
Slot C |__________| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |...
Slot D |__________| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |...
Slot E |__________|___________| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |...
Each period of the range 1 - 4 represents a 3-month duration for a total of 2 years
Bidders will submit a configuration of bids specifying the token amount they are willing to bond and
for which periods. The slot ranges may be any of the periods 1 -
n is the number of
periods available for a slot. (
you pay for the parachain slot by forfeiting the opportunity to earn staking rewards.
A bidder configuration for a single bidder may look like the following pseudocode example:
const bids = [
range: [1, 2, 3, 4, 5, 6, 7, 8],
range: [1, 2, 3, 4],
range: [2, 3, 4, 5, 6, 7],
The important concept to understand from this example is that bidders may submit different
configurations at different prices (
bond_amount). However, only one of these bids would be
eligible to win exclusive of the others.
The winner selection algorithm will pick bids that may be non-overlapping in order to maximize the amount of tokens held over the entire lease duration of the parachain slot. This means that the highest bidder for any given slot lease period might not always win (see the example below).
A random number, which is based on the VRF used by Polkadot, is determined at each block. Additionally, each auction will have a threshold that starts at 0 and increases to 1. The random number produced by the VRF is examined next to the threshold to determine if that block is the end of the auction within the so-called ending period. Additionally, the VRF will pick a block from the last epoch to access the state of bids which can help aid in mitigating some types of attacks from malicious validators.
There is one parachain slot available.
75 for the range 1 - 8.
100 for the range 5 - 8.
40 for the range 1 - 4.
Let's calculate each bidder's valuation according to the algorithm. We do this by multiplying the bond amount by the number of periods in the specified range of the bid.
Charlie - 75 * 8 = 600 for range 1 - 8
Dave - 100 * 4 = 400 for range 5 - 8
Emily - 40 * 4 = 160 for range 1 - 4
Although Dave had the highest bid in accordance to token amount per period, when we do the
calculations we see that since he only bid for a range of 4, he would need to share the slot with
Emily who bid much less. Together Dave and Emily's bids only equals a valuation of
valuation for the entire range is
600. Therefore Charlie is awarded the complete range of the
Parachain Lease Extension
Before the slot lease expires, parachains have to bid and win another auction for continuity of the lease. To avoid any downtime in connectivity and minimize the risk of losing a subsequent auction, parachain teams need to plan ahead to bid for the lease extension before their current lease period ends. Explained in the section above, each auction lets you bid for 8 LPs (Lease Periods) which enables two scenarios for the parachain's lease extension.
Lease Extension with Overlapping Slots
Acquire a slot where the first lease period is before the last lease period of the current slot.
- Register a new
- Win a slot auction with the new
The parachain team has access to two slots:
- one that will end soon
- one that just started
Both slots have at least one LP in common. When the old slot transitions to their last LP, the
parachain can swap the slots. This can be done
via on-chain governance. The
swap call is available in
The slot swap via XCM requires two live parachains to send an XCM message to the relay chain to approve the swap. A parachain team with access to two overlapping slots can start a shell parachain on the new slot and swap it with their actual parachain on the old slot, thus ensuring continuity of the lease.
Lease Extension with Non-Overlapping Slots
Acquire a slot where the first LP starts right after the end of the last LP of the current slot. In
this case, the parachain can bid directly with their current
paraId, and it will be automatically
extended without the need of swapping. This method has the advantage of not having superfluous LP's
on different slots owned by the same team, however it has the disadvantage of losing flexibility on
when to win a new slot: if the team does not win the exact slot, then it will suffer some downtime
until it wins a new slot.
- How do Parachain Slot Auctions Work
- Parachain Allocation - W3F research page on parachain allocation that goes more in depth to the mechanism
- Research Update: The Case for Candle Auctions - W3F breakdown and research update about candle auctions
- Front-Running, Smart Contracts, and Candle Auctions W3F Research team discusses how to remedy current blockchain auction setbacks with candle auctions