/miniscript-js

Native Node.js bindings to Miniscript.

Primary LanguageRustMIT LicenseMIT

Miniscript JS

Install

$ npm install --save miniscript-js

Usage

const miniscript = require('miniscript-js');

const ms = miniscript.parsePolicy('or(pk(A),pk(B))', 'STRING');
console.log(ms.semantic.minimumNKeys());
// => 2

console.log(ms.script.encode());
// => OP_PUSHBYTES_33 022222222222222222222222222222222222222222222222222222222222222222 OP_CHECKSIGVERIFY OP_PUSHBYTES_33 022222222222222222222222222222222222222222222222222222222222222222 OP_CHECKSIG

License

MIT