Bitcoin MOI 0.1.1 release notes
===============================

Bitcoin MOI 0.1.1 is a maintenance and safety release ahead of the drivechain gate at block **20,160**
(expected around **November 18-19, 2026**). It contains no change to the coin supply, the difficulty rules or
block validity before the gate.

Who should upgrade, and when
----------------------------

- **Miners and pool operators: upgrade before block 20,160.** 0.1.1 adds one block rule that starts at the
  gate (see "Consensus" below). A miner on 0.1.0 can build a block that 0.1.1 nodes refuse.
- **Everyone else: upgrade before block 20,160 if you can.** 0.1.0 nodes keep following the chain, but 0.1.1
  fixes a stall at the gate for nodes whose peers are all non-drivechain software, bounds the disk space
  used by sidechain records, and makes claiming the airdrop safer.
- Pool software must also add the drivechain commitment to the coinbase from block 20,160; see the pool
  notice. A pool node on 0.1.1 builds the right templates (`coinbase_required_outputs`).

How to upgrade
--------------

Shut down the node (`moi-cli stop`, or quit moi-qt), wait until it has exited, 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.

Downgrading to 0.1.0 once a 0.1.1 node has passed block 20,160 is not supported.

Consensus (from block 20,160)
-----------------------------

- The rule "only a sidechain withdrawal may send coins back to an escrow with the `D` destination" now also
  covers transactions that spend no escrow coin. Before, a miner could put such a transaction into a block
  directly (nodes never relayed it) and create a second escrow coin beside the escrow's treasury coin. Blocks
  carrying one are now refused (`bad-deposit-withdrawal-dest`). Ordinary deposits and withdrawals are not
  affected. No escrow output can exist before the first sidechain slot activates (about block 40,320 at the
  earliest), so no block in the current chain is affected.

Drivechain gate
---------------

- **Sidechain commands before the gate are refused.** `createsidechainproposal`, `acksidechain`,
  `setwithdrawalvote` and `receivewithdrawalbundle` now return an error until block 20,160 has connected. In 0.1.0 they were
  accepted, and connecting the gate block silently dropped them. Send them again after the gate.
- **Gate stall fixed.** After the gate a 0.1.0 node downloads blocks only from peers that advertise the
  drivechain service bit. A node whose outbound peers all lacked the bit saw the new headers and stopped at
  the gate. 0.1.1 downloads from any peer; the blocks are byte for byte the same.
- **Reorg of the gate block.** If the gate block itself is replaced by a competing block, the node now keeps
  its own sidechain proposals, ACKs, votes and raw bundles instead of emptying them.
- **Memory pool.** The deposit rule no longer walks the whole memory pool for every deposit check; a per-slot
  index does the same job.

Sidechain record thinning (disk space)
--------------------------------------

From the gate on, the node writes a record of the sidechain state for every block. 0.1.0 never removed these
records. 0.1.1 keeps the full records of the last 2 x `-maxreorgdepth` blocks (2,880 blocks, about two days,
with the default of 1,440) and stores only what a deeper reorg check needs below that.

What this means for you:

- Nothing changes within the last 2,880 blocks: the node follows reorgs there exactly as before.
- A competing chain that forks deeper than that is refused even with `-maxreorgdepth=0`, and
  `invalidateblock` below that depth is refused. The node keeps running, shows a warning in
  `getblockchaininfo` (`scdb_horizon_refused`), in moi-qt and through `-alertnotify`, and names the fork.
- To follow such a chain after checking it, restart once with `-reindex-chainstate -maxreorgdepth=0`
  (a pruned node: `-reindex -maxreorgdepth=0`), then restart without those options. `-reindex-chainstate`
  alone follows the chain with the most work.
- A reorg that deep is outside the normal reorg limit anyway; this only matters if you deliberately follow
  a very deep fork.

Checkpoint
----------

- Mainnet now has a checkpoint at block **8,000**, with the minimum chain work set to that block.
- The checkpoint is now enforced when the node chooses its chain, not only when it accepts a header.
  Before, a branch stored before the checkpoint shipped could still be activated. A node that already
  follows a chain that conflicts with a checkpoint keeps its tip, stops extending it and shows a warning
  naming the `invalidateblock` that moves it to the checkpointed chain.

Claiming the airdrop safely (replaces the 0.1.0 claim advice)
-------------------------------------------------------------

