diff options
| author | Adam Soltys <[email protected]> | 2026-08-15 14:32:28 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-15 14:32:28 -0700 |
| commit | 643046319fa9a393374fc2348381d9505fe143eb (patch) | |
| tree | 1f76cb3ace4ce821cca010def27e3b5ec7062fc9 /src/nostr.js | |
| parent | 16ee8bff43e8733848ef1b944b9d9312ce4ec223 (diff) | |
| download | coinosv3-643046319fa9a393374fc2348381d9505fe143eb.tar.gz coinosv3-643046319fa9a393374fc2348381d9505fe143eb.zip | |
Wallets go flat: every Spending and Savings is a top-level wallet in the switcher, named for its purpose, renamable apart — and a new wallet can carry its own seed or live at the next BIP84 account of one you already back up
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014tE4U5nEjGTQy8PwYqamfv
Diffstat (limited to 'src/nostr.js')
| -rw-r--r-- | src/nostr.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nostr.js b/src/nostr.js index 8615f7d..2166880 100644 --- a/src/nostr.js +++ b/src/nostr.js @@ -252,8 +252,10 @@ export class NostrSync { setDtag(d) { this.dtag = d || DTAG; } - load(mnemonic, passphrase = '') { - this.sk = nip06.privateKeyFromSeedWords(mnemonic, passphrase || undefined); + load(mnemonic, passphrase = '', accountIndex = 0) { + // a derived sibling wallet (same seed, higher BIP84 account) gets its own + // nostr identity and sync slots — nip06 shifts by account index + this.sk = nip06.privateKeyFromSeedWords(mnemonic, passphrase || undefined, accountIndex || 0); this.pk = getPublicKey(this.sk); this.ck = nip44.getConversationKey(this.sk, this.pk); } |
