23 May 2026

Sovereign Mempools: Switching to Bitcoin Knots with Nix

by Andre Amorim

As sovereign node runners, we must choose the software that best aligns with our principles. While Bitcoin Core is the undeniable standard, some node operators prefer Bitcoin Knots for its advanced mempool filtering capabilities. Knots empowers you to reject non-financial data spam (like large JPEGs or videos embedded in OP_RETURN), ensuring your node resources are dedicated strictly to financial transactions.

If your infrastructure is built on Nix—where reproducibility is paramount—making the switch is surprisingly simple. You don’t need to completely rebuild your system from scratch; you just need to adjust your Nix flake.

Here is how you swap bitcoin for bitcoin-knots in your flake.nix development shell:

{
  description = "A sovereign Bitcoin Knots environment";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  };

  outputs = { self, nixpkgs }:
    let
      system = "x86_64-linux"; # Adjust for your architecture
      pkgs = nixpkgs.legacyPackages.${system};
    in
    {
      devShells.${system}.default = pkgs.mkShell {
        buildInputs = [
          # Swap out pkgs.bitcoin for pkgs.bitcoin-knots
          pkgs.bitcoin-knots
        ];

        shellHook = ''
          echo "Welcome to your sovereign Bitcoin Knots shell."
          bitcoind -version
        '';
      };
    };
}

By simply replacing pkgs.bitcoin with pkgs.bitcoin-knots in your buildInputs, Nix handles the heavy lifting, fetching and compiling the Knots implementation deterministically.

Maintain your sovereignty, filter your mempool, and build reproducibly.