Skip to content

Instantly share code, notes, and snippets.

View xhliu's full-sized avatar

xhliu xhliu

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