Skip to content

Instantly share code, notes, and snippets.

View xhliu's full-sized avatar

xhliu xhliu

View GitHub Profile
@xhliu
xhliu / unknownPrivkeySig.ts
Last active February 13, 2024 18:56 — forked from msinkec/unknownPrivkeySig.ts
Create Sig and PubKey with unknown PrivKey
import { bsv } from 'scrypt-ts'
async function main() {
const msg = 'I am Satoshi'
const hBuff = bsv.crypto.Hash.sha256(Buffer.from(msg))
const h = bsv.crypto.BN.fromBuffer(hBuff)
const G = bsv.crypto.Point.getG()
const n = bsv.crypto.Point.getN()
@xhliu
xhliu / OP_MOD_U30_U15_x2.asm
Created February 10, 2024 00:21 — forked from cf/OP_MOD_U30_U15_x2.asm
OP_MOD for Bitcoin Mainnet
/*
compute x % y given: q_lo = floor(x/y)&0x7fff, q_hi = floor(x/y)>>15, x_lo = x&0x7fff, x_hi = x>>15, y_lo = y&0x7ff, y_hi = y>>15
<q_hi>
<q_lo>
<x_hi>
<x_lo>
@xhliu
xhliu / bchtokenprotocols
Created May 8, 2023 20:49 — forked from HostFat/bchtokenprotocols
Bitcoin Cash Token Protocols
They are NOT in order of importance and/or quality, so you should give a look to all of them.
(continuously updated)
It is likely that there will be 10 different token protocols this year (2018)
"Currently", even those now reported here, they are still in full development.
Wormhole (based on Omni)
- Website: http://wormhole.cash - you can change the language on upper right
- Spec: http://wormhole.cash/whcwhitepaper.pdf (in Chinese language)
- Spec ENG part 1: https://www.yours.org/content/bch-smart-contract-is-coming----wormhole-protocol-proposed-by-bitmain-1debc785b3f8
import React from 'react';
import { sendMessageAndWaitForResponse } from '../utils/globals';
import { connect } from '../store/portSlice';
import store, { RootState } from '../store/store';
import { TAALSigner } from '../signers/TAALSigner';
import {
bsv,
DefaultProvider,
DefaultProviderOption,
} from 'scrypt-ts'