From f71d8f86858398e3f7e50146f15ad14e13aa040f Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 31 Dec 2022 13:30:16 -0500 Subject: [PATCH] *Private key must be full 64 bit private key --- src/lib/seed.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/seed.ts b/src/lib/seed.ts index a78e6d1..6355b8a 100644 --- a/src/lib/seed.ts +++ b/src/lib/seed.ts @@ -3,6 +3,7 @@ import config from "../config"; import * as bip39 from "@scure/bip39"; import { wordlist } from "@scure/bip39/wordlists/english"; import { errorExit } from "./error.js"; +import b4a from "b4a"; const BIP44_PATH = "m/44'/1627'/0'/0'/0'"; @@ -24,5 +25,8 @@ export function getHDKey(): HDKey { export function getKeyPair(): { publicKey: Uint8Array; secretKey: Uint8Array } { const key = getHDKey(); - return { publicKey: key.publicKeyRaw, secretKey: key.privateKey }; + return { + publicKey: key.publicKeyRaw, + secretKey: b4a.concat([key.privateKey, key.publicKeyRaw]), + }; }