You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
447 B
18 lines
447 B
// {pubKey} OP_CHECKSIG
|
|
|
|
import { Stack } from '../../payments';
|
|
import * as bscript from '../../script';
|
|
import { OPS } from '../../script';
|
|
|
|
export function check(script: Buffer | Stack): boolean {
|
|
const chunks = bscript.decompile(script) as Stack;
|
|
|
|
return (
|
|
chunks.length === 2 &&
|
|
bscript.isCanonicalPubKey(chunks[0] as Buffer) &&
|
|
chunks[1] === OPS.OP_CHECKSIG
|
|
);
|
|
}
|
|
check.toJSON = (): string => {
|
|
return 'pubKey output';
|
|
};
|
|
|