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 {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]);

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)

Claim a Handshake reserved name: ICANN TLD using HSM for DNSSEC signing (e.g. with CentralNic)

Demonstration with Bob Wallet: https://youtu.be/32Oi65rhdfE?t=886

  1. Install Bob Wallet https://bobwallet.io/
    • Must be at least version 0.9.0, due for release in November 2021
    • Launch Bob Wallet, it may take a few hours and around 20 GB of disk space to complete blockchain sync.
    • Create a new wallet one of two ways:
      • Let Bob generate seed phrase, you MUST write it down and keep that backup safe
@pinheadmz
pinheadmz / bitcoind-regtest-taproot-address.md
Last active April 17, 2024 04:53
Use Bitcoin Core in regtest mode to generate a Taproot address

To start you need a master private key. For me, the easiest way to do this is with bcoin and its default wallet in regtest mode:

$ bwallet-cli mkwallet --mnemonic='zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong' --id=zoo
$ bwallet-cli --id=zoo master
{
  "encrypted": false,
  "key": {
    "xprivkey": "tprv8ZgxMBicQKsPdCttbKDzsuDzypKyWMDfGbzR5YsQe3dnPg6B69PPEaxawUuaanULMtgA8Etd9DaqDVSEBSbScA9xTsdR8PRfPsJZwKS3dJQ"
  },
'use strict';
const fs = require('fs');
const path = require('path');
const readline = require('readline');
(async () => {
const DIR = process.argv[2];
if (!DIR)

1. Plug in Ledger, open Ledger Live and update device firmware to latest

Screen Shot 2021-07-07 at 9 07 44 AM

2. Go to Settings -> Expirimental Features

Screen Shot 2021-07-07 at 9 07 51 AM

3. Enable "Developer mode"

diff --git a/lib/hd/hd.js b/lib/hd/hd.js
index d284171ef..0ca02ec3c 100644
--- a/lib/hd/hd.js
+++ b/lib/hd/hd.js
@@ -58,12 +58,12 @@ HD.fromSeed = function fromSeed(options) {
/**
* Instantiate an hd private key from a mnemonic.
* @param {Mnemonic} mnemonic
- * @param {String?} passphrase
+ * @param {String?} bip39Passphrase
#!/usr/bin/env bash
time=`date +%s`
export HSD_NETWORK=regtest
hsd --prefix=~/.hsd/bip39passphrase-test-$time --daemon
sleep 2
PHRASE="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
PS="secret123"
BIP39PS="menace"