SPA registration creates hero_ledger account (account.activate) #53

Closed
opened 2026-03-28 06:35:20 +00:00 by mik-tf · 1 comment
Member

Goal

When a user registers on the marketplace SPA, automatically create a hero_ledger account using their ed25519 public key. Same key, one identity across marketplace + blockchain.

Flow

  1. User fills register form (name, email, password)
  2. SPA generates ed25519 keypair (already does this — vault)
  3. SPA registers public key with marketplace backend (already does this)
  4. NEW: Backend calls account.activate on hero_ledger gateway with:
    • public_key: user's ed25519 public key hex
    • domain: derived from username (e.g. username.mycelium)
    • email: user's email
  5. User confirms email → hero_ledger account activated
  6. User's vault key = their on-chain identity

Tasks

  • S1 Add account.activate call to backend registration flow (auth controller)
  • S2 Domain name derivation: sanitize username → username.mycelium
  • S3 Handle email confirmation: account is pending until confirmed
  • S4 Store hero_ledger account ID in OSIS user record
  • S5 Test: register on SPA → hero_ledger account created on devnet

Notes

  • This only applies when APP_WALLET_BACKEND=ledger is set
  • In local mode, registration stays as-is (no hero_ledger call)
  • No SPORE tokens needed for this — just account creation
  • Email confirmation flow may need UX consideration (two emails?)

— mik-tf

## Goal When a user registers on the marketplace SPA, automatically create a hero_ledger account using their ed25519 public key. Same key, one identity across marketplace + blockchain. ## Flow 1. User fills register form (name, email, password) 2. SPA generates ed25519 keypair (already does this — vault) 3. SPA registers public key with marketplace backend (already does this) 4. **NEW**: Backend calls `account.activate` on hero_ledger gateway with: - `public_key`: user's ed25519 public key hex - `domain`: derived from username (e.g. `username.mycelium`) - `email`: user's email 5. User confirms email → hero_ledger account activated 6. User's vault key = their on-chain identity ## Tasks - [ ] **S1** Add `account.activate` call to backend registration flow (auth controller) - [ ] **S2** Domain name derivation: sanitize username → `username.mycelium` - [ ] **S3** Handle email confirmation: account is pending until confirmed - [ ] **S4** Store hero_ledger account ID in OSIS user record - [ ] **S5** Test: register on SPA → hero_ledger account created on devnet ## Notes - This only applies when `APP_WALLET_BACKEND=ledger` is set - In local mode, registration stays as-is (no hero_ledger call) - No SPORE tokens needed for this — just account creation - Email confirmation flow may need UX consideration (two emails?) — mik-tf
Author
Member

Done — deployed and tested

  • activate_ledger_account() added to WalletManager trait (default no-op)
  • LedgerWalletManager calls account.activate on hero_ledger gateway
  • Auth controller calls it after successful pubkey registration (best-effort)
  • Domain: sanitized username + .mycelium
  • All 65 integration tests pass in local mode
  • In ledger mode, 5 wallet tests fail as expected (0 SPORE balance, not 100 MC)

Dev VM runs local mode by default. Ledger mode can be enabled for integration testing.

— mik-tf

## Done — deployed and tested - `activate_ledger_account()` added to WalletManager trait (default no-op) - LedgerWalletManager calls `account.activate` on hero_ledger gateway - Auth controller calls it after successful pubkey registration (best-effort) - Domain: sanitized username + `.mycelium` - All 65 integration tests pass in local mode - In ledger mode, 5 wallet tests fail as expected (0 SPORE balance, not 100 MC) Dev VM runs local mode by default. Ledger mode can be enabled for integration testing. — mik-tf
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coopcloud_code/home#53
No description provided.