MCPcopy
hub / github.com/btcsuite/btcd

github.com/btcsuite/btcd @v0.26.0 sqlite

repository ↗ · DeepWiki ↗ · release v0.26.0 ↗
6,004 symbols 22,275 edges 534 files 5,529 documented · 92%
README

btcd

Build Status Coverage Status ISC License GoDoc

btcd is an alternative full node bitcoin implementation written in Go (golang).

This project is currently under active development and is in a Beta state. It is extremely stable and has been in production use since October 2013.

It properly downloads, validates, and serves the block chain using the exact rules (including consensus bugs) for block acceptance as Bitcoin Core. We have taken great care to avoid btcd causing a fork to the block chain. It includes a full block validation testing framework which contains all of the 'official' block acceptance tests (and some additional ones) that is run on every pull request to help ensure it properly follows consensus. Also, it passes all of the JSON test data in the Bitcoin Core code.

It also properly relays newly mined blocks, maintains a transaction pool, and relays individual transactions that have not yet made it into a block. It ensures all individual transactions admitted to the pool follow the rules required by the block chain and also includes more strict checks which filter transactions based on miner requirements ("standard" transactions).

One key difference between btcd and Bitcoin Core is that btcd does NOT include wallet functionality and this was a very intentional design decision. See the blog entry here for more details. This means you can't actually make or receive payments directly with btcd. That functionality is provided by the btcwallet and Paymetheus (Windows-only) projects which are both under active development.

Requirements

Go 1.25 or newer.

Installation

https://github.com/btcsuite/btcd/releases

Linux/BSD/MacOSX/POSIX - Build from Source

  • Install Go according to the installation instructions here: http://golang.org/doc/install

  • Ensure Go was installed properly and is a supported version:

$ go version
$ go env GOROOT GOPATH

NOTE: The GOROOT and GOPATH above must not be the same path. It is recommended that GOPATH is set to a directory in your home directory such as ~/goprojects to avoid write permission issues. It is also recommended to add $GOPATH/bin to your PATH at this point.

  • Run the following commands to obtain btcd, all dependencies, and install it:
$ cd $GOPATH/src/github.com/btcsuite/btcd
$ go install -v . ./cmd/...
  • btcd (and utilities) will now be installed in $GOPATH/bin. If you did not already add the bin directory to your system path during Go installation, we recommend you do so now.

Updating

Linux/BSD/MacOSX/POSIX - Build from Source

  • Run the following commands to update btcd, all dependencies, and install it:
$ cd $GOPATH/src/github.com/btcsuite/btcd
$ git pull
$ go install -v . ./cmd/...

Getting Started

btcd has several configuration options available to tweak how it runs, but all of the basic operations described in the intro section work with zero configuration.

Linux/BSD/POSIX/Source

$ ./btcd

IRC

  • irc.libera.chat
  • channel #btcd
  • webchat

Issue Tracker

The integrated github issue tracker is used for this project.

Documentation

The documentation is a work-in-progress. It is located in the docs folder.

Release Verification

Please see our documentation on the current build/verification process for all our releases for information on how to verify the integrity of published releases using our reproducible build system.

License

btcd is licensed under the copyfree ISC License.

Extension points exported contracts — how you extend this code

TestInstance (Interface)
TestInstance is an interface that describes a specific test instance returned by the tests generated in this package. I [6 …
blockchain/fullblocktests/generate.go
Message (Interface)
Message is an interface that describes a bitcoin message. A type that implements Message has complete control over the [32 …
wire/message.go
Address (Interface)
Address is an interface type for any type of destination a transaction output may spend to. This includes pay-to-pubkey [6 …
address/address.go
IndexManager (Interface)
IndexManager provides a generic interface that the is called when blocks are connected and disconnected to and from the [4 …
blockchain/chain.go
CoinSelector (Interface)
CoinSelector is an interface that wraps the CoinSelect method. CoinSelect will attempt to select a subset of the coins [4 …
btcutil/coinset/coins.go
ConsensusDeploymentStarter (Interface)
ConsensusDeploymentStarter determines if a given consensus deployment has started. A deployment has started once accordi [4 …
chaincfg/deployment_time_frame.go
TreapForEacher (Interface)
TreapForEacher is an interface which allows iteration of a treap in ascending order using a user-supplied callback for e [3 …
database/ffldb/dbcache.go
Indexer (Interface)
Indexer provides a generic interface for an indexer that is managed by an index manager such as the Manager type provide [3 …
blockchain/indexers/common.go

Core symbols most depended-on inside this repo

String
called by 283
address/address.go
NewCmd
called by 274
btcjson/cmdparse.go
Hash
called by 258
btcutil/coinset/coins.go
SendCmd
called by 180
rpcclient/infrastructure.go
scriptError
called by 179
txscript/error.go
Int
called by 171
btcjson/helpers.go
MustRegisterCmd
called by 161
btcjson/register.go
String
called by 141
btcjson/helpers.go

Shape

Function 2,620
Method 2,344
Struct 718
TypeAlias 249
Interface 40
FuncType 33

Languages

Go100%
Python1%

Modules by API surface

rpcclient/wallet.go278 symbols
btcjson/chainsvrcmds.go136 symbols
rpcserver.go135 symbols
rpcclient/chain.go134 symbols
btcjson/walletsvrcmds.go121 symbols
server.go113 symbols
rpcwebsocket.go102 symbols
peer/peer.go83 symbols
database/ffldb/db.go80 symbols
txscript/opcode.go77 symbols
rpcclient/rawtransactions.go68 symbols
btcjson/chainsvrresults.go68 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

github.com/aead/siphashv1.0.1 · 1×
github.com/btcsuite/btclogv1.0.0 · 1×
github.com/btcsuite/go-socksv0.0.0-2017010517252 · 1×

For agents

$ claude mcp add btcd \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact