New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tbc-lib-js

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tbc-lib-js - npm Package Compare versions

Comparing version 1.0.22 to 1.0.23

30

lib/taproot.js

@@ -264,5 +264,3 @@ const secp256k1 = require("secp256k1");

if (leftHash.compare(rightHash) > 0) {
const temp = leftHash;
leftHash = rightHash;
rightHash = temp;
[leftHash, rightHash] = [rightHash, leftHash]; // Swap hashes if needed
}

@@ -275,3 +273,4 @@

return [combinedTree, branchHash];
} else {
} else if (Array.isArray(scriptTree) && scriptTree.length === 2) {
// Ensure that the leaf node is also an array with two elements
const [leafVersion, script] = scriptTree;

@@ -284,6 +283,8 @@ const scriptBuffer = Taproot.serScript(script);

return [[[(leafVersion, script), Buffer.alloc(0)]], leafHash];
// Return a tuple of tree and hash
return [[[leafVersion, script], Buffer.alloc(0)], leafHash];
} else {
throw new Error("Invalid scriptTree format");
}
}
/**

@@ -391,6 +392,4 @@ *

*/
static pubkeyToTaprootTweakPubkey(pubkey, scriptTree) {
let h;
if (scriptTree === null) h = "";
else h = Taproot.taprootTreeHelper(scriptTree);
static pubkeyToTaprootTweakPubkey(pubkey) {
let h = "";
return Taproot.taprootTweakPubkey(pubkey, Buffer.from(h, "ascii"));

@@ -405,6 +404,4 @@ }

*/
static seckeyToTaprootTweakSeckey(seckey, scriptTree) {
let h;
if (scriptTree === null) h = "";
else h = Taproot.taprootTreeHelper(scriptTree);
static seckeyToTaprootTweakSeckey(seckey) {
let h = "";
return Taproot.taprootTweakSeckey(seckey, Buffer.from(h, "ascii"));

@@ -426,3 +423,6 @@ }

const t = Taproot.intFromBuffer(
Taproot.taggedHash("TapTweak", Buffer.concat([Taproot.bufferFromInt(p.x), h]))
Taproot.taggedHash(
"TapTweak",
Buffer.concat([Taproot.bufferFromInt(p.x), h])
)
);

@@ -429,0 +429,0 @@ if (t >= N) throw Error("value error !");

{
"name": "tbc-lib-js",
"version": "1.0.22",
"version": "1.0.23",
"description": "A library for tbc functionality",

@@ -5,0 +5,0 @@ "author": "Austin <austinwang149@gmail.com>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc