interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / spec / searchtrace / G3_SEALED_HOLDOUT_COMMITMENT_V1.md

168 lines · 7566 bytes Raw Blame History Source

G3 Sealed-Holdout Commitment Format V1

Status: format only. No training, no real held-out data. Implementation: src/searchtrace/st_holdout.{h,c}; tests: tests/searchtrace/test_st_holdout.c.

Purpose

A held-out task set is committed to publicly before any learner runs. The task-set bytes and a secret 32-byte salt stay sealed. A later reveal proves the revealed set is byte-for-byte the committed one. The salt prevents brute-force confirmation of guessed task sets from the public record.

Inputs

Commitment

commitment = SHA-256( "omega.g3.holdout.commit.v1" 0x00
                      || salt[32]
                      || u64be(taskset_len)
                      || u32be(task_count)
                      || taskset )

salt_digest = SHA-256( "omega.g3.holdout.salt.v1" 0x00 || salt[32] )

Choices: domain strings are NUL-terminated so no prefix ambiguity; length and count are fixed-width big-endian so the preimage is unambiguous; the salt digest is domain-separated from the commitment so it cannot be confused with it. Publishing salt_digest lets the reveal check the salt first and give a specific refusal; it leaks nothing useful because the salt is 256 random bits.

Record (canonical ASCII, LF only, fixed order, no trailing spaces)

OMEGA-G3-HOLDOUT-COMMIT v1
domain omega.g3.holdout.commit.v1
holdout_id <label>
task_count <decimal, 1..4294967295, no leading zero>
taskset_len <decimal, u64, no leading zero>
salt_digest <64 lowercase hex>
commitment <64 lowercase hex>
end <64 lowercase hex>

end = SHA-256 of every record byte before the end line (including the LF of the commitment line). The record ends with exactly one LF after the end hex; nothing follows. The file is content-addressed: g3-commit-<sha256 of the whole record, lowercase hex>.txt.

Parser refusals (st_holdout_parse)

Wrong magic or version; wrong domain; missing, extra or reordered field; hex not 64 chars, non-hex char, uppercase hex; bad label; zero tasks; decimal with leading zero, non-digit or out of range; taskset_len < 5 * task_count (each counted line holds at least task ); truncated record (no end line, or line without LF); end digest mismatch; trailing bytes after the end line; any CR byte; any NUL byte; record longer than 1024 bytes.

Reveal (st_holdout_reveal)

Checks in order, refusing on the first failure: salt digest, task-set length, task count, commitment. Digest comparisons are constant-time.

Reveal receipt (st_holdout_reveal_receipt)

OMEGA-G3-HOLDOUT-REVEAL v1
domain omega.g3.holdout.commit.v1
holdout_id <label>
commitment <hex>
record_digest <hex: sha256 of the commitment record file>
task_count <n>
taskset_len <n>
repo_commit <40 lowercase hex>
verdict PASS
end <sha256 of the preceding receipt bytes>

Only PASS receipts exist; a failed reveal emits no receipt (the CLI prints the refusal reason and exits 2). The function does not re-verify: callers must get 0 from st_holdout_reveal first (the CLI does). A repo commit that is not exactly 40 lowercase hex is refused. File name: g3-reveal-<sha256 of the whole receipt>.txt.

CLI (st_holdout_cli, argv[0] = subcommand)

Exit codes: 0 ok, 2 refusal (including I/O failure), 1 usage. Files are written to a temp name, fsynced, then hard-linked into place (never overwritten).

Known-answer vector

salt = bytes 0x00..0x1f, taskset = task alpha\ntask beta\n (21 bytes, 2 tasks), holdout_id = g3-kat-1. Computed independently with printf + sha256sum:

Owner signature (detached, optional; lane 12)

The commitment record above is unchanged byte for byte (the known-answer vector still holds). An owner signature is a separate file next to it.

signed message = "omega.g3.holdout.sig.v1" 0x00 || <whole commitment record>

Pure Ed25519 (RFC 8032 section 5.1, no prehash, no context), from the in-house code vendored in src/searchtrace/sig/ (copied unchanged from aienos native/sig at 913b962; see PROVENANCE.txt; omega does not read the aienos tree at build time). Verification refuses non-canonical and small-order keys and signatures (aienos native/sig policy).

Signature record (canonical ASCII, LF only, fixed order, at most 1024 bytes):

OMEGA-G3-HOLDOUT-SIG v1
domain omega.g3.holdout.sig.v1
holdout_id <label, equal to the record's>
record_digest <64 lowercase hex: sha256 of the whole commitment record>
key_id <64 lowercase hex: sha256 of the 32-byte public key>
signature <128 lowercase hex>
end <64 lowercase hex: sha256 of every byte before "end ">

File name: g3-sig-<record_digest>.txt, same folder as g3-commit-<record_digest>.txt.

Strict verification (st_holdout_verify_signed, CLI verify --strict) checks in order and refuses on the first failure: commitment record parses (as above); signature present (else EUNSIGNED, -12); signature record canonical (EFORMAT) with matching end digest (EDIGEST); it names this record's holdout_id and record digest (EBIND, -13); its key_id is the given public key's (EKEY, -14); the Ed25519 signature verifies (ESIG, -15). verify <record> without --strict is unchanged (parse only, signature not required).

CLI:

Tests use only TEST keys (fixed labelled seeds, and random keys made and deleted by tests/searchtrace/test_st_holdout_sig_cli.sh; when openssl is installed it also checks the signatures independently). The real signature is made only in the offline owner key ceremony.

Out of scope

Salt generation, sealed storage of the task set and salt, signing the record with the real owner key (the signature format and tool exist, see above), publishing it to a timestamped location, and any real held-out data.