From 885e634fa4b56539aa6c817fba0819e806e7dcd0 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 31 Mar 2026 02:06:19 -0700 Subject: [PATCH] Fix signing in blocks. --- src/lib/block.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/block.ts b/src/lib/block.ts index 4fa64f7..b919a00 100644 --- a/src/lib/block.ts +++ b/src/lib/block.ts @@ -412,7 +412,9 @@ export class Block { return new Promise(async (resolve, reject) => { try { if (typeof input === 'string' && /^[A-F0-9]{64}$/i.test(input)) { - const signature = nano25519.sign(hex.toBytes(this.hash), hex.toBytes(input)) + const prv = hex.toBytes(input) + const pub = nano25519.derive(prv) + const signature = nano25519.sign(hex.toBytes(this.hash), new Uint8Array([...prv, ...pub])) this.signature = bytes.toHex(signature) } else if (input instanceof Wallet && typeof index === 'number' && (frontier === undefined || frontier instanceof (this.constructor as typeof Block)) -- 2.47.3