Creating a sidechain
Someone proposes it; miners vote block by block.
5 min readStep 1: someone proposes it
A new sidechain starts as a proposal. A miner writes an M1M1 · Propose sidechainA coinbase message that proposes a new sidechain for a slot. message into the coinbase transactionCoinbase transactionThe first transaction in a block, written by the miner. BIP300 and BIP301 place the miners' messages and votes there. of a block they find. The message carries the sidechain's declaration and the slot it wants. A new proposal starts with zero votes.
Only miners write coinbase transactions, so a sidechain's developers ask miners to include their proposal.
Step 2: miners vote, block by block
In each later block, the miner can vote for the proposal with an M2M2 · ACK proposalA coinbase message in which a miner votes for a pending sidechain proposal. message that quotes the proposal's declaration hash. One block, at most one vote. A block that does not vote for it simply doesn't add one.
It is like a show of hands that lasts for weeks: every block is one hand, and only blocks that raise it count.
Step 3: activate or expire
The proposal activates when its votes go above the thresholdThresholdThe number of votes that must be exceeded, within a maximum age, for a proposal or withdrawal to pass. Betanet reports its own values. before it gets too old. If it runs out of time, it is dropped. Taking an empty slot needs fewer votes than replacing a sidechain that is already active: replacing one should be hard.
The rules Betanet is running
Loading live data…
Proposals being voted on
Loading live data…
How today's sidechains were activated
Loading live data…
Go deeper: what the messages look like
Both are outputs of the coinbase transaction that start with OP_RETURN. M1 has the header D5E0C4AF followed by the slot number, a version, the title, the description and the two hashes. M2 has the header D6E1C5BF followed by the 32-byte declaration hash. A block may contain at most one M1 and one M2.
A vote only counts from the block after the proposal. That is why a sidechain that got a vote in every block activates exactly unknown blocks after it was proposed on Betanet, as the timeline above shows.
Read the source
The rules in this lesson come from these documents and code:
Ask an AI assistant about this concept
Opens your assistant with a question about this concept and its sources already written. AI answers can be wrong: check them against the sources above. Your question goes to the assistant you choose, not to us.