GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(proof): require miner hotkey signature on submit by echobt · Pull Request #259 · CortexLM/cortex

Conversation

@echobt

@echobt Mathis (echobt) commented Sep 9, 2026 •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

Mandatory miner sr25519 signature on Proof POST /v1/submissions. A bare 64-hex miner_hotkey can no longer be spoofed, a captured signature cannot be reused with another claim / FLOPs / manifest, and an identical request cannot be replayed.

Architecte lock (domain base-proof-submit-v1, a new crypto::DomainTag; not a reuse of topic / bundle / rawweight):

payload = hotkey_hex || 0xff || topic_id || 0xff || artifact_digest || 0xff
        || declared_flops_decimal || 0xff || claim || 0xff
        || manifest_canonical || 0xff || submit_nonce_hex

manifest_canonical = count(hashes)_decimal   || (0xff || hash)*      # train_content_hashes, sorted bytewise
                   || 0xff ||
                     count(datasets)_decimal || (0xff || dataset)*   # train_dataset_ids, sorted bytewise
  • Wire: required hotkey_signature (exactly 128 lowercase hex, no 0x) and submit_nonce (exactly 64 lowercase hex = 32 client-chosen random bytes). miner_hotkey is the 64-hex public key that must verify the signature.
  • Server: after parse + topic-open checks, verify before insert. Missing/empty sig → 401 hotkey_signature required; bad encoding / verify fail (incl. tampered manifest) → 401 hotkey_signature invalid; nonce missing / malformed → 401 submit_nonce required / submit_nonce invalid. Then (hotkey, nonce) is reserved atomically in the submission store before any budget check, rent, or row: a replay is 401 submit_nonce reused and never evaluates twice. No unsigned grace. Refusals leave no row.
  • Client: ctx proof submit / ctx proof sign sign via keystore (Substrate/sr25519), draw a fresh nonce per run, print submit_nonce + the exact manifest to post; --submit-nonce pins one (required with --signature).
  • Docs: gateway host + signature + nonce required; exact bytes and a Python reference in docs/external-miner/proof.md.
  • Out of scope: X-Lium-Api-Key is not identity. Queued / defer_scoring stays on its own PR.

New crate crates/proof-submit (proof-task is at the loc-cap). MemoryStore gains submit_nonce on rows and reserve_submit_nonce (same durability as the rows: Proof submission state is in-memory today).

Greptile

Every PR is reviewed by Greptile before merge. Config: .greptile/.

  • Greptile has reviewed this PR; findings are fixed (P1 manifest, P1 replay, P2 encoding) — re-review requested
  • Commented @greptileai review

Test plan

  • cargo test -p proof-submit (payload bytes, canonical manifest injectivity, strict hex, round-trip / tamper / wrong key)
  • cargo test -p proof-store (nonce reserved once per hotkey)
  • cargo test -p proof-http --lib (401 rows: missing / zero / 0x / uppercase / wrong-key sig; missing / malformed nonce; tampered manifest; identical replay → 401 + one row; reordered manifest with a fresh nonce → 201)
  • cargo test -p proof-http --test live_submit_e2e
  • cargo test -p ctx (secret-file signs manifest + nonce, fresh nonce per run, offline signature needs its nonce, CLI parse)
  • cargo test -p proof-rlm-scorer --test rlm_e2e
  • cargo test -p proof-challenge-bin --test submit_e2e
  • cargo clippy -p proof-submit -p proof-store -p proof-http -p ctx -p proof-rlm-scorer -p proof-challenge-bin -p xtask --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • cargo run -p xtask -- loc-cap · external-docs-check
  • deploy/scripts/proof-submit-sign.sh exercised locally (fresh + pinned nonce); proof-submit-e2e.sh --probe replays a scored body and expects 401 submit_nonce reused

Risk

New cryptographic domain base-proof-submit-v1 (additive; existing base-* tags unchanged). Live Proof submits without hotkey_signature + submit_nonce will 401. Miner docs, ctx, and operator probes updated. No BASE_* rename, no emission / leaf / seal change.

Naming