Bitcoin MOI uses the same private keys, address formats, WIF prefixes and transaction
signatures as Bitcoin (and reads Dogecoin WIFs). MOI's replay protection only moves
every snapshot coin to a NEW outpoint, so a transaction signed on Bitcoin or Dogecoin
never spends a MOI coin. It does **not** work the other way round: a transaction that
spends one of your real Bitcoin or Dogecoin coins, signed with the same key on MOI,
is a valid transaction on Bitcoin or Dogecoin. A "claim helper" (a website, a bot, a
person in a chat) that hands you a transaction or a PSBT to "sign in your MOI wallet"
can use this to take your real coins.

Before you claim:

1. **Move your coins on the source chain first.** Send your Bitcoin, Dogecoin and
   Skydoge to a NEW address of a wallet whose keys you will never type into anything
   else, and wait until that transaction is confirmed. Only then use the OLD key (the
   one that held the coins at the snapshot) to claim on MOI. A key that holds nothing
   any more on the source chain cannot lose anything there, whatever you sign.
2. **Never sign a transaction someone else built for you**, in moi-qt (File > Load
   PSBT from file/clipboard > Sign) or with `signrawtransactionwithkey`,
   `signrawtransactionwithwallet`, `walletprocesspsbt` or `descriptorprocesspsbt`.
   MOI finds and builds your claim itself.
   The one exception is a multisig claim among cosigners. When `claimairdrop` cannot
   sign a multisig coin alone, it returns the partly signed transaction hex
   (`complete = false`) and each cosigner then signs that hex with
   `signrawtransactionwithkey`. As a cosigner, sign such a hex only if it was built by
   the claim tool (`claimairdrop`) and only after you checked it yourself with
   `decoderawtransaction`:
   - every input appears in `findairdrop` for the multisig (its descriptor, e.g.
     `sh(multi(2,K1,K2,K3))` with the public keys, or its script hex), and
   - the output pays an address you expect (the one the cosigners agreed on).
   If an input is not listed by `findairdrop`, do not sign.
3. **Claim with the claim tool only:** moi-qt **File > Claim airdrop...**, or
   `moi-cli -stdin claimairdrop` with the key typed on the first line. It looks your
   coins up in MOI's own UTXO set, never stores the key and, by default, pays only to
   an address of your own wallet: another address is refused unless you pass
   `allow_foreign=true`, and an address that is only watch-only in your wallet (no
   private key there) is accepted with a warning. In both cases the MOI goes to
   whoever holds that address's key. `findairdrop` (read-only) shows what is claimable
   first.
4. Do not import a source-chain key or an xprv into a MOI wallet that you keep using,
   and do not copy a Bitcoin Core `wallet.dat` into MOI. If you did, move the
   source-chain coins of those keys first (point 1).
5. Do not sign messages "to prove ownership on MOI" for anyone you do not trust (see
   Message signing below).

The 0.1.0 notes also described claiming with `signrawtransactionwithkey` (the coin as
`prevtxs`) or by importing the WIF and using `signrawtransactionwithwallet`. Those
still work for a real snapshot coin (it is in MOI's UTXO set), but are the advanced
route; prefer `claimairdrop`, and follow points 1 and 2 above whichever way you claim
(for a multisig claim, the cosigner checks in point 2).

Wallet and RPC: refuse to sign coins that are not on MOI
--------------------------------------------------------

- `signrawtransactionwithkey`, `signrawtransactionwithwallet`, `walletprocesspsbt`
  (with signing on), `descriptorprocesspsbt` and moi-qt's PSBT **Sign** button now
  refuse to sign when an input spends a coin that is neither
  - in MOI's UTXO set or memory pool (the snapshot airdrop coins are in the UTXO set,
    the same place `claimairdrop` and `findairdrop` look), nor
  - for the wallet calls, an output of one of the wallet's own transactions that is
    confirmed in the active chain or in the memory pool.
  The error names the inputs and the risk. Nothing is signed (the whole call is
  refused, also for the inputs that are on MOI). Updating a PSBT without signing
  (`walletprocesspsbt` with `sign=false`, `utxoupdatepsbt`) is not affected. PSBT
  inputs that already carry a final script are not checked; the two raw-transaction
  calls check every input, signed or not.
- Unconfirmed wallet transactions that are not in the memory pool do not count as
  "on MOI": a wallet file copied from Bitcoin Core loads its Bitcoin transactions in
  that state. For the same reason `send` and `sendall` refuse an input you name
  yourself when it comes from such a transaction.
