Skip to content

Instantly share code, notes, and snippets.

@osoftware
osoftware / covenant.ts
Last active August 31, 2019 12:02
Bitcoin Cash Covenant with Spedn
import { BITBOX } from "bitbox-sdk";
import { SigHash, Spedn, TxBuilder } from "spedn";
async function main() {
// BITBOX boilerplace
const bitbox = new BITBOX();
const mnemonic = "draw parade crater busy book swim soldier tragic exit feel top civil";
const wallet = bitbox.HDNode.fromSeed(bitbox.Mnemonic.toSeed(mnemonic));
const alice = bitbox.HDNode.derivePath(wallet, "m/44'/145'/0'/0/0");
@osoftware
osoftware / Main.hs
Last active June 9, 2019 20:34
Using a Haskell program compiled with GHCJS as a library in a nodejs app.
-- Just a sample Haskell program with some functions.
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.JSString
main :: IO JSString
main = return "elo"