I did not rename BASE_* environment variables, deployed host paths
(/opt/base, /run/base, …), GHCR baseintelligence/base package names, or
base-*-v1 cryptographic domain tags, unless this PR’s purpose is a coordinated
cutover documented in docs/NAMING.md.

This PR adds base-proof-submit-v1 alongside base-proof-topic-v1.

Open in Web Open in Cursor 

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
@cursor

cursor Bot commented Sep 9, 2026

Copy link
Copy Markdown

Greptile (@greptileai) review

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@echobt Mathis (echobt) mentioned this pull request Sep 9, 2026
feat(proof): queued submissions with defer_scoring and operator drain #260
Merged
4 tasks
@echobt
Mathis (echobt) marked this pull request as ready for review September 9, 2026 23:44
@echobt

Mathis (echobt) commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Greptile (@greptileai)

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Sep 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Greptile Summary

This update authenticates Proof submissions with miner sr25519 signatures, binds the canonical manifest and a one-time nonce into the signed payload, and rejects replayed requests before evaluation or persistence. It also standardizes hexadecimal request encodings and prevents ambiguous signer selection in the CLI.

Confidence Score: 5/5

Safe to merge; there are no outstanding blocking issues.

No new findings were identified. The previously reported issues are fixed in the current implementation: manifests are included in signed payloads, submit nonces are single-use and reserved before processing, hexadecimal wire values are canonicalized and validated consistently, signed values are verified without host-side normalization, and credential sources are mutually exclusive.

Files Needing Attention: None.

Reviews (6): Last reviewed commit: "refactor(ctx): spell hex only through pr..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Sep 9, 2026
View reviewed changes
Comment thread crates/proof-submit/src/lib.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread crates/proof-submit/src/lib.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread crates/proof-submit/src/lib.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Sep 9, 2026
View reviewed changes
Comment thread crates/proof-submit/src/lib.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread crates/proof-http/src/lib.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread bins/ctx/src/main.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor Bot pushed a commit that referenced this pull request Sep 10, 2026
@cursoragent @echobt
feat(proof): sign the manifest and require a single-use submit_nonce
e42bf38
Greptile P1s on #259. The base-proof-submit-v1 payload now ends with
manifest_canonical || 0xff || submit_nonce_hex, where manifest_canonical
is count || (0xff || entry)* per list (train_content_hashes, then
train_dataset_ids), entries sorted bytewise, lists joined by 0xff. A
captured signature cannot be reused with another contamination manifest.

submit_nonce is a client-chosen 32-byte value as 64 lowercase hex. The
host verifies the signature, then reserves (hotkey, nonce) atomically in
the submission store before any budget check, rent, or row; a replay is
401 submit_nonce reused and never evaluates twice. Missing/invalid nonce
is 401. hotkey_signature is now exactly 128 lowercase hex, no 0x (P2).

ctx proof submit / sign draw a fresh nonce per run, print it, and sign
the manifest they post; --submit-nonce pins one (required with
--signature). Operator sign script and probes pass the manifest through;
the e2e probe replays a scored body and expects 401.

Co-authored-by: Mathis <[email protected]>
@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile (@greptileai) review

Both P1s and the P2 are addressed in e42bf38 (Architecte lock, domain unchanged base-proof-submit-v1):

  • Manifest is signed — payload is now hotkey || 0xff || topic_id || 0xff || artifact_digest || 0xff || declared_flops || 0xff || claim || 0xff || manifest_canonical || 0xff || submit_nonce_hex. manifest_canonical = count(hashes) || (0xff || hash)* || 0xff || count(datasets) || (0xff || dataset)*, entries sorted bytewise (UTF-8 never contains 0xff, so it is injective). Tampering with manifest after signing is 401 hotkey_signature invalid (test).
  • Replay — client-chosen 32-byte submit_nonce (64 lowercase hex) is required, bound into the signature, and MemoryStore::reserve_submit_nonce(hotkey, nonce) does an atomic check-and-insert right after signature verification and before budget checks, rent, or any row. Identical replay is 401 submit_nonce reused with no second row (test + e2e probe).
  • P2 — hotkey_signature is exactly 128 lowercase hex, no 0x; submit_nonce exactly 64 lowercase hex (tests for 0x, uppercase, whitespace, short).
greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor Bot pushed a commit that referenced this pull request Sep 10, 2026
@cursoragent @echobt
fix(proof): verify submit hex fields as posted; one signer per ctx run
d191223
Greptile follow-ups on #259. The host no longer normalises miner_hotkey
or artifact_digest before verifying: both are accepted only as exactly
64 lowercase hex (400 otherwise), and topic_id is verified verbatim
(trimmed only for lookup), so the bytes a miner signs are the bytes the
host checks. attach_to_json canonicalises the digest it signs and writes
it back, so probes post what they signed.

ctx signer options are mutually exclusive (clap conflicts plus a runtime
guard): --secret-file, --wallet-name, or --signature, never a silent
override; --wallet-dir requires --wallet-name; --signature requires
--hotkey and --submit-nonce.

Co-authored-by: Mathis <[email protected]>
@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile (@greptileai) review

Head is now d191223. Note the two reviews so far are pinned to e6d59e1 (pre-nonce); please review the current head.

  • P1 manifest not signed — fixed in e42bf38: manifest_canonical (train_content_hashes + train_dataset_ids, count-prefixed, 0xff-joined, sorted bytewise) is in the signed payload. Tampering → 401 hotkey_signature invalid (test).
  • P1 replay — fixed in e42bf38: required 64-hex submit_nonce in the signed payload; MemoryStore::reserve_submit_nonce(hotkey, nonce) is an atomic check-and-insert right after verification and before budget checks, rent, or any row. Identical replay → 401 submit_nonce reused, no second row (test + e2e probe). The deterministic nonce_from freeze digest is unchanged and no longer load-bearing for replay.
  • P1 canonicalization mismatch — fixed in d191223: the host never normalises a hex field before verifying. miner_hotkey / artifact_digest are accepted only as exactly 64 lowercase hex (400 invalid …: exactly 64 lowercase hex, no 0x otherwise) and topic_id is verified verbatim (trimmed only for lookup), so signed bytes == verified bytes. attach_to_json canonicalises the digest it signs and writes it back. Tests cover uppercase / 0x / whitespace on both fields, a padded topic_id round-trip, and a loosely pasted digest.
  • P2 signature encoding — exactly 128 lowercase hex, no 0x (e42bf38).
  • P2 credential sources — fixed in d191223: clap conflicts_with on --secret-file / --wallet-name / --signature, --wallet-dir requires --wallet-name, --signature requires --hotkey + --submit-nonce, plus a runtime guard for library callers (tests).
greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Cursor Agent (cursoragent) and others added 5 commits September 10, 2026 00:31
@cursoragent @echobt
feat(proof): require miner hotkey signature on submit
e246973
POST /v1/submissions requires hotkey_signature (128 hex sr25519)
under domain base-proof-submit-v1. Payload is hotkey||0xff||topic_id||
0xff||artifact_digest||0xff||declared_flops||0xff||claim. Missing or
invalid signatures return 401 with no row. ctx proof submit/sign via
keystore. Lium API keys are not identity.

Co-authored-by: Mathis <[email protected]>
@cursoragent @echobt
test(proof-http): keep miner_hotkey on zero-sig 401 probe
48d4dd3
The all-zero hotkey_signature case skipped attach_to_json, so Axum
rejected a missing miner_hotkey with 422 before the 401 handler ran.

Co-authored-by: Mathis <[email protected]>
@cursoragent @echobt
feat(proof): sign the manifest and require a single-use submit_nonce
ca28099
Greptile P1s on #259. The base-proof-submit-v1 payload now ends with
manifest_canonical || 0xff || submit_nonce_hex, where manifest_canonical
is count || (0xff || entry)* per list (train_content_hashes, then
train_dataset_ids), entries sorted bytewise, lists joined by 0xff. A
captured signature cannot be reused with another contamination manifest.

submit_nonce is a client-chosen 32-byte value as 64 lowercase hex. The
host verifies the signature, then reserves (hotkey, nonce) atomically in
the submission store before any budget check, rent, or row; a replay is
401 submit_nonce reused and never evaluates twice. Missing/invalid nonce
is 401. hotkey_signature is now exactly 128 lowercase hex, no 0x (P2).

ctx proof submit / sign draw a fresh nonce per run, print it, and sign
the manifest they post; --submit-nonce pins one (required with
--signature). Operator sign script and probes pass the manifest through;
the e2e probe replays a scored body and expects 401.

Co-authored-by: Mathis <[email protected]>
@cursoragent @echobt
fix(proof): verify submit hex fields as posted; one signer per ctx run
6c8bba2
Greptile follow-ups on #259. The host no longer normalises miner_hotkey
or artifact_digest before verifying: both are accepted only as exactly
64 lowercase hex (400 otherwise), and topic_id is verified verbatim
(trimmed only for lookup), so the bytes a miner signs are the bytes the
host checks. attach_to_json canonicalises the digest it signs and writes
it back, so probes post what they signed.

ctx signer options are mutually exclusive (clap conflicts plus a runtime
guard): --secret-file, --wallet-name, or --signature, never a silent
override; --wallet-dir requires --wallet-name; --signature requires
--hotkey and --submit-nonce.

Co-authored-by: Mathis <[email protected]>
@cursoragent @echobt
docs(proof): a queued re-send needs a fresh submit_nonce
e009b03
After the rebase onto #260: the same artefact re-sent to a deferring
topic still finds its row (200), but only when freshly signed with a new
nonce; a byte-identical replay is 401 submit_nonce reused.

Co-authored-by: Mathis <[email protected]>
@cursor
cursor Bot force-pushed the cursor/proof-submit-hotkey-sig-e053 branch from d191223 to e009b03 Compare September 10, 2026 00:36
@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile (@greptileai) review

Rebased onto main after #260 (queued / defer_scoring); head is e009b03. Both features are kept: the signature + submit_nonce gate runs after the topic checks and before the intake row is built, so a deferring topic still queues (201) and a freshly signed re-send still finds its row (200), while a byte-identical replay is 401 submit_nonce reused. Payload v2 unchanged (base-proof-submit-v1, manifest_canonical + submit_nonce). All prior threads replied to and resolved; please review the current head.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursoragent @echobt
refactor(ctx): spell hex only through proof-submit's canonicaliser
dbec1a3
Architecte lock: one encoder for signer and verifier. ctx no longer
carries its own trim/0x/lowercase logic; --hotkey, --artifact-digest,
--signature, and --submit-nonce go through proof_submit::canonical_hex
and is_lowercase_hex, the same predicate proof-http's parser accepts.
proof-http's empty-digest message check uses canonical_hex as well.

Co-authored-by: Mathis <[email protected]>
@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile (@greptileai) review

dbec1a3: one encoder, one canonicaliser. Payload bytes for both the ctx signer and the proof-http verifier come from proof_submit::SubmitFields::signing_payload (hotkey / topic / digest / FLOPs / claim / manifest_canonical / nonce); no other crate builds them. Hex form is likewise owned by proof-submit (canonical_hex / is_lowercase_hex): ctx no longer has its own trim/0x/lowercase logic, and proof-http never normalises before verifying — it accepts only the canonical form and verifies the posted bytes verbatim.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@echobt

Mathis (echobt) commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Greptile (@greptileai)

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@echobt
Mathis (echobt) merged commit af6bec9 into main Sep 10, 2026
5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@echobt
Mathis (echobt) deleted the cursor/proof-submit-hotkey-sig-e053 branch September 10, 2026 00:49
cursor Bot pushed a commit that referenced this pull request Sep 10, 2026
@cursoragent @echobt
deploy: staging pins for af6bec9
3abe69c
images.yml GH013 on main after #259. previous is the complete a8b9018 set.

Co-authored-by: Mathis <[email protected]>
@cursor cursor Bot mentioned this pull request Sep 10, 2026
deploy: staging pins for 41b51ac3 (images.yml GH013) #257
Merged
5 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
+1 more reviewer
@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@echobt @cursoragent
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.