From 17bd9196737c813044dc92c82b42620266154af8 Mon Sep 17 00:00:00 2001 From: tripathyr Date: Wed, 28 Sep 2022 17:40:09 +0530 Subject: [PATCH] Added simplified Bitcoin signature --- lib_btc.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib_btc.js b/lib_btc.js index 95b8874..ef728ab 100644 --- a/lib_btc.js +++ b/lib_btc.js @@ -2652,6 +2652,13 @@ return coinjs.verifySignature(h1, s1, p2); } + + coinjs.generateBitcoinSignature = function (private_key,hash){ + var wif, tx1; + if (private_key.length < 60) { wif = private_key } else { wif = coinjs.privkey2wif(private_key);} + tx1 = coinjs.transaction(); + return tx1.transactionSigNoIndex(wif,1,hash); + } coinjs.dSHA256 = function(data){ var t1,t2,t3 ;