# BTCRELAY Topic Manager (`tm_btcrelay`)

Admits outputs of the **btc-relay beacon** protocol on BSV mainnet: the
beacon covenant lock, its checkpoint snapshots, and (when configured) fuel
deposits.

## Classes

### beacon

Locking script = 185-byte committed push-tagged **prefix** + covenant
**suffix** (must be non-empty). Prefix layout (all numbers little-endian):

```
0x20 TIP[32]   0x04 HEIGHT[4]   0x04 NBITS[4]   0x04 PREV_NBITS[4]
0x04 EPOCH_START[4]   0x04 PREV_EPOCH_START[4]   0x2c MTP_RING[44]
0x20 ACC_WORK[32]   0x20 BUF_ROOT[32]   0x04 LAST_CRANK[4]
0x08 GID[8]   0x01 STATE(0x01 = OPEN)
```

GID bytes sit at script offset `175..183`. **Any** 8-byte GID is admitted —
an overlay indexes, it does not authenticate; consumers filter records by
`gid` and chain-verify everything that matters.

### checkpoint

A 0-sat OP_RETURN snapshot, exactly 87 bytes:

```
0x00 0x6a 0x08 GID[8] 0x20 TIP[32] 0x04 HEIGHT[4] 0x20 ACC_WORK[32] 0x04 LAST_CRANK[4]
```

### fuel

A standard P2PKH output whose PKH equals the configured
`BTCRELAY_FUEL_PKH` (40-hex). Empty/absent config disables the class.

## Admission rules

- Every output that parses as any class above is admitted.
- **All previous coins are retained** — the beacon lineage is the audit
  trail and must never be garbage-collected.
- A transaction with no BTCRELAY outputs *and* no previous BTCRELAY coins
  is rejected (`NoAdmissibleOutputs`).

No signature verification is performed at admission: the covenant suffix
enforces spend rules on-chain, and the overlay is a hint with proofs, never
truth.
