@dip1059/bitcoinjs-lib
Version:
bitcoinjs-lib with some other btc based network support. Cloned from https://github.com/junderw/bitcoinjs-lib/tree/cashv5
20 lines (19 loc) • 554 B
JavaScript
;
// {signature} {pubKey}
Object.defineProperty(exports, '__esModule', { value: true });
const bscript = require('../../script');
function isCompressedCanonicalPubKey(pubKey) {
return bscript.isCanonicalPubKey(pubKey) && pubKey.length === 33;
}
function check(script) {
const chunks = bscript.decompile(script);
return (
chunks.length === 2 &&
bscript.isCanonicalScriptSignature(chunks[0]) &&
isCompressedCanonicalPubKey(chunks[1])
);
}
exports.check = check;
check.toJSON = () => {
return 'witnessPubKeyHash input';
};