This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate zmq; | |
extern crate bitcoin; | |
use bitcoin::consensus::encode::deserialize; | |
use bitcoin::Transaction; | |
fn main() { | |
// Initialize a new ZeroMQ context | |
let context = zmq::Context::new(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/ownership/Ownable.sol | |
import 'openzeppelin-solidity/contracts/ownership/Ownable.sol'; | |
import 'openzeppelin-solidity/contracts/math/SafeMath.sol'; | |
pragma solidity ^0.4.18; | |
contract IntSwap is Ownable{ | |
using SafeMath for uint256; | |
event Deposited(address indexed payee, uint256 amount, uint256 timestamp); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Networks, PublicKey, Transaction } from "bsv"; | |
import { bsv } from "scryptlib"; | |
import { Provider } from "../abstract-provider"; | |
import { Signer, SignTransactionOptions, SignatureRequest, SignatureResponse } from "../abstract-signer"; | |
import { DefaultProvider } from "../providers/default-provider"; | |
import { AddressOption} from "../types"; | |
import { parseAddresses } from "../utils" | |
// see https://doc.sensilet.com/guide/sensilet-api.html | |
interface SensiletWalletAPI { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Signer, SignatureRequest, SignatureResponse, SignTransactionOptions } from "../abstract-signer"; | |
import { Provider, UtxoQueryOptions } from "../abstract-provider"; | |
import { AddressesOption, AddressOption, Network, UTXO } from "../types"; | |
import { bsv } from "scryptlib/dist"; | |
import {parseAddresses} from "../utils"; | |
const DEFAULT_SIGHASH_TYPE = bsv.crypto.Signature.ALL; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require node 10 and Rust to run | |
// https://github.com/ZenGo-X/dlog-verifiable-enc | |
var ve = require('dlog-verifiable-enc').ve; | |
var assert = require('assert'); | |
var { bsv, toHex, buildContractClass, Ripemd160, signTx, PubKey, Sig } = require('scryptlib'); | |
const G = bsv.crypto.Point.getG() | |
const N = bsv.crypto.Point.getN() | |
const BN = bsv.crypto.BN | |
const { inputIndex, inputSatoshis, newTx, loadDesc } = require('./helper'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2020 Xiaohui Liu. | |
// Use of this source code is governed by a MIT-style license. | |
// This is an implementation of https://craigwright.net/blog/bitcoin-blockchain-tech/offline-addressing | |
// For more info, also see Episode 4 of Bitcoin Class with Satoshi: Extended Address https://youtu.be/rezvcJ4j-7U | |
const bsv = require('bsv'); | |
const BN = bsv.crypto.BN | |
const Hash = bsv.crypto.Hash | |
const G = bsv.crypto.Point.getG() | |
const N = bsv.crypto.Point.getN() |
NewerOlder