btcw is a bitcoin testnet wallet. Why another bitcoin wallet? So that you could send some coins to it and lose them all! Kidding... This was purely for educational purposes for me to learn more about bitcoin and see how I would go about building one.
It only has the most basic functionality like generating addresses, detect receiving transactions to those addresses, building and signing transactions. It implements BIP-44 hierarchical deterministic wallets.
- go 1.21
- Bitcoin node (btcd or bitcoin core)
-
have a bitcoin node running in testnet (or regtest/simnet)
-
go build .
-
create wallet
./btcw -create
- start wallet (by default it will try to connect to a btcd node. If running with bitcoin core, add
-node=core
when starting wallet)
./btcw -rpcuser={yourrpcuser} -rpcpass={yourpcpassword}
-
cd cmd/btcw-cli
-
go build .
-
get new address
./btcw-cli getnewaddress
- get balance
./btcw-cli getbalance
- send btc
./btcw-cli sendtoaddress "{address}" amount (in btc)