Phase 1.5 — Mycelium-address proof-of-control login (hero_login_lib + onboarding wiring) #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent: #1 (Phase 1.5 block)
Session: s2-003 (Track B, hero_work workspace)
Decision: https://forge.ourworld.tf/lhumina_code/hero_onboarding/blob/development/decisions/D-12-mycelium-proof-of-control-mechanism.md (workspace-internal; not in this repo — lives at
hero_work/decisions/D-12-*.md)Scope
Replace the s2-002 mycelium-address login stub (accepts any string) with real proof-of-control. The user proves they hold the priv_key behind a claimed mycelium address by completing a server-issued challenge.
Ships as:
lhumina_code/hero_login—hero_login_libcrate (issue_challenge+verify_response) + optionalhero_login_clifor headless smoke testing. Canonical Hero workspace shape.hero_onboarding_serverwired tohero_login_lib: new routesPOST /login/challenge(formaddress) andPOST /login/verify(formchallenge_token,nonce). Legacy/loginstub removed.Cargo.tomlinhero_onboarding/.Mechanism
D-12 locks: message round-trip via mycelium daemon.
Three options were evaluated; the original
prompt2.md§3 leaned signed-challenge but Phase B surfaced that mycelium uses x25519 (Diffie-Hellman), not ed25519 — there is no native signing primitive and no/api/v1/admin/signendpoint. Full enumeration in the workspace-internalmemory/investigation_mycelium_auth_api.md.mycelium message receiveFlow
/login/challengeaddress=<user-addr>(address, nonce, expires_at)localhost:8989/api/v1/messageswithdst={ip: address}+ topichero/login/v1+ payloadnonce-hexcurl localhost:8989/api/v1/messages?topic=...&timeout=10)/login/verifychallenge_token=<token>&nonce=<hex>/dashboard+ session cookie, OR 401Server-side stateless — no database row per pending challenge. HMAC-signed tokens carry their own state; reaped naturally on expiry.
Acceptance bar
cargo build --releaseclean on bothlhumina_code/hero_login/andlhumina_code/hero_onboarding//login/challenge→/login/verifyreturns 401/login/verifyreturns 401 ("HMAC mismatch")subtle::ConstantTimeEq(code-review gate)Out of scope (future sub-issues)
mycelium message receivefor the user (today they paste manually)mycelium_sdkUDS-JSON-RPC variant ofhero_login_lib(REST-only for now since the workstation runs the legacy daemon)Tracking
Closes the Phase 1.5 block in #1