e2922eb4ce6b820fd1bf698c6aadce5d5f4d27c6 move rpc thread count setting to lightning modules (Erik Arvstedt) 352fc4e8fe6c24ff856464d9c53997b96197130b liquid: remove insecure and redundant option 'rpcpassword' (Erik Arvstedt) 757a66b9bd1784d9a20fce8cf04414f31f2c762d liquid: move rpcuser definition to module (Erik Arvstedt) 0e00c39d4784bc64e30b1fc37c684e75e08bdaa6 secure-node: improve layout (Erik Arvstedt) 5f7a7962f77057dba76954bb44813006b98cecde backups: remove redundant option 'program' (Erik Arvstedt) 04d8560f86e94fc9d2f9df1c8334e11442b75373 secure-node: remove qrencode, tor from systemPackages (Erik Arvstedt) 323a431abade32e3c5f0f98acfaada6a80edc1d0 improve nodeinfo (Erik Arvstedt) f6b883a9acd92e3d94062b21615db14c8383f3b7 remove webindex (Erik Arvstedt) 2a240d6f4a2bc624772b2065f07b1f1a55bf4eb0 enable-tor: disable default onion services for clightning, lnd, btcpayserver (Erik Arvstedt) 18c7842e1affa87df63809cd2f7a6b068468918e modules: show warnings for obsolete options (Erik Arvstedt) 45c40c4eb94b1176216ca2b466442b8029ca8b51 versioning: simplify assertion evaluation (Erik Arvstedt) bed00fe937a1e7e6a2496ac29ee904e4440b073e lnd: use onionServices for address announcing (Erik Arvstedt) 3980cd5a4191e96d8cf1a942b89149a8c034b31c clightning: use onionServices for address announcing (Erik Arvstedt) bd2a46cb73de511b763d87593aadf6d0d9eefe11 spark-wallet: use onionServices (Erik Arvstedt) 87fb9f246bd448d890e3958c4be786d81f264b27 add 'enable-tor' preset (Erik Arvstedt) 05b5402bb152543ee21aec583436d35425bcc3b9 add nix-bitcoin.onionServices (Erik Arvstedt) fffe988248fcb48fe0a58214aa96b2900c92309b onionAddresses: add readonly option 'dataDir' (Erik Arvstedt) 5f34b094d3c13978e1689e73d679190a8f0cdcbb onionAddresses: improve script (Erik Arvstedt) b266f232515ce64354d22271ffba9dca8496a67f onionAddresses: use service 'script' option (Erik Arvstedt) 6d13b26d0a5d42821028ce999653cff3771a3cc9 onionAddresses: add more precise type for option 'access' (Erik Arvstedt) 93562f76dd0da0ccc77e71e522fb75332ed674ed onionAddresses: remove redundant option 'enable' (Erik Arvstedt) 43c247e3fe3b2a8f635373a4278ba990694b330a onionAddresses: use StateDirectory instead of tmpfiles (Erik Arvstedt) 5c6977b006d492ac7030373129ddb989e0691847 rename onion-chef -> nix-bitcoin.onionAddresses (Erik Arvstedt) 55073eee70056b2850656cb3db1b62068b726267 remove nix-bitcoin.pkgs.lib (Erik Arvstedt) 09e0042aa84b5effa746d9cf76fd06b3a97ad06c spark-wallet: add consistent address options (Erik Arvstedt) 39f16c0b4aab844b183ee4c97acebf95eb2fe1c0 liquidd: add consistent address options (Erik Arvstedt) b5d76ba1b3cb3c0683a4b0e2feac8aa722966193 electrs: add consistent address options (Erik Arvstedt) 8fa32b7f91523ac6c499c036931d03f98b39be05 btcpayserver: add consistent address options (Erik Arvstedt) e78a6096871ad88421f7673f24139d0c3f51d867 clightning: add consistent address options (Erik Arvstedt) b41a720c28a426b1576a063ab74e295b70a5b13e lnd: add consistent address options (Erik Arvstedt) dd4a0238f9bcc4148eb718933d5ab95ca211e4b9 bitcoind: group rpc options under parent option 'rpc' (Erik Arvstedt) 5b7e0d09b2e85386c16d40ad624e824f88f3c015 bitcoind: add consistent address options (Erik Arvstedt) Pull request description: ACKs for top commit: nixbitcoin: ACK e2922eb4ce6b820fd1bf698c6aadce5d5f4d27c6 jonasnick: ACK e2922eb4ce6b820fd1bf698c6aadce5d5f4d27c6 Tree-SHA512: a85b33efe66048f06699b3997f83c9427f70f278fa66d30ee9a29c91f50723ff8bd1ffb9d968d7f08818742c8c6afb0b40dbfc14b95a4b8c3302caf9bede4198
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 the examples directory.
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
- spark-wallet
- electrs
- btcpayserver
- liquid
- Lightning Loop
- 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: daily 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, 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 freenode.
We are always happy to help.