Skip to content

Instantly share code, notes, and snippets.

Avatar

Xiaohui Liu xhliu

View GitHub Profile
@xhliu
xhliu / scriptEval.js
Last active Dec 2, 2019
Sample code to evaluate bitcoin script using Bitcoin SV Library (bsv) https://docs.moneybutton.com/docs/bsv-overview.html
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")