Skip to content

fix(wallet): say so when Franklin stopped using the wallet holding your USDC - #167

Merged
VickyXAI merged 1 commit into
mainfrom
fix/119-solana-wallet-divergence
Sep 5, 2026
Merged

fix(wallet): say so when Franklin stopped using the wallet holding your USDC#167
VickyXAI merged 1 commit into
mainfrom
fix/119-solana-wallet-divergence

Conversation

@VickyXAI

@VickyXAI VickyXAI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Closes #119.

3.35.6 tightened SDK wallet selection and stopped selecting the legacy ~/.blockrun/solana-wallet.json. That was a deliberate security fix and it stays. What it left behind is a silent address change.

The SDK prints a migration notice — but only when it creates a wallet. The install that hurts already has a .solana-session, so nothing is created, nothing is printed, and the user spends from a different address than the one holding their USDC. Money looks missing with no message anywhere explaining why.

What this adds

  • Detection (src/wallet/solana-migration.ts) — read-only and side-effect free.
  • franklin doctor reports the divergence with both public addresses.
  • franklin wallet-adopt <address> switches, and only when named.

Two things it deliberately does not do

It does not call getOrCreateSolanaWallet(). That creates a wallet as a side effect — the exact wrong move inside a diagnostic trying to tell you which wallet you already have. The active address is derived from the session key directly.

It does not adopt anything on its own. The complaint behind #119 is that the active wallet changed without anyone asking; the remedy must not do the same in the other direction. importSolanaWallet backs up the current session before replacing it.

Trust

Addresses are derived from keys, never read from a file's address field. A legacy file naming someone else's address while holding the active key is not a divergence — there is a test for that. No secret key is printed or logged on any path, asserted in the tests.

Also: sensitive-paths.ts described the legacy file as { address, private_key }. It is camelCase — the shape context.ts and the SDK scanner both read. A wrong comment next to key handling is how the next parser gets written wrong.

CHANGELOG 3.46.0 also picks up #140, which merged after that entry was written.

754 local tests pass. The new suite runs against a temp HOME and asserts it is not the real one before writing anything.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rm7cRGtC7wCofhYuHRo21h

…ur USDC

Closes #119.

3.35.6 tightened SDK wallet selection — SOLANA_WALLET_KEY, then
~/.blockrun/.solana-session, then create — and stopped selecting the legacy
~/.blockrun/solana-wallet.json. That was a deliberate security fix and it
stays. What it left behind is a silent address change.

The SDK does print a migration notice, but only when it CREATES a wallet. The
install that actually hurts already has a .solana-session, so nothing is
created, nothing is printed, and the user is simply spending from a different
address than the one holding their USDC. Money looks missing and there is no
message anywhere explaining why.

Detection is read-only and side-effect free. It derives the active address from
the session key rather than calling getOrCreateSolanaWallet(), which would
create the very wallet a diagnostic is trying to report on, and it compares
against addresses the SDK derives from each discovered key rather than the
`address` field a file claims. A file naming someone else's address while
holding the active key is not a divergence, and there is a test for that.

`franklin doctor` reports it. `franklin wallet-adopt <address>` switches, and
only when named: the complaint is that the active wallet changed without anyone
asking, so the remedy must not do the same in the other direction.
importSolanaWallet backs up the current session before replacing it. No secret
key is printed or logged on any path.

sensitive-paths.ts described the legacy file as { address, private_key }. It is
camelCase — the shape context.ts and the SDK scanner both read. A wrong comment
next to key handling is how the next parser gets written wrong.

CHANGELOG 3.46.0 also picks up #140, which merged after that entry was written.

754 local tests pass; the new suite runs against a temp HOME and asserts it is
not the real one before writing anything.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rm7cRGtC7wCofhYuHRo21h
@VickyXAI
VickyXAI merged commit 2172cc4 into main Sep 5, 2026
5 checks passed
@VickyXAI
VickyXAI deleted the fix/119-solana-wallet-divergence branch September 5, 2026 22:46
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.

fix(wallet): migrate legacy Solana wallet without silently changing the active address

1 participant