Skip to content

Instantly share code, notes, and snippets.

View tynes's full-sized avatar
👽
take me to your leader

Mark Tyneway tynes

👽
take me to your leader
View GitHub Profile
@tynes
tynes / name-claim.md
Last active March 28, 2023 16:54
Domain Name Claiming for Handshake

Handshake Domain Name Claims

The Handshake Network has reserved the Alexa Top 100k domains on chain to make sure that important brands are able to own their name in the system. These names can be claimed using a DNSSEC proof of ownership. This means that the owner of the domain name must place a TXT record at their domain name that includes a controlled address.

For technical instructions, see:

@tynes
tynes / hsd-ens.md
Created February 25, 2020 19:26
hsd ENS Support

Handshake can be used to resolve names with a sliding scale of trust assumptions. In general, the more trust that the user places in the system, the better user experience. The easiest way to resolve Handshake names involves configuring DNS settings and not worrying at all about blockchain state. This means that the user is trusting the DNS service provider to properly validate all state transitions and relying on traditional means of DNS security. Running a light client as a DNS server removes the trust assumption that the name state is coming from the heaviest chain. The light client will sync the headers (technically a subset of the header, designed specifically to be lightweight), verify the proof of work is correct and ask for urkel proofs over the p2p network to validate against the tree root contained in the block header. The p2p connections are optionally encrypted with brontide (BOLT #8)

Handshake Airdrop

The airdrop is based on the paper An airdrop that preserves recipient privacy.

To claim the airdrop, you needed to have at least 15 followers on Github as of ~2 years ago and an ssh or gpg key linked to your Github account. You will need to download hsd to create an address and have access to the key linked to your Github account.

It is an easy process with 3 terminals. If you prefer to use a GUI, see Bob.

@tynes
tynes / swap-script.txt
Last active April 16, 2020 06:33
more simple swap script
New Script
Opcode.fromSymbol('type'),
Opcode.fromInt(rules.types.TRANSFER),
Opcode.fromSymbol('equal'),
Opcode.fromSymbol('if'),
Opcode.fromSymbol('dup'),
Opcode.fromSymbol('blake160'),
Opcode.fromPush(pubkeyhash),

hsd Watch Only Wallet Simplification

Overview

The hsd wallet has an edge case regarding watch only wallet usage that results in the incorrect path being returned to the client. This will result in invalid signature creation because the wrong key will be derived and used to sign the transaction. Using an extra API call, it is possible to work around this problem right now, but it is not ideal and is fixable.

#!/bin/bash
# pull gmax's lattest banlist, replace ./bitcoin-cli
# with bcoin-cli and write it to disk as a bash script
# WARNING: please inspect the file before executing it
# works correctly as of 4/10/19
curl -s https://people.xiph.org/~greg/banlist.cli.txt \
| sed 's/\.\/bitcoin-cli/bcoin-cli\ rpc/g' \
| sed '1s/^/#!\/bin\/bash\n\n/' > banlist.sh
@tynes
tynes / write.js
Last active March 22, 2019 01:38
#!/usr/bin/env node
/*
* write.js
*
* usage: writes a string to a file
*
* $ ./write.js <path to file> <contents of file>
*/
# set an env var to the path to a config
export REGTEST_CONFIG=$HOME/.config/hsd/regtest.conf
# this assumes you have git cloned and npm installed handshake
# be sure to start your handshake node with the same config
# ./bin/hsd --config=$REGTEST_CONFIG
# the cli tools live in node_modules/.bin
# also depends on jq
@tynes
tynes / dexec.sh
Created May 17, 2018 22:15
docker exec bash alias
# usage:
# dexec <cmd>
# uses fzf to select running container then runs
# $ docker run [selected] <cmd>
# with /bin/bash as the default cmd
# TODO: add some pretty printing
function dexec() {
local selected_image
@tynes
tynes / keybase.md
Created February 11, 2018 20:17
Keybase Proof

Keybase proof

I hereby claim:

  • I am tynes on github.
  • I am tynes (https://keybase.io/tynes) on keybase.
  • I have a public key ASAVvc3HHzL9Bo-ONgHr5kPLb36EBcQWsmsgLL1y0jMPaAo

To claim this, I am signing this object: