Skip to content

Open-source non-custodial hosted wallet for the BSV Blockchain (UTXOs, xPubs, Paymail & More!)

License

Notifications You must be signed in to change notification settings

bsv-blockchain/spv-wallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,890 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

🧰  spv-wallet

Comprehensive Go noncustodial wallet for the BSV blockchain


Release Go Version License


CI / CD    Build Last Commit      Quality    Go Report Coverage
Security    Scorecard Security      Community    Contributors Sponsor


Project Navigation

📦 Installation 🧪 Examples & Tests 📚 Documentation
🤝 Contributing 🛠️ Code Standards ⚡ Benchmarks
🤖 AI Usage 📝 License 👥 Maintainers

📦 Installation

spv-wallet-go-client requires a supported release of Go.

go get -u github.com/bsv-blockchain/spv-wallet

Build the binary:

go build -o spv-wallet cmd/*

Run the binary:

./spv-wallet

📚 Documentation


Development Build Commands

Get the MAGE-X build tool for development:

go install github.com/mrz1836/mage-x/cmd/magex@latest

View all build commands

magex help
Makefile Commands

View all makefile commands

make help

List of all current commands:

all                           Runs multiple commands
clean                         Remove previous builds and any cached data
clean-mods                    Remove all the Go mod cache
coverage                      Shows the test coverage
diff                          Show the git diff
generate                      Runs the go generate command in the base of the repo
godocs                        Sync the latest tag with GoDocs
help                          Show this help message
install                       Install the application
install-go                    Install the application (Using Native Go)
install-releaser              Install the GoReleaser application
lint                          Run the golangci-lint application (install if not found)
release                       Full production release (creates release in GitHub)
release                       Runs common.release then runs godocs
release-snap                  Test the full release (build binaries)
release-test                  Full production test release (everything except deploy)
replace-version               Replaces the version in HTML/JS (pre-deploy)
tag                           Generate a new tag and push (tag version=0.0.0)
tag-remove                    Remove a tag if found (tag-remove version=0.0.0)
tag-update                    Update an existing tag to current commit (tag-update version=0.0.0)
test                          Runs lint and ALL tests
test-ci                       Runs all tests via CI (exports coverage)
test-ci-no-race               Runs all tests via CI (no race) (exports coverage)
test-ci-short                 Runs unit tests via CI (exports coverage)
test-no-lint                  Runs just tests
test-short                    Runs vet, lint and tests (excludes integration tests)
test-unit                     Runs tests and outputs coverage
uninstall                     Uninstall the application (and remove files)
update-linter                 Update the golangci-lint package (macOS only)
vet                           Run the Go vet application
Repository Features

This repository includes 25+ built-in features covering CI/CD, security, code quality, developer experience, and community tooling.

View the full Repository Features list →

Library Deployment

This project uses goreleaser for streamlined binary and library deployment to GitHub. To get started, install it via:

brew install goreleaser

The release process is defined in the .goreleaser.yml configuration file.

Then create and push a new Git tag using:

magex version:bump push=true bump=patch branch=main

This process ensures consistent, repeatable releases with properly versioned artifacts and citation metadata.

Pre-commit Hooks

Set up the Go-Pre-commit System to run the same formatting, linting, and tests defined in AGENTS.md before every commit:

go install github.com/mrz1836/go-pre-commit/cmd/go-pre-commit@latest
go-pre-commit install

The system is configured via modular env files in .github/env/ and provides 17x faster execution than traditional Python-based pre-commit hooks. See the complete documentation for details.

GitHub Workflows

All workflows are driven by modular configuration in .github/env/ — no YAML editing required.

View all workflows and the control center →

Updating Dependencies

To update all dependencies (Go modules, linters, and related tools), run:

magex deps:update

This command ensures all dependencies are brought up to date in a single step, including Go modules and any tools managed by MAGE-X. It is the recommended way to keep your development environment and CI in sync with the latest versions.

Usage & Configuration

Every configurable variable is described in config.example.yaml.

Default Configuration:

Running spv-wallet without configuration uses defaults from defaults.go:

  • Cache: freecache
  • Database: SQLite
  • Paymail: enabled (signing disabled)
  • BEEF: enabled
Config Variables

Default config variables can be overridden by (in order of priority):

  1. Flags (highest priority)
  2. Environment variables
  3. Config file (lowest priority)

Flags

-C, --config_file string   custom config file path
-h, --help                 show help
-v, --version              show version
-d, --dump_config          dump config to file, specified by config_file (-C) flag

Generate config file with defaults:

go run ./cmd/main.go -d

The default config file path is the project root with filename config.yaml. Override with the -C flag:

go run ./cmd/main.go -C /my/config.json

Environment Variables

Override any config variable using the SPVWALLET_ prefix with the mapstructure annotation path (use _ as delimiter, all uppercase).

Example: Given this fragment from config.example.yaml:

auth:
    admin_key: xpub...
    require_signing: false
    scheme: xpub

Override admin_key with:

SPVWALLET_AUTH_ADMIN_KEY="your_admin_key"

TAAL API Key

To use TAAL services, an API key is required.

Getting an API Key:

  1. Visit platform.taal.com
  2. Register or login to TAAL Platform
  3. Find your mainnet and testnet API keys on the dashboard

See the TAAL documentation for details.

Configuration: Add your key to config.example.yaml at nodesapistoken

Docker Compose Quickstart

The start.sh script uses docker-compose.yml to start SPV Wallet with web-frontend, web-backend, and your choice of database and cache storage.

Running Options

Manual Configuration (interactive prompts):

./start.sh

Flag-based Configuration:

./start.sh -db postgresql -c redis -sw true -b false

Run ./start.sh -h or ./start.sh --help to see all available options.

Load Previous Configuration:

./start.sh -l

This uses a previously created .env.config file.

Service Ports

Port Service
3002 SPV Wallet web-frontend
8180 SPV Wallet web-backend
3003 SPV Wallet (core service)
3000 SPV Wallet admin
5432 PostgreSQL DB
6379 Redis
8080 Block Headers Service
80 Paymail domain (HTTP)
443 Paymail domain (HTTPS)

🧪 Examples & Tests

All unit tests and examples run via GitHub Actions and use Go version 1.24.x. View the configuration file.

Run all tests (fast):

magex test

Run all tests with race detector (slower):

magex test:race

⚡ Benchmarks

Run the Go benchmarks:

magex bench

🛠️ Code Standards

Read more about this Go project's code standards.


🤖 AI Usage & Assistant Guidelines

Read the AI Usage & Assistant Guidelines for details on how AI is used in this project and how to interact with AI assistants.


👥 Maintainers

Siggi Galt MrZ
Siggi Dylan MrZ

🤝 Contributing

View the contributing guidelines and please follow the code of conduct.

How can I help?

All kinds of contributions are welcome 🙌! The most basic way to show your support is to star 🌟 the project, or to raise issues 💬.

Stars


📝 License

License

About

Open-source non-custodial hosted wallet for the BSV Blockchain (UTXOs, xPubs, Paymail & More!)

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 26

Languages