⌂ BITCOIN MOI

Bitcoin MOI 0.1.1: the drivechain is live (since block 20,160)

Block 20,160 opened the drivechain gate. Since that block every Bitcoin MOI block must carry a sidechain commitment in its coinbase, and version 0.1.1 adds one more block rule on top. Nodes still on 0.1.0 should upgrade now, and every pool needs a small change to how it builds the coinbase.

Drivechain gate · block 20,160
The gate is open
  • Block now 20,175
  • Blocks since the gate 15

Block 20,160 has been mined. The drivechain rules are in force.

Gate passed: block 20,160 Mined 2026-11-19 04:41 UTC The drivechain rules have been in force since that block, and the chain has kept going normally. Not on 0.1.1 yet? Upgrade now with the steps below, and see block 20,160 on the explorer.

What happens at block 20,160

Block 20,160 switches on the drivechain: the BIP300 and BIP301 rules. They let a sidechain, a separate chain with its own rules, hold BTCMOI in an escrow on the main chain and hand it back later, with the miners of Bitcoin MOI voting on every withdrawal.

No sidechain exists at the gate. The gate only makes the first proposal possible.

The road from here

  1. Now block 20,175

    Past the gate. The drivechain rules are in force.

  2. The gate block 20,160

    The drivechain rules start. From here on every block carries the sidechain commitment.

  3. Earliest sidechain about block 40,320

    A proposal must collect miner votes over 20,160 blocks, about 14 days, before a sidechain becomes active.

  4. Earliest withdrawal 129,600 blocks after it is proposed

    Coins come back from a sidechain only after about 90 days of miner votes.

These are the earliest heights the rules allow, not a schedule. No sidechain has a date.

How coins reach a sidechain and come back

Main chainBitcoin MOI

Your coins live here. They move only when you send them.

EscrowBIP300

Coins sent to a sidechain wait here, on the main chain. One escrow per sidechain, 64 at most.

SidechainBIP301

A separate chain with its own rules. Its blocks are anchored in Bitcoin MOI blocks, so miners secure it without running it.

The way back is slow on purpose: a withdrawal is paid from the escrow only after 129,600 blocks of miner votes, about 90 days, so a wrong withdrawal can be seen and voted down.

Step by step: a deposit and a withdrawal

No sidechain exists yet. This shows how the rules work once one does. The block counts are the earliest the rules allow.

  1. Coins in a main-chain wallet The coins are ordinary BTCMOI in a wallet on the main chain. Nothing moves until their owner sends them.
  2. The deposit The owner sends a deposit: one main-chain transaction that moves the coins into the escrow of that sidechain. The escrow is a single output that holds all the coins of the sidechain.
  3. Buried in the main chain Miners put the deposit in a block and build more blocks on top of it.
  4. Credited on the sidechain The sidechain reads the main chain through blind merged mining. Once the deposit is buried deep enough for its rules, it credits the coins to the owner on the sidechain. On the main chain they stay in the escrow.
  5. A withdrawal bundle is proposed To come back, the owner asks for a withdrawal on the sidechain. The sidechain groups withdrawals into a bundle, and the bundle is proposed on the main chain.
  6. Miners vote In every block the miners can vote for the bundle, against it, or abstain. The bundle needs a score of 129,600 (about 90 days at 60 seconds per block), so a wrong bundle can be seen and voted down.
  7. Paid out on the main chain Only after the bundle has passed does the escrow pay the coins out to main-chain addresses. A bundle that does not get there expires after 259,200 blocks (about 180 days) and pays nothing.

What it means for you

Holders and wallets

Nothing visible changes at the gate. Coins, addresses and payments work as before. No coin moves to a sidechain unless its owner sends it there.

Node runners

Install 0.1.1 now if you have not yet. Since block 20,160 the node checks the sidechain commitment of every block. No reindex.

Steps in section 1

Pools and solo miners

From block 20,160 every block must carry the outputs the node lists in getblocktemplate. A block without them is refused and the work on it is lost. Miners and hardware need no change.

coinbase_required_outputs bad-scdb-commitment-missing

Code in section 2

