Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitcore-lib

Package Overview
Dependencies
Maintainers
3
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcore-lib - npm Package Compare versions

Comparing version 10.2.1 to 10.3.0

test/transaction/input/taproot.js

2

lib/crypto/schnorr.js

@@ -110,3 +110,3 @@ const crypto = require('crypto');

if (signature.length !== 64) {
throw new Error('Signature should be a 64 byte buffer');
throw new Error('Signature should be a 64 byte buffer. Got ' + signature.length + ' bytes');
}

@@ -113,0 +113,0 @@

@@ -949,3 +949,7 @@ 'use strict';

if (typeof to === 'string') {
to = PublicKey.fromTaproot(to);
try {
to = PublicKey.fromTaproot(to);
} catch {
to = Address.fromString(to);
}
}

@@ -952,0 +956,0 @@

@@ -43,3 +43,3 @@ const inherits = require('inherits');

}
return [new TransactionSignature({
const txSig = new TransactionSignature({
publicKey: privateKey.publicKey,

@@ -51,3 +51,4 @@ prevTxId: this.prevTxId,

sigtype: sigtype
})];
});
return this.isValidSignature(transaction, txSig) ? [txSig] : [];
};

@@ -79,3 +80,3 @@

TaprootInput.prototype.isFullySigned = function() {
return this.output.script.isTaproot() || this.hasWitnesses();
return this.output.script.isTaproot() && this.hasWitnesses();
};

@@ -109,2 +110,15 @@

// TODO verify that this is the correct MAX size.
TaprootInput.SCRIPT_MAX_SIZE = 66; // numwitnesses (1) + sigsize (1 + 64)
TaprootInput.prototype._estimateSize = function() {
let result = this._getBaseSize();
result += 1; // script size
const WITNESS_DISCOUNT = 4;
const witnessSize = TaprootInput.SCRIPT_MAX_SIZE / WITNESS_DISCOUNT;
result += witnessSize;
return result;
};
module.exports = TaprootInput;
{
"name": "bitcore-lib",
"version": "10.2.1",
"version": "10.3.0",
"description": "A pure and powerful JavaScript Bitcoin library.",

@@ -54,3 +54,3 @@ "author": "BitPay <dev@bitpay.com>",

"license": "MIT",
"gitHead": "3e2d392a3dd5f0ddbed30514eb8dfbaf8da690ae"
"gitHead": "eafcf339de16d7b29642597c65670388825c306c"
}
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