Skip to content

status: janus-status-v1, the signed status a device answers a nonce with - #3

Merged
Ttimmahlax merged 1 commit into
mainfrom
status-proof
Oct 17, 2026
Merged

Ttimmahlax merged 1 commit into
mainfrom
status-proof

Conversation

@Ttimmahlax

Copy link
Copy Markdown
Contributor

The primitive behind Apollo's hard-toys Track 1 (a device flashed on dldeploy.com appears in Apollo with nobody clicking): a device proves who it is and who owns it, on the LAN, in answer to the verifier's nonce.

rusty_esp_mid_core::status:

  • StatusProof { nonce, device_did, owner_did, adoption_kind, adoption_hash } with unadopted / adopted
  • the message "janus-status-v1\n" | 1 | nonce(32) | len16(device_did) | len16(owner_did) | len16(adoption_kind) | sha256(adoption)(32) -- write, prehash (no allocation), sign(&impl DeviceSigner), verify (key from device_did, high-s refused)
  • kinds janus-adoption-v1, mata-statement-v1; parse_nonce_hex (exactly 64 lowercase hex)

Test vector (status::vector): a fixed test key, nonce 0..32, both DIDs, the expected message, prehash and signature (RFC 6979 deterministic, so a verifier can assert exact bytes). Cross-checked with an independent ECDSA (Python cryptography): the message rebuilt from the contract by hand, the DID derived from the key, the signature low-s and verifying.

Checks: cargo test -p rusty_esp_mid-core (58 pass), cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --check, cargo check --no-default-features for riscv32imac.

Not released: a crates.io release (0.1.4) is a separate step.

🤖 Generated with Claude Code

A home's hub (Apollo's server, later the MATA box) asks a device
GET /v1/status?nonce=<64 lowercase hex>; the device answers with its
claims and a signature by its own key over:

  "janus-status-v1\n" | version 1 | nonce(32) | len16(device_did)
  | len16(owner_did) | len16(adoption_kind) | sha256(adoption bytes)(32)

len16 is the adoption envelope's 2-byte big-endian length; unadopted is
empty owner and kind and 32 zero bytes. DeviceSigner::sign_prehash over
sha256(message): P-256 r||s, low-s, RFC 6979; StatusProof::verify takes
the key from device_did and refuses high-s. Kinds: janus-adoption-v1 and
mata-statement-v1 (a wallet signed statement container). No allocation:
the message is hashed as it is laid out.

The test vector pins the chip's bytes for a verifier: a fixed test key,
nonce 0..32, both DIDs, the expected message, prehash and signature --
cross-checked with an independent ECDSA (Python cryptography): message
rebuilt from the contract by hand, the DID derived from the key, the
signature low-s and verifying.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Ttimmahlax
Ttimmahlax merged commit cc1e2a0 into main Oct 17, 2026
8 checks passed
@Ttimmahlax Ttimmahlax mentioned this pull request Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants