Skip to content

bsv-blockchain/spv-wallet-admin-keygen

πŸ›‘Β Β SPV Wallet Admin Keygen

A lightweight Go tool for generating admin key pairs for Bitcoin SV (SPV-Wallet) applications.


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-admin-keygen requires a supported release of Go.

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

πŸ“š Documentation


Usage

File Generation

Generate admin key pairs by running:

go run main.go

This creates two files:

  • xpub_key.txt – Contains the public key
  • xprv_key.txt – Contains the private key

Local Script

  1. Build the binary:
CGO_ENABLED=0 go build -ldflags="-s -w" -v -o /generator
  1. Run the script:
./keygen.sh

Use -h to see available options:

./keygen.sh -h

Docker

Build the Image

docker build --build-arg build_in_docker=true -t spv-wallet-admin-keygen:local .

Print Keys

To print the keys without storing them in Kubernetes:

docker run spv-wallet-admin-keygen:local --print --no-k8s

Kubernetes Secret Creation

To store keys in a Kubernetes secret, mount your kubeconfig file:

docker run -v ./my-kubeconfig:/kubeconfig -e KUBECONFIG=/kubeconfig spv-wallet-admin-keygen:local

Configure Secret Name

By default, the secret name is spv-wallet-keys. Change it using the -s or --secret flag:

docker run -v ./my-kubeconfig:/kubeconfig -e KUBECONFIG=/kubeconfig spv-wallet-admin-keygen:local --secret my-secret-name

Or use the SECRET_NAME environment variable:

docker run -v ./my-kubeconfig:/kubeconfig -e KUBECONFIG=/kubeconfig -e SECRET_NAME=my-secret-name spv-wallet-admin-keygen:local

Configure Key Names

By default, key names are admin_xpub and admin_xpriv. Change them using --xpub-key and --xprv-key:

docker run -v ./my-kubeconfig:/kubeconfig -e KUBECONFIG=/kubeconfig spv-wallet-admin-keygen:local --xpub-key my-xpub-key --xprv-key my-xpriv-key

Or use environment variables:

docker run -v ./my-kubeconfig:/kubeconfig -e KUBECONFIG=/kubeconfig -e XPUB_KEY_NAME=my-xpub-key -e XPRV_KEY_NAME=my-xpriv-key spv-wallet-admin-keygen:local
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
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 environment files 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.


πŸ§ͺ 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

Sponsor this project

Contributors