Skip to content

recording: recover console-derived run accounts - #150

Merged
AquiGorka merged 1 commit into
mainfrom
recording/derived-account-recovery
Jul 31, 2026
Merged

recording: recover console-derived run accounts#150
AquiGorka merged 1 commit into
mainfrom
recording/derived-account-recovery

Conversation

@AquiGorka

Copy link
Copy Markdown
Contributor

After the Tranche 3 mainnet run, 48.92 XLM was sitting in accounts that had been written off. The two council OpEx treasuries were missed by the sweep entirely, and Provider Orion's OpEx was recorded as needing a platform-side key it does not actually need.

Neither console stores its operational keys. Both derive them from a single wallet signature:

masterSeed = SHA-256( sign( SHA-256("Stellar Signed Message:\n" + "Moonlight: Derive server key") ) )
key        = Ed25519FromRawSeed( SHA-256( masterSeed || purpose || index ) )

purpose opex for the council console signed by the run admin, pp for the provider console signed by the operator. Both of those wallets already derive from MASTER_SECRET plus the run id, so a run's OpEx balances are recoverable from the run id alone. Nothing in the run output records the derived addresses, which is why they looked stranded.

MASTER_SECRET=S... RUN_ID=... DEST=G... MODE=payment|merge \
  deno run --allow-env --allow-net recording/recover-derived-accounts.ts

Every value is required and there are no defaults. payment sends the spendable balance and leaves the account open; merge closes it and recovers the minimum balance too. Nothing is signed until a derived address is confirmed to exist on-chain, and each address and amount is printed before submission.

Verified against the Tranche 3 run: it re-derives the exact two addresses recovered by hand today, and now reports them as closed.

The council and provider consoles derive their OpEx keys from a wallet
signature rather than storing them, and a run's output never records the
resulting addresses, so those balances look unreachable once the run ends.
Re-deriving them from the run id makes the funds recoverable.
@AquiGorka
AquiGorka requested a review from fazzatti July 31, 2026 20:35
@AquiGorka
AquiGorka merged commit a3e353e into main Jul 31, 2026
10 checks passed
@AquiGorka
AquiGorka deleted the recording/derived-account-recovery branch July 31, 2026 20:37
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.

1 participant