# RULESET-SNS-COMMIT-1 — v1.0 (frozen 2026-08-09)

Rules producing the committed SNS state. The sha256 of this exact file is
embedded in every sns-commit inscription; anyone re-running these rules
against the BSV chain MUST reproduce the committed root byte-for-byte.

## 1. Name validity (SNS-NAME-1, indexer rules)
A registration is a 1Sat-ordinals inscription whose JSON has p="sns",
op="reg". Name normalization: trim, lowercase. Valid: exactly one dot,
non-empty labels, no whitespace or control characters, 1-2048 bytes UTF-8;
all other characters including unicode are valid.

## 2. Canonicity (first valid claim)
Per name: the earliest valid registration wins, ordered by block height,
then transaction index within the block, then inscription record index.
Later claims of the same name are void.

## 3. Current state
The holder of a name is the owner of the sat carrying its winning
inscription, tracked by outpoint. Included in the committed state: every
name whose sat has a current holder (indexer location status "held" or
"contract"). Excluded: names with no current holder (status "burned").

## 4. Leaf content
Per name, canonical JSON, keys in this exact order, no whitespace:
{"v":1,"name":<name>,"origin":"<winner_txid>_<winner_vout>",
"outpoint":"<current_txid>_<current_vout>","script":"<hex>",
"pubkey":"<hex or empty>","h":<commit height>}
script = the locking script of the current outpoint: derived as P2PKH from
the holder address when the indexer records one (base58check-verified),
otherwise read directly from the transaction on-chain.

## 5. Tree
leaf_hash = SHA256(0x00 || leaf_bytes); node = SHA256(0x01 || L || R);
leaves sorted bytewise by name; odd node at any level is promoted.

## 6. Commit inscription
Canonical JSON {"p":"sns-commit","v":1,"root","h","names","ruleset","prev"},
inscribed as 1Sat-ordinals envelope (content-type application/json) to the
ODNCA commitment wallet, OP_RETURN tag "ODNCA.org", prev = txid of the
previous commit inscription (null for the genesis commit). Cadence: daily.