At the gate block itself

  1. Block 20,160 is mined like any other block, with one more coinbase output: the 37-byte sidechain commitment.
  2. Pools that made the change keep finding valid blocks. A pool that did not finds only blocks the network refuses.
  3. Holders see nothing: no new coins, no new addresses, nothing to click.
  4. From then on miners can propose a sidechain and vote on proposals. The commands are in section 3 below.

The numbers

Times are at 60 seconds per block.

Drivechain rules startblock 20,160about 14 days after the first block
A new sidechain becomes active after20,160 blocks, at most 2,016 of them without the miners' vote (90 %)about 14 days
A proposal that does not get thereexpires after the same 20,160 blocks
Earliest possible sidechainabout block 40,320about 28 days after the first block
Sidechains at the same time64 at most
A withdrawal is paid after129,600 blocks of miner votesabout 90 days
A withdrawal that does not get thereexpires after 259,200 blocksabout 180 days
Replacing an active sidechainneeds 90 % of 129,600 blocks and is refused while its escrow holds coins. A sidechain that has ever received a deposit cannot be replaced.about 90 days

A short history of computing

From counting beads to racks of servers, in nineteen pictures. They are artwork, not photographs of the machines. Select a picture to see it larger.

  1. A large dark abacus frame with rows of faceted beads, set in a black faceted wall.The abacusCounting with beads on rods, long before electricity.
  2. Dark low-poly gears and cogwheels half hidden in a wall of black facets.The Analytical Engine1837Charles Babbage's design for a general-purpose mechanical computer. It was never completed.
  3. A huge dark faceted sphere filling a black vault, with smaller boulders at its foot.Colossus1943–44British electronic code-breaking machines of the Second World War.
  4. A field of dark and bronze blocks and boxes rising like a small city under a faceted ceiling.Harvard Mark I1944An electromechanical calculator built from switches and relays.
  5. A cave of dark blue crystal with tall narrow doorways and a pale blue light overhead.SEAC1950An early stored-program computer of the U.S. National Bureau of Standards.
  6. Four dark low-poly computer cabinets and consoles with small gold diamond emblems against a faceted wall.Ferranti Mark 11951One of the first computers sold commercially.
  7. Blocky old computer monitors and consoles half buried in dark blue faceted rock.UNIVAC I1951An early commercial computer in the United States.
  8. Angular grey pipes rising out of a dark faceted cave floor.ORDVAC1952Built at the University of Illinois for the Ballistic Research Laboratory at Aberdeen Proving Ground.
  9. Dark double-door cabinets set at angles into a grey faceted cave wall.ILLIAC I1952The sister machine of ORDVAC, kept at the University of Illinois.
  10. Two tall dark computer cabinets with small green indicator lights standing in a faceted grey cave.UNIVAC 11031953A UNIVAC for the scientific computing market.
  11. A dark faceted tunnel with rows of grey cabinets along both sides.BESK1953Sweden's first electronic computer.
  12. Several old dark display screens tilted among grey faceted rock.PDP-11959–60The first computer of Digital Equipment Corporation.
  13. A dark crystal city of spires streaked with teal and gold lights, under one great faceted crystal.The mainframeA large central computer shared by many users.
  14. Tall server racks with rows of violet and blue lights set inside a dark crystal cave.The supercomputerMachines built to be the fastest of their time.
  15. A dark city of sharp spires with small golden windows, framed by dark and bronze facets.Silicon ValleyThe region in California where much of the chip industry grew.
  16. Dark angular towers with thin teal lines of light running down them, among grey crystal shards.The computerComputers became small enough for a desk.
  17. Glowing amber circuit traces running across a dark circuit board among rows of tiny lights.The motherboardThe board that connects the parts of a computer.
  18. A dark geodesic web of pale rods meeting at bright nodes across a faceted black vault.Neural networksPrograms made of many connected nodes that learn from examples.
  19. Leaning dark server racks lit by vertical beams of red light and scattered red sparks.The data centreRacks of servers, where much of today's computing runs.