- Opt-in for offline signing (a machine without the current UTXO set): the new
  argument `allow_unknown_inputs=true` on each of the four RPCs, or start the node with
  `-allowsignunknowninputs=1` (all RPCs, `send`/`sendall` with such an input, and the
  GUI). Use it only on an offline signing machine for transactions you built yourself.
- Affected workflows: signing a chain of transactions whose parent is not yet in the
  memory pool, and offline/cold signing, need the opt-in. Wallet sends (`send`,
  `sendtoaddress`, `sendall`, `bumpfee`, the Send tab), `claimairdrop`, multisig claims
  (each cosigner's `signrawtransactionwithkey` on the hex `claimairdrop` returned, with
  the checks in point 2 above) and deposits are unchanged.

Message signing
---------------

- `signmessage`, `signmessagewithprivkey` and moi-qt's Sign Message now sign with
  MOI's own magic text `"Bitcoin MOI Signed Message:\n"` instead of Bitcoin's
  `"Bitcoin Signed Message:\n"`. A message signed in MOI 0.1.0 for an address was
  byte for byte a valid Bitcoin signed message for the same address (same keys and
  address formats), so a statement made "for MOI" could be shown to a Bitcoin service.
  New MOI signatures are no longer valid Bitcoin signed messages.
- `verifymessage` and moi-qt's Verify Message accept both magics, so signatures made
  with MOI 0.1.0 (and Bitcoin signatures of the same keys) still verify. Note that this
  means a Bitcoin signed message still verifies on MOI: a MOI service that needs a
  MOI-only proof should check that the signature is a new one (signed by 0.1.1 or
  later) or ask for a fresh challenge text.
- Tools that verify MOI signatures with Bitcoin's magic (for example external message
  verifiers) need MOI's magic for signatures made by 0.1.1 and later.

Airdrop and snapshot
--------------------

- The snapshot loader checks each coin's script length before reading the script, hashes the bytes it
  actually parsed, and clears its "load in progress" marker when no coins were written.
- The airdrop index file is checked leaf by leaf, with a bound on the number of leaves.
- A coin database record that cannot be decoded, or a read error of the coin database, now makes
  `findairdrop`, `claimairdrop`, `gettxoutsetinfo` and `dumptxoutset` return an error. Before, the scan
  stopped early and reported a partial result (a partial claim could be broadcast).
- A failed `findairdrop` full scan is now an error instead of looking like the end of the file.
- `claimairdrop` warns when it picks a watch-only destination automatically.
- `-coinstatsindex` is refused on a network with a genesis snapshot (it would count the snapshot wrongly).

Wallet
------

- Loading another coin's `wallet.dat` (for example a Bitcoin Core wallet) is refused before any migration,
  with a clear error.
- A custom change address that MOI does not allow (a P2SH change address) is refused only when the
  transaction actually creates change.
- Signing safety, the new claim advice and message signing: see the three sections above
  ("Claiming the airdrop safely", "Wallet and RPC: refuse to sign coins that are not on MOI",
  "Message signing").

GUI
---

- When the node is synced, the moi-qt status bar shows "Last block: N ago" on its left side, refreshed
  every second, with the block height and the block time in its tooltip. While the node is catching up the
  label is hidden (the progress bar already shows how far behind the tip is).

Network
-------

- NAT-PMP port mapping (`-natpmp`) is now off by default. 0.1.0 (like Bitcoin Core v31) asked the router to open a
  port every few minutes; turn it on with `-natpmp=1` if you want incoming connections that way.

Build and packaging
-------------------

- macOS arm64 (Apple Silicon): the programs are now ad-hoc signed, so they run without signing your own copy
  first. They are not notarised: macOS still shows a warning the first time.
- Linux: the desktop entry quotes the moi-qt path (paths with spaces work).

Tests
-----

New functional tests: feature_moi_drivechain_pregate_rpc, feature_moi_scdb_record_thin,
feature_moi_scdb_record_thin_bundles, feature_moi_nondrivechain_peer_sync, feature_moi_gate_reorg_caches,
feature_moi_withdrawal_dest_consensus, feature_moi_checkpoint_stored, feature_moi_coinstatsindex,
feature_moi_claim_scan_error (extended), wallet_moi_signguard;
unit tests for record thinning, the pre-gate caches, the escrow index and the sign guard.
The functional tests run with the sign guard on; the few tests that sign coins that are not on the chain
on purpose start their node with `-allowsignunknowninputs=1`.
