fdcb68e96efed9b9210687f2fd02cf810edd21b7 examples/shell.nix: add new commands (Erik Arvstedt) a2466b11273cadc4fb4a8b5c49937e4b5f2ade3c secrets: allow extending generate-secrets (Erik Arvstedt) 24fd1e9bdceef5c2c21228f2f5a65bb9a2181574 improve examples/shell.nix (Erik Arvstedt) 8a757e0486710f2542e0e3377083d3c595c41436 push-release.sh: improve --dry-run mode (Erik Arvstedt) 82a2b148d8c502d56254b7c6e91731a5cbe41778 secrets: minor fixes (Erik Arvstedt) e1e3d8a92bf5710098adf0314f4a89005c5d7274 secrets: simplify cert generation (Erik Arvstedt) 2c8e29b35bc5b8165c854966594a68456e341f62 lnd: extract option `certPath` (Erik Arvstedt) be12a49933aa0034893f4acf06c86766d62f9c87 lightning-pool/loop: extract lnd variable (Erik Arvstedt) 955b44404cc16fefa038f85d4c58929ba558e5be delete helper/fetch-channel (Erik Arvstedt) 5087ce245f15e581e5efb9276806cb1dd9d99d55 minor cleanups (Erik Arvstedt) 0d2db4e79f20324b80e7683a21af7aea89470b06 backups: add option `postgresqlDatabases` (Erik Arvstedt) Pull request description: ACKs for top commit: nixbitcoin: ACK fdcb68e96efed9b9210687f2fd02cf810edd21b7 jonasnick: ACK fdcb68e96efed9b9210687f2fd02cf810edd21b7 Tree-SHA512: a0fef5b6f8704a445b0e381a1713c14d1447e16798e7035bb005d2b61c4cde208f96fc6f152238b6ea2e9080c04fffe7f841073fa41a5c1e0597204e9ed805c2
nix-bitcoin is a collection of Nix packages and NixOS modules for easily installing full-featured Bitcoin nodes with an emphasis on security.
Overview
A Bitcoin node verifies the Bitcoin protocol and provides ways of interacting with the Bitcoin network. nix-bitcoin nodes are used for a variety of purposes and can serve as personal or merchant wallets, second layer public infrastructure and as backends for Bitcoin applications. In all cases, the aim is to provide security and privacy by default. However, while nix-bitcoin is used in production today, it is still considered experimental.
A full installation of nix-bitcoin is usually deployed either on a dedicated (virtual) machine or runs in a container and is online 24/7. Alternatively, the Nix packages, NixOS modules and configurations can be used independently and combined freely.
nix-bitcoin is built on top of Nix and NixOS which provide powerful abstractions to keep it highly customizable and maintainable. Testament to this are nix-bitcoin's robust security features and its potent test framework. However, running nix-bitcoin does not require any previous experience with the Nix ecosystem.
Examples
See here for examples.
Features
A configuration preset for setting up a secure node
- All applications use Tor for outbound connections and support accepting inbound connections via onion services.
NixOS modules
- Application services
- bitcoind, with a default banlist against spy nodes
- clightning with support for announcing an onion service
Available plugins:- clboss: automated C-Lightning Node Manager
- helpme: walks you through setting up a fresh c-lightning node
- monitor: helps you analyze the health of your peers and channels
- prometheus: lightning node exporter for the prometheus timeseries server
- rebalance: keeps your channels balanced
- summary: print a nice summary of the node status
- zmq: publishes notifications via ZeroMQ to configured endpoints
- lnd with support for announcing an onion service
- Lightning Loop
- Lightning Pool
- charge-lnd: policy-based channel fee manager
- lndconnect via a REST onion service
- spark-wallet
- electrs
- btcpayserver
- liquid
- JoinMarket
- recurring-donations: for periodic lightning payments
- bitcoin-core-hwi
- Helper
- netns-isolation: isolates applications on the network-level via network namespaces
- nodeinfo: script which prints info about the node's services
- backups: duplicity backups of all your node's important files
- operator: adds non-root user
operator
who has access to client tools (e.g.bitcoin-cli
,lightning-cli
)
Security
- Simplicity: Only services you select in
configuration.nix
and their dependencies are installed, packages and dependencies are pinned, support for doas (sudo alternative), most packages are built from the NixOS stable channel, with a few exceptions that are built from the nixpkgs unstable channel, builds happen in a sandboxed environment, code is continuously reviewed and refined. - Integrity: Nix package manager, NixOS and packages can be built from source to reduce reliance on binary caches, nix-bitcoin merge commits are signed, all commits are approved by multiple nix-bitcoin developers, upstream packages are cryptographically verified where possible, we use this software ourselves.
- Principle of Least Privilege: Services operate with least privileges; they each have their own user and are restricted further with systemd options, RPC whitelisting, and netns-isolation. There's a non-root user operator to interact with the various services.
- Defense-in-depth: nix-bitcoin is built with a hardened kernel by default, services are confined through discretionary access control, Linux namespaces, dbus firewall and seccomp-bpf with continuous improvements.
Note that if the machine you're deploying from is insecure, there is nothing nix-bitcoin can do to protect itself.
Docs
Troubleshooting
If you are having problems with nix-bitcoin check the FAQ or submit an issue.
There's also a #nix-bitcoin
IRC channel on libera.
We are always happy to help.