bitcoinjs-lib/src/templates/pubkey/output.ts

17 lines
375 B
TypeScript
Raw Normal View History

// {pubKey} OP_CHECKSIG
2018-06-25 16:25:12 +10:00
const bscript = require('../../script')
const OPS = require('bitcoin-ops')
function check (script) {
const chunks = bscript.decompile(script)
return chunks.length === 2 &&
bscript.isCanonicalPubKey(chunks[0]) &&
chunks[1] === OPS.OP_CHECKSIG
}
check.toJSON = function () { return 'pubKey output' }
2018-07-03 23:00:00 +10:00
module.exports = { check }
export {}