1 · Node and wallet operators

  1. Download 0.1.1 for your system from download.bitcoin.moi and verify it (signature and checksum; the steps are on that page and on verify).
  2. Stop the node: moi-cli stop, or quit moi-qt. Wait until it has exited.
  3. Replace the programs with the 0.1.1 ones and start again.

Your data directory and wallets are used as they are. No reindex is needed. Going back to 0.1.0 after your 0.1.1 node has passed block 20,160 is not supported.

Why upgrade

The full list is in the 0.1.1 release notes.

2 · Pools and solo miners

Miners and mining hardware need no change. Nothing in the Stratum protocol changes; the coinbase your pool sends is 46 bytes longer. The work is on the pool side.

Two things, both needed since block 20,160:

  1. Run 0.1.1 as the node behind your pool. A pool on 0.1.0 could build a block that 0.1.1 nodes refuse.
  2. Add the required coinbase outputs. This is the part that needs work in your pool software.

What the node asks for

getblocktemplate has a field coinbase_required_outputs. Before block 20,160 it is an empty list. From block 20,160 it always holds at least one entry, the 37-byte sidechain commitment:

getblocktemplate (part), from a node past the gate
"coinbase_required_outputs": [
  {
    "script": "6ad85cdbc0c4971ba8f9442e7ec3f8c1c9c3d902f664392ccff23cd814e5530ef4710d61db",
    "value": 0,
    "kind": "scdb_commitment"
  }
]

The rule

A block without the outputs is refused by every node with bad-scdb-commitment-missing (bad-scdb-commitment if the output is there but does not match). The work on it is lost.

What a correct coinbase looks like

coinbase outputs of block 2,000 on regtest (the first block after the gate there)
n=0  value=305.17  76a914a190011c28909193617ff459fb0c516413b4ad3688ac                             payout
n=1  value=0       6a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf9   witness commitment
n=2  value=0       6ad85cdbc0c4971ba8f9442e7ec3f8c1c9c3d902f664392ccff23cd814e5530ef4710d61db     required output

Pool software we tested across the gate

SoftwareResult
ckpool, unmodifiedinvalid blocks from the gate. Needs the change below.
public-pool, unmodifiedinvalid blocks from the gate (bad-scdb-commitment-missing). Needs the change below.
ckpool with the changevalid, normal and high-difficulty ports
public-pool with the changevalid; refuses to build a job past the gate if the field is missing
pool.bitcoin.moivalid

Code: any language (Python reference)

The outputs part of the coinbase transaction, built from a template. On a node past the gate this produces exactly the bytes the node puts in its own coinbase.

Python
def compact_size(n):
    if n < 0xfd:
        return bytes([n])
    if n <= 0xffff:
        return b"\xfd" + n.to_bytes(2, "little")
    if n <= 0xffffffff:
        return b"\xfe" + n.to_bytes(4, "little")
    return b"\xff" + n.to_bytes(8, "little")


def tx_out(value, script):
    """One transaction output: 8-byte value, script length, script."""
    return value.to_bytes(8, "little") + compact_size(len(script)) + script


def coinbase_outputs(template, payout_script):
    """Output count + outputs of the coinbase for this getblocktemplate result."""
    outs = [tx_out(template["coinbasevalue"], payout_script)]

    commitment = template.get("default_witness_commitment")
    if commitment:
        outs.append(tx_out(0, bytes.fromhex(commitment)))

    # Bitcoin MOI: every entry the node lists, value 0, script as given, in order.
    required = template.get("coinbase_required_outputs")
    if required is None:
        raise RuntimeError("the node did not send coinbase_required_outputs: "
                           "do not mine on this template")
    for entry in required:
        if entry.get("value", 0) != 0:
            raise RuntimeError("unexpected value in coinbase_required_outputs")
        outs.append(tx_out(0, bytes.fromhex(entry["script"])))

    return compact_size(len(outs)) + b"".join(outs)

If your pool pays several addresses, add those outputs where the single payout is; the required outputs still go last, after the witness commitment.

Code: public-pool (JavaScript)

Two files. First carry the field from the template into the job data:

dist/services/stratum-v1-jobs.service.js
// 1. in the list that makes up the work signature, after blockTemplate.coinbasevalue:
JSON.stringify(blockTemplate.coinbase_required_outputs ?? null),

// 2. in the object returned for the new template, next to `height`:
height: blockTemplate.height,
coinbaseRequiredOutputs: Array.isArray(blockTemplate.coinbase_required_outputs)
    ? blockTemplate.coinbase_required_outputs
    : null

// 3. pass `coinbaseRequiredOutputs` on wherever `height` and `clearJobs` are passed on
//    (the destructuring in the next map() and the blockData object it builds).

Then add the outputs when the coinbase is built, right after the witness commitment output:

dist/models/MiningJob.js
this.coinbaseTransaction.addOutput(
    bitcoinjs.script.compile([bitcoinjs.opcodes.OP_RETURN,
        Buffer.concat([segwitMagicBits, jobTemplate.block.witnessCommit])]), 0);

// Bitcoin MOI: from block 20,160 every coinbase must carry exactly the outputs the node
// lists in getblocktemplate coinbase_required_outputs: value 0, script as given, in order.
const requiredOutputs = jobTemplate.blockData.coinbaseRequiredOutputs;
if (Array.isArray(requiredOutputs)) {
    for (const out of requiredOutputs) {
        this.coinbaseTransaction.addOutput(Buffer.from(out.script, 'hex'), 0);
    }
}
else if (configService.get('NETWORK') === 'mainnet' && jobTemplate.blockData.height >= 20160) {
    throw new Error('getblocktemplate has no coinbase_required_outputs past the gate: '
        + 'refusing to build an invalid job');
}
The complete public-pool change as a patch (2 files)
unified diff against the built files in dist/
--- a/dist/models/MiningJob.js
+++ b/dist/models/MiningJob.js
@@ -28,6 +28,17 @@
         }
         this.coinbaseTransaction.ins[0].script = script;
         this.coinbaseTransaction.addOutput(bitcoinjs.script.compile([bitcoinjs.opcodes.OP_RETURN, Buffer.concat([segwitMagicBits, jobTemplate.block.witnessCommit])]), 0);
+        // Bitcoin MOI drivechain gate: from block 20,160 every coinbase must carry exactly the outputs the
+        // node lists in getblocktemplate coinbase_required_outputs (the SCDB commitment), value 0, script as given, in order.
+        const requiredOutputs = jobTemplate.blockData.coinbaseRequiredOutputs;
+        if (Array.isArray(requiredOutputs)) {
+            for (const out of requiredOutputs) {
+                this.coinbaseTransaction.addOutput(Buffer.from(out.script, 'hex'), 0);
+            }
+        }
+        else if (configService.get('NETWORK') === 'mainnet' && jobTemplate.blockData.height >= 20160) {
+            throw new Error('getblocktemplate has no coinbase_required_outputs past the MOI drivechain gate: refusing to build an invalid job');
+        }
         if ((this.coinbaseTransaction.weight() + jobTemplate.block.weight()) > MAX_BLOCK_WEIGHT) {
             console.warn('Block weight exceeds the maximum allowed weight, removing the pool identifier');
             let script = Buffer.concat([blockHeightLengthByte, blockHeightEncoded, padding]);
--- a/dist/services/stratum-v1-jobs.service.js
+++ b/dist/services/stratum-v1-jobs.service.js
@@ -52,6 +52,7 @@
                 timestamp,
                 blockTemplate.height,
                 blockTemplate.coinbasevalue,
+                JSON.stringify(blockTemplate.coinbase_required_outputs ?? null),
                 ...blockTemplate.transactions.map(tx => tx.hash ?? tx.txid ?? tx.data)
             ].join('|');
             if (!clearJobs && workSignature === this.lastWorkSignature) {
@@ -67,9 +68,11 @@
                 timestamp,
                 networkDifficulty: this.calculateNetworkDifficulty(parseInt(blockTemplate.bits, 16)),
                 clearJobs,
-                height: blockTemplate.height
+                height: blockTemplate.height,
+                // Bitcoin MOI drivechain gate: outputs every coinbase must carry (SCDB commitment)
+                coinbaseRequiredOutputs: Array.isArray(blockTemplate.coinbase_required_outputs) ? blockTemplate.coinbase_required_outputs : null
             };
