Add Satoshi Genesis sample wallet to self-hosted onboarding#234
Add Satoshi Genesis sample wallet to self-hosted onboarding#234schjonhaug merged 4 commits intomasterfrom
Conversation
Add a second sample wallet option alongside Bacon in the self-hosted
onboarding flow. On mainnet/testnet, it uses Satoshi's real genesis
block coinbase public key. On regtest, it uses a deterministic funded
address for a useful onboarding experience.
Refactor the sample wallet system from single-wallet to multi-wallet:
- Replace SAMPLE_WALLET_SLUG + network-keyed record with SampleWallet[]
array supporting per-network descriptor overrides
- Sample wallet buttons now fill the form inline instead of navigating
to separate routes
- Prompt stays visible until user adds a non-sample wallet, with
already-added sample wallets filtered from the buttons
- Generalize bacon-specific naming throughout (isBaconWallet →
isSampleWallet, baconPrefilled → samplePrefilled with {name} param)
- Update all 9 locale files with new translation keys
- Add deterministic satoshi-genesis wallet to dev.sh (funded 0.5 BTC)
🤖 Codex Code Review
No additional performance or security issues stood out in the modified diff. |
🤖 Claude Code ReviewPull Request Review: Satoshi Genesis Sample Wallet & Onboarding RefactorCommit Summary
Overall AssessmentThis is a well-structured set of commits. The refactor cleanly generalises the single-wallet Bacon pattern into an extensible multi-wallet system, dead code is removed promptly as a follow-up, and the No critical issues were found — no security vulnerabilities, no breaking API contract changes, no data integrity risks. Issues & ImprovementsMedium — Bitcoin Correctness: Bare pubkey used as descriptor on mainnetFile: const GENESIS_PUBKEY = "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb..."
{
descriptor: GENESIS_PUBKEY, // bare hex pubkey, not a BDK descriptor
networkOverrides: {
regtest: { descriptor: "bcrt1q20lu6ldqtssq7y7ewarlamlzldnmyk5w4n3e97" },
},
}The bare uncompressed pubkey hex is not a valid BDK output descriptor. On mainnet, the backend will receive this raw hex as the Recommendation: Verify with a live mainnet test, and add a code comment explaining what the backend does with this raw pubkey and whether it produces a usable result. Low — Logic:
|
| Scenario | Status |
|---|---|
| Both sample buttons shown for zero wallets | ✅ |
| Neither shown when a non-sample wallet exists | ✅ |
| One button shown when the other sample is already added | ✅ |
| Prompt hidden when all samples added | ✅ |
| Neither shown in cloud mode | ✅ |
| Bacon fills form inline | ✅ |
| Satoshi fills form inline | ✅ |
One gap: No test verifies that the amber-banner text changes from trySampleWallet to samplePrefilled after a sample wallet button is clicked. Minor, since both are derived from the same selectedSample object.
i18n Completeness
All 9 locale files (da, de-DE, en-US, es-419, fr-FR, ja, nb, pt-BR, sv) are fully updated with the new keys. The guidesPrompt key was initially missing in non-English locales and correctly fixed in 9f167c0.
Dead Code Removal Quality
Clean. All three removed items — handleSelectSampleWallet, handleSkipToForm, and the SAMPLE_WALLETS import in useWalletWizard — are fully absent from the codebase with no remaining references.
Summary
| Category | Finding | Severity |
|---|---|---|
| Bitcoin correctness | Bare pubkey hex used as descriptor on mainnet; may fail frontend validation | Medium |
| Logic | hasOnlySampleWallets relies on vacuous truth; variable name misleading |
Low |
| Robustness | Name-based sample wallet deduplication can be fooled by user-named wallets | Low |
| State management | selectedSampleSlug not reset if wallet list changes while mounted |
Low |
| Test coverage | No test for amber-banner text change after sample button click | Very Low |
| i18n | All 9 locales fully covered | ✅ Clean |
| Dead code | All removed items fully absent | ✅ Clean |
| Security | No issues | ✅ Clean |
…import Sample wallet selection is now inline (no navigation), so the handleSelectSampleWallet handler and its wiring are no longer needed.
Address review feedback: remove handleSkipToForm dead code from the wizard hook, and add a test verifying the sample prompt hides when both sample wallets have already been added.
Summary
Test plan
cd frontend && pnpm build— no type/build errorscd frontend && pnpm test— all 146 tests passcd backend && cargo build && cargo test -- --test-threads=1— backend compiles and passesdev.sh reset && dev.sh init— verify "satoshi-genesis" wallet is created and funded with 0.5 BTC/wallets/addwith no wallets → both "Use Bacon Wallet" and "Use Satoshi Genesis Address" buttons visible