Skip to content

Instantly share code, notes, and snippets.

@davecgh
davecgh / waddrmgr_overview.svg
Created September 2, 2014 00:13
Overview of how keys are used in the btcwallet address manager
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davecgh
davecgh / btcd_code_reorg.md
Last active August 29, 2015 14:11
Btcd Code Reorg

What?

All of the Conformal Bitcoin-related code will be moving to a new home at the https://github.com/btcsuite organization.

When?

This will take place sometime during the next several weeks.

Why?

@davecgh
davecgh / build_btcd.sh
Created October 20, 2015 18:13
Shell script to build btcd with the git commit in the description.
#!/bin/sh
cd $GOPATH/src/github.com/btcsuite/btcd
go build -ldflags "-X main.appBuild=$(git describe)"
@davecgh
davecgh / hexseedtowords.go
Created February 10, 2016 21:46
Simple utility to convert DCR seed hex to seed words.
package main
import (
"encoding/hex"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/decred/dcrwallet/pgpwordlist"
@davecgh
davecgh / blocknotifybridge.go
Created February 20, 2016 06:19
Naive bridge to listen for blockconnected notifications and invoke an executable.
// Copyright (c) 2016 The btcsuite developers
// Copyright (c) 2015-2016 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package main
import (
"io/ioutil"
"log"
@davecgh
davecgh / mainnet_v4votebits.md
Last active May 5, 2017 09:36
Decred votebit combinations for mainnet v4 agendas.

The following table shows all of the valid combinations of votebits for the version 4 agendas on mainnet.

Vote Version 4

--votebits explorer OP_RETURN lnsupport sdiffalgo Previous Block Valid?
0 (0x00) OP_RETURN 000004000000 ABSTAIN ❓ ABSTAIN ❓ NO ❌
1 (0x01) OP_RETURN 010004000000 ABSTAIN ❓ ABSTAIN ❓ YES ✅
2 (0x02) OP_RETURN 020004000000 ABSTAIN ❓ NO ❌ NO ❌
@davecgh
davecgh / commands.sh
Created January 31, 2016 22:21
Using OpenSSL To Generate a Wildcard Decred Certificate Pair
openssl ecparam -name secp521r1 -genkey -out dcrd.key
openssl req -new -x509 -key dcrd.key -out dcrd.cert -sha512 -days 3650 -extensions v3_req -config ./openssl.cnf

Initial Preparation

The first step is to read the Code Contribution Guidelines documentation to get a good understanding of policies used by the project.

Once that is done, the following commands illustrate a straight forward setup for submitting pull requests to the project:

One time setup

  • Fork dcrd on github
  • Run the following commands to obtain dcrd, all dependencies, and install it (this has probably already been done):
@davecgh
davecgh / btcd_pull_request_management.md
Last active September 20, 2018 19:43
Managing a btcd Pull Request for Code Contibutions

Initial Preparation

The first step is to read the Code Contribution Guidelines documentation to get a good understanding of policies used by the project

Once that is done, the following commands illustrate a straight forward setup for submitting pull requests to the project:

One time setup

  • Fork btcd on github
  • Run the following command to obtain btcd, all dependencies, and install it (this has probably already been done):
@davecgh
davecgh / example_txscript_signaturescript.go
Last active September 20, 2018 19:45
Example of signing a transaction using txscript.SignatureScript
package main
import (
"encoding/hex"
"fmt"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"