Implementation map

Code walkthrough

We do not host Knots C++ here. This page maps BIP-110’s seven rules to enforcement stages and points you at tagged source reviews. Spec status is Complete; reading the code is how you verify what a binary will do.

Seven rules → enforcement stages

Outputs (Rule 1)

New scriptPubKeys above 34 bytes fail, except OP_RETURN up to 83 bytes. Wired when the deployment asks for the output-size check (including coinbase via a separate path).

Activation flag

Versionbits state turns on reduced-data verification flags when the deployment is ACTIVE. Mandatory signaling is checked in a narrow pre-timeout window while still STARTED.

Script checks (Rules 2–7)

Interpreter reuses push/witness size checks with a 256-byte reduced cap; Taproot annexes, oversized control blocks, OP_SUCCESS, and Tapscript OP_IF/OP_NOTIF fail under the flag. P2SH redeemScript push keeps a narrow exception, then remaining stack items are checked.

Grandfathering

Per input: coins created before activation clear reduced-data flags for that input only. Same transaction can mix exempt and non-exempt inputs.

Expiry / mandatory signaling

Temporary deployments record activation height, expire after active_duration, can force LOCKED_IN near max activation, and reject non-signaling headers during the must-signal window.

Rule reference (plain language)

1 · Output scripts

Limit new outputs to 34-byte scripts; OP_RETURN may use up to 83 bytes.

2 · Data pushes

Cap OP_PUSHDATA / witness elements at 256 bytes (P2SH redeemScript exception).

3 · Witness versions

Reject spends of undefined witness/tapleaf versions while active.

4 · Annex

Taproot annexes fail under reduced-data rules.

5 · Control blocks

Cap control-block size (depth limit for spendable leaves during the window).

6 · OP_SUCCESS

Tapscripts containing OP_SUCCESS are invalid even if not executed.

7 · OP_IF

Executed OP_IF / OP_NOTIF in Tapscript fail while active.

Threshold

Deployment can use its own signaling threshold (55% / 1109) instead of the global default.

Five-step reading order

  1. Start with outputs — confirm every new output hits the 34/83-byte gate.
  2. Follow the activation switch — see how deployment state adds reduced-data flags.
  3. Trace script execution — same checks, tighter constants when the flag is on.
  4. Check grandfathering — per-input flag clears for pre-activation coins.
  5. Verify the timer — forced lock-in, ACTIVE height memory, expiry after duration.

Where to read source

Grandfathering is per input, not per transaction. Script-check caches that assume one flag set for every input are bypassed when per-input overrides exist.