From 57496da5cc4c0aa4c0fd941d45d32ae4ed798d36 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 4 Jul 2023 20:59:01 -0400 Subject: [PATCH] fix: keypair needs to be a private extended key --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 978991d..4193a1d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,6 +16,7 @@ import { EventEmitter2 as EventEmitter } from "eventemitter2"; // @ts-ignore import Protomux from "protomux"; import defer, { DeferredPromise } from "p-defer"; +import { concatBytes } from "@lumeweb/libkernel"; const MAX_PEER_LISTENERS = 20; @@ -105,7 +106,7 @@ async function createSwarm(): Promise { const swarmInstance = new Hyperswarm({ keyPair: { publicKey: ed25519.getPublicKey(privateKey), - secretKey: privateKey, + secretKey: concatBytes(privateKey, ed25519.getPublicKey(privateKey)), }, }); const id = getSwarmId();