diff options
| author | Adam Soltys <[email protected]> | 2026-02-27 14:46:27 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-27 14:46:27 -0800 |
| commit | 8ffcf769052461e03a2c69220392cb37a623f3f4 (patch) | |
| tree | 5b0b16269a729fbe9db44c65b3a0da3d95c11b78 /src/lib/walletEntropy.ts | |
| parent | 6ba952f16fc60fc56f0834e5b1d08671885618c5 (diff) | |
| download | coinos-ui-8ffcf769052461e03a2c69220392cb37a623f3f4.tar.gz coinos-ui-8ffcf769052461e03a2c69220392cb37a623f3f4.zip | |
2 step register
Diffstat (limited to 'src/lib/walletEntropy.ts')
| -rw-r--r-- | src/lib/walletEntropy.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/walletEntropy.ts b/src/lib/walletEntropy.ts index 25bd49b8..95b3e903 100644 --- a/src/lib/walletEntropy.ts +++ b/src/lib/walletEntropy.ts @@ -1,5 +1,5 @@ import { browser } from "$app/environment"; -import { getCachedPrfKey, rememberPrfKey, defaultRememberForMs } from "$lib/passwordCache"; +import { getCachedPrfKey } from "$lib/passwordCache"; const DERIVATION_EVENT = { kind: 1, @@ -27,9 +27,7 @@ export async function tryDeriveFromNsec(): Promise<ArrayBuffer | null> { const { nip19, finalizeEvent } = await import("nostr-tools"); const sk = nip19.decode(nsec).data as Uint8Array; const signed = finalizeEvent({ ...DERIVATION_EVENT } as any, sk); - const entropy = await hashSignature(signed.sig); - rememberPrfKey(entropy, defaultRememberForMs); - return entropy; + return await hashSignature(signed.sig); } catch (e) { console.log("nsec entropy derivation failed", e); return null; @@ -60,7 +58,5 @@ export async function deriveNostrEntropy(): Promise<ArrayBuffer> { const { sign } = await import("$lib/nostr"); const signed = await sign({ ...DERIVATION_EVENT }); - const entropy = await hashSignature(signed.sig); - rememberPrfKey(entropy, defaultRememberForMs); - return entropy; + return hashSignature(signed.sig); } |
