spvwallet

package module
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 0 Imported by: 0

README

🧰  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

Documentation

Overview

Package spvwallet is a comprehensive noncustodial wallet for BSV digital currency.

Run: go run cmd/main.go

If you have any suggestions or comments, please feel free to open an issue on this GitHub repository!

By bsv-blockchain (https://github.com/bsv-blockchain)

Directories

Path Synopsis
v2
v2/internal/integrationtests
Package integrationtests provides integration testing utilities.
Package integrationtests provides integration testing utilities.
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.
Package main is the core service layer for the SPV Wallet
Package main is the core service layer for the SPV Wallet
Package config provides a configuration for the API
Package config provides a configuration for the API
Package dictionary is for our standardized error responses
Package dictionary is for our standardized error responses
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
Package engine is the Bitcoin UTXO & xPub Management Engine
Package engine is the Bitcoin UTXO & xPub Management Engine
cluster
Package cluster is for clustering SPV Wallet Engine(s) or servers to work together for chainstate monitoring and other tasks
Package cluster is for clustering SPV Wallet Engine(s) or servers to work together for chainstate monitoring and other tasks
contact
Package contact provides contact-related testing utilities.
Package contact provides contact-related testing utilities.
datastore
Package datastore is the database service abstraction layer
Package datastore is the database service abstraction layer
datastore/customtypes
Package customtypes encapsulates our custom database field types
Package customtypes encapsulates our custom database field types
datastore/sqlite3extended
Package sqlite3extended is a workaround for disabled by default math functions in sqlite3 Unfortunately those math functions can be only enabled with build tag, Which means that we would need to force everyone, who is running any command like go build|run|test, to include also -tag "sqlite_math_functions" which looks like pretty big overhead and potential source of many registered issues just because someone overlooked that he needs to set this tag.
Package sqlite3extended is a workaround for disabled by default math functions in sqlite3 Unfortunately those math functions can be only enabled with build tag, Which means that we would need to force everyone, who is running any command like go build|run|test, to include also -tag "sqlite_math_functions" which looks like pretty big overhead and potential source of many registered issues just because someone overlooked that he needs to set this tag.
metrics
Package metrics provides a way to track metrics in the application.
Package metrics provides a way to track metrics in the application.
pike
Package pike provides functionality to work with Pay-to-PubKey-Hash (P2PKH) scripts in a blockchain context.
Package pike provides functionality to work with Pay-to-PubKey-Hash (P2PKH) scripts in a blockchain context.
script/template
Package template provides a collection of functions and types for working with script templates.
Package template provides a collection of functions and types for working with script templates.
taskmanager
Package taskmanager is the task/job management service layer for concurrent and asynchronous tasks with cron scheduling.
Package taskmanager is the task/job management service layer for concurrent and asynchronous tasks with cron scheduling.
testabilities/testmode
Package testmode provides functions to set special modes for tests, allowing to use actual Postgres or SQLite file for testing, especially for development purposes.
Package testmode provides functions to set special modes for tests, allowing to use actual Postgres or SQLite file for testing, especially for development purposes.
tester
Package tester is a generic testing package with helpful methods for all packages
Package tester is a generic testing package with helpful methods for all packages
utils
Package utils is used for generic methods and values that are used across all packages
Package utils is used for generic methods and values that are used across all packages
v2/utils/must
Package must provides a simple way to panic if an error is not nil.
Package must provides a simple way to panic if an error is not nil.
internal
Package mappings is a package that contains the mappings for the access keys package.
Package mappings is a package that contains the mappings for the access keys package.
common
Package common is a package that contains common models & methods used by all other packages.
Package common is a package that contains common models & methods used by all other packages.
models module
Package server is for all the SPV Wallet settings and HTTP server
Package server is for all the SPV Wallet settings and HTTP server
Package tests provides the base test suite for the entire package
Package tests provides the base test suite for the entire package

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL