Skip to content

Instantly share code, notes, and snippets.

@davecgh
davecgh / p2sh_pubkey.go
Last active September 20, 2018 19:49
P2SH Pubkey
package main
import (
"encoding/hex"
"fmt"
"github.com/btcsuite/btcutil"
. "github.com/btcsuite/btcd/txscript"
)
@davecgh
davecgh / p2sh_multisig_manual.go
Last active September 20, 2018 19:49
P2SH Multisig Manual
package main
import (
"encoding/hex"
"fmt"
"github.com/btcsuite/btcutil"
. "github.com/btcsuite/btcd/txscript"
)
@davecgh
davecgh / p2sh_multisig_types.go
Last active December 24, 2020 10:32
P2SH Multisig Types
package main
import (
"encoding/hex"
"fmt"
"github.com/btcsuite/btcd/chaincfg"
. "github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcutil"
)
@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 / pubkey_to_addr.go
Last active April 19, 2023 01:22
Example of converting a raw public key to a btcutil.Address.
package main
import (
"fmt"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil"
)
func main() {
@davecgh
davecgh / btcdwstest.html
Last active July 29, 2020 10:16
btcd Browser Websocket Connection Example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>WebSocket Test</title>
<script language="javascript" type="text/javascript">
var wsUri = 'wss://127.0.0.1:8334/ws';
var rpcUser = "rpcuser";
var rpcPass = "rpcpass";
@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 / example_txscript_signtxoutput.go
Last active September 20, 2018 19:47
Example of signing a transaction using txscript.SignTxOutput.
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"
@davecgh
davecgh / simnetblksubmit.go
Created February 18, 2015 21:05
Example of connecting to a simnet btcd instance, manually generating blocks, and submitting them.
package main
import (
"encoding/binary"
"errors"
"io/ioutil"
"log"
"math"
"math/big"
"path/filepath"
@davecgh
davecgh / example_txscript_step.go
Last active March 8, 2019 07:01
Example of stepping through a script using the txscript API.
package main
import (
"encoding/hex"
"fmt"
"os"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"