Skip to content

Instantly share code, notes, and snippets.

View pinheadmz's full-sized avatar
🕺

Matthew Zipkin pinheadmz

🕺
  • port 8333
View GitHub Profile
'use strict';
const assert = require('assert');
const path = require('path');
const fs = require('fs');
const os = require('os');
const {Chain, Pool} = require('hsd');
const NetAddress = require('hsd/lib/net/netaddress');
const Logger =require('hsd/node_modules/blgr');
const IP =require('hsd/node_modules/binet');
'use strict';
const {NodeClient, WalletClient} = require('hs-client');
const {Network} = require('hsd');
const network = Network.get('regtest');
const nodeOptions = {
network: network.type,
port: network.rpcPort
};

Claiming Handshake Faucet Coins with Multisig

For a deep dive into the mechanics of the faucet, airdrop and claims, read this article.


Preface

// USAGE: hsd --log-console=false --plugins=/path/to/this/file/addr-bal.js
'use strict';
const {CoinEntry} = require('hsd');
const layout = require('hsd/lib/blockchain/layout');
const plugin = exports;
class Plugin {
constructor(node) {
// USAGE: hsd --log-console=false --plugins=/path/to/this/file/expiring-plug.js
'use strict';
const {
Namestate,
Network
} = require('hsd');
const plugin = exports;
'use strict';
const {NodeClient} = require('hs-client');
const {Network} = require('hsd');
const network = Network.get('main');
const clientOptions = {
network: network.type,
port: network.rpcPort
}

Abstract

Introduce new covenant types and backwards-compatible rules for miners in order to collectively generate a deterministic yet unpredictable random value over a period of time. This scheme relies on the assumption that miners are diverse (decentralized) and are competitive against each other, not collaborating with each other.

TODO

'use strict';
const assert = require('assert');
const {SPVNode, Namestate, Rules, resource} = require('hsd');
const argv = process.argv;
assert(argv.length === 3, 'Usage:\n $ node zooko-spv.js <name>');
assert(Rules.verifyName(argv[2], 'Invalid name.'));
const nameHash = Rules.hashName(argv[2]);
'use strict';
const fs = require('fs');
const os = require('os');
const Path = require('path');
const hdns = require('hdns');
const {encoding} = require('hdns/node_modules/bcrypto');
const {pem} = encoding;
const host = process.argv[2];

bcoin v2.2.0 has been released!

Featuring bech32m support for sending to Taproot addresses.

https://github.com/bcoin-org/bcoin/releases/tag/v2.2.0

Be sure to read and understand the upgrade details in CHANGELOG

IF YOU USE THE ADDRESS INDEXER you will need to delete and rebuild that database, which could take 24-48 hours depending on your machine:

  • Stop bcoin (bcoin-cli rpc stop or ctrl-C)