-        }), (0, rxjs_1.filter)(next => next != null), (0, rxjs_1.map)(({ version, bits, prevHash, transactions, timestamp, coinbasevalue, networkDifficulty, clearJobs, height }) => {
+        }), (0, rxjs_1.filter)(next => next != null), (0, rxjs_1.map)(({ version, bits, prevHash, transactions, timestamp, coinbasevalue, networkDifficulty, clearJobs, height, coinbaseRequiredOutputs }) => {
             const block = new bitcoinjs.Block();
             const tempCoinbaseTx = new bitcoinjs.Transaction();
             tempCoinbaseTx.version = 2;
@@ -98,7 +101,8 @@
                     coinbasevalue,
                     networkDifficulty,
                     height,
-                    clearJobs
+                    clearJobs,
+                    coinbaseRequiredOutputs
                 }
             };
         }), (0, rxjs_1.tap)((data) => {

Code: ckpool (C)

In the function that builds the coinbase, read the list from the template, make room for it, and write the outputs after the witness commitment. This is from a ckpool tree that parses JSON with yyjson; with a jansson build use json_object_get, json_array_size, json_array_get and json_string_value instead.

src/stratifier.c
yyjson_val *required = yyjson_obj_get(wb->gbtroot, "coinbase_required_outputs");
int required_count = yyjson_arr_size(required), required_len = 0, i;

/* Room for the outputs: 8 bytes value + up to 3 bytes length + the script, each. */
for (i = 0; i < required_count; i++) {
	const char *script = yyjson_get_str(yyjson_obj_get(yyjson_arr_get(required, i), "script"));

	required_len += 8 + 3 + strlen(script) / 2;
}

/* Make the two coinbase buffers that much larger ... */
wb->coinb2bin = ckzalloc(512 + required_len);
wb->coinb3bin = ckzalloc(256 + wb->insert_witness * (8 + witnessdata_size + 2) + required_len);

/* ... and count the outputs: payout + witness commitment + required outputs
 * (2 + ... instead of 1 + ... where a second payout output is written). */
wb->coinb2len += ser_compact_size(wb->coinb2bin + wb->coinb2len,
				  1 + wb->insert_witness + required_count);

/* ... payout output(s) and the witness commitment are written here, as before ... */

/* Bitcoin MOI: every coinbase_required_outputs entry of THIS template, once,
 * unchanged, value 0. The block is refused as bad-scdb-commitment otherwise. */
for (i = 0; i < required_count; i++) {
	const char *script = yyjson_get_str(yyjson_obj_get(yyjson_arr_get(required, i), "script"));
	int slen = strlen(script) / 2;

	wb->coinb3len += 8; /* value 0: the buffer is zeroed */
	wb->coinb3len += ser_compact_size((uchar *)wb->coinb3bin + wb->coinb3len, slen);
	hex2bin(&wb->coinb3bin[wb->coinb3len], script, slen);
	wb->coinb3len += slen;
}

/* ... then nLockTime, as before. */

Also refuse a template for block 20,160 or later that has no coinbase_required_outputs field at all (a node that is too old): better no job than a block that will be thrown away.

ckpool: the complete template check (refuse what cannot be copied unchanged)

Call it on the getblocktemplate result before the template is used, and drop the template if it returns false.

src/bitcoin.c
/* The first height whose block must carry the required coinbase outputs.
 * 20160 is mainnet; make it a config value for regtest (2000). */
#define MOI_DRIVECHAIN_GATE_HEIGHT 20160
#define MAX_GBT_REQUIRED_OUTPUTS_LEN 100000	/* the MOI block size: no template can exceed it */
int drivechain_gate_height = MOI_DRIVECHAIN_GATE_HEIGHT;

/* LOGREFUSAL: use your warning-level log macro (LOGWARNING in stock ckpool). */

/* Bitcoin MOI: check the coinbase_required_outputs a block must carry from the
 * drivechain gate on, so generate_coinbase() can copy them without further
 * checks. Refuse the template on anything we could not copy unchanged. */
static bool check_required_outputs(yyjson_val *res_val, const int height)
{
	yyjson_val *outs = yyjson_obj_get(res_val, "coinbase_required_outputs");
	size_t i, total = 0;

	if (!outs) {
		/* A MOI node exports the field, possibly empty, at every height
		 * from the gate on. Without it the block would lack the SCDB
		 * commitment and be invalid, or, against a node without the
		 * drivechain rules, start a fork of its own. */
		if (unlikely(height >= drivechain_gate_height)) {
			LOGREFUSAL("REFUSING TEMPLATE for height %d: no coinbase_required_outputs at or above "
				   "the drivechain gate %d, the node does not export them",
				   height, drivechain_gate_height);
			return false;
		}
		return true;	/* Absent below the gate */
	}
	if (unlikely(!yyjson_is_arr(outs))) {
		LOGREFUSAL("REFUSING TEMPLATE: coinbase_required_outputs is not an array");
		return false;
	}
	for (i = 0; i < yyjson_arr_size(outs); i++) {
		yyjson_val *entry = yyjson_arr_get(outs, i);
		yyjson_val *value = yyjson_obj_get(entry, "value");
		const char *script = yyjson_get_str(yyjson_obj_get(entry, "script"));
		size_t len = script ? strlen(script) : 0;

		/* Every entry today is a zero value OP_RETURN */
		if (unlikely(len < 4 || len % 2 || !validhex(script) || strncmp(script, "6a", 2) ||
			     !yyjson_is_uint(value) || yyjson_get_uint(value))) {
			LOGREFUSAL("REFUSING TEMPLATE: coinbase_required_outputs entry %d is not a zero value OP_RETURN",
				 (int)i);
			return false;
		}
		/* generate_coinbase() writes the script length as a 1 or 3
		 * byte compact size, as counted below. A longer script would
		 * need the 5 byte form; such an output is far beyond anything
		 * MOI consensus produces, so refuse it. */
		if (unlikely(len / 2 > 0xffff)) {
			LOGREFUSAL("REFUSING TEMPLATE: coinbase_required_outputs entry %d script is %d bytes, over 65535",
				   (int)i, (int)(len / 2));
			return false;
		}
		total += 8 + 3 + len / 2;
	}
	if (unlikely(total > MAX_GBT_REQUIRED_OUTPUTS_LEN)) {
		LOGREFUSAL("REFUSING TEMPLATE: coinbase_required_outputs total %d bytes is over the limit %d",
			 (int)total, MAX_GBT_REQUIRED_OUTPUTS_LEN);
		return false;
	}
	return true;
}

Test it on regtest

On regtest the gate is at block 2,000, so you can test today:

shell
moid -regtest -daemon
moi-cli -regtest createwallet test
moi-cli -regtest generatetoaddress 1999 "$(moi-cli -regtest getnewaddress)"

# what the next template asks for (block 2,000):
moi-cli -regtest getblocktemplate '{"rules":["segwit"]}' | grep -A 6 '"coinbase_required_outputs": \['

# now point your pool at this node and mine a few blocks through it, then:
moi-cli -regtest getblockcount        # must be above 2000: the node accepted your blocks
moi-cli -regtest getblock "$(moi-cli -regtest getblockhash 2000)" 2 | grep -c 6ad85cdb   # 0 = the output is missing

If your pool's blocks at 2,000 and above are refused, it is not ready for mainnet.

If you cannot change your pool in time, point your hashrate at a pool that is ready until you can: pool.bitcoin.moi or the solo pool vendetta.bitcoin.moi. Otherwise every block your pool finds from 20,160 on is lost.

3 · Sidechain commands

0.1.1 refuses createsidechainproposal, acksidechain, setwithdrawalvote and receivewithdrawalbundle until block 20,160 has connected. 0.1.0 accepted them and dropped them at the gate. Send them after the gate, and again after any reorg across block 20,160.

Questions

Ask in the Bitcoin MOI Telegram chat: t.me/bitcoinMOI