Skip to content

Instantly share code, notes, and snippets.


Xiaohui Liu xhliu

View GitHub Profile
xhliu / scriptEval.js
Last active Dec 2, 2019
Sample code to evaluate bitcoin script using Bitcoin SV Library (bsv)
View scriptEval.js
let bsv = require('bsv')
const slockStr = "OP_2 OP_EQUAL"
const slock = bsv.Script.fromASM(slockStr)
console.log("\nLocking script loaded\n")
const sunlockStr = "OP_2"
const sunlock = bsv.Script.fromASM(sunlockStr)
console.log("\nUnlocking script loaded\n")