From fdfafb2f40076ed053ccac288c2d33ffb117e313 Mon Sep 17 00:00:00 2001 From: nixbitcoin Date: Mon, 14 Dec 2020 17:12:11 +0000 Subject: [PATCH] joinmarket: 0.7.4 -> 0.8.0-bcfa7eb Update to 0.8.0 with hotfix for genwallet script Includes module versioning error with migration instructions --- examples/configuration.nix | 2 +- modules/joinmarket.nix | 2 +- modules/versioning.nix | 65 +++++++++++++++++++++++++++++-------- pkgs/joinmarket/default.nix | 6 ++-- 4 files changed, 57 insertions(+), 18 deletions(-) diff --git a/examples/configuration.nix b/examples/configuration.nix index 9c7e9b2..1225f8b 100644 --- a/examples/configuration.nix +++ b/examples/configuration.nix @@ -221,5 +221,5 @@ # The nix-bitcoin release version that your config is compatible with. # When upgrading to a backwards-incompatible release, nix-bitcoin will display an # an error and provide hints for migrating your config to the new release. - nix-bitcoin.configVersion = "0.0.18"; + nix-bitcoin.configVersion = "0.0.26"; } diff --git a/modules/joinmarket.nix b/modules/joinmarket.nix index eca3471..fe811fe 100644 --- a/modules/joinmarket.nix +++ b/modules/joinmarket.nix @@ -50,7 +50,7 @@ let [POLICY] segwit = true - native = false + native = true merge_algorithm = default tx_fees = 3 absurd_fee_per_kb = 350000 diff --git a/modules/versioning.nix b/modules/versioning.nix index 4635254..ff44728 100644 --- a/modules/versioning.nix +++ b/modules/versioning.nix @@ -6,14 +6,54 @@ let # Sorted by increasing version numbers changes = [ - # None yet - # { - # version = "0.1"; - # condition = config.services.foo.enabled; - # message = '' - # demo message - # ''; - # } + { + version = "0.0.26"; + condition = config.services.joinmarket.enable; + message = let + inherit (config.services.joinmarket) dataDir; + in '' + JoinMarket 0.8.0 moves from wrapped segwit wallets to native segwit wallets. + + If you have an existing wrapped segwit wallet, you have to manually migrate + your funds to a new native segwit wallet. + + To migrate, you first have to deploy the new JoinMarket version: + 1. Set `nix-bitcoin.configVersion = "0.0.26";` in your configuration.nix + 2. Deploy the new configuration + + Then run the following on your nix-bitcoin node: + 1. Move your wallet: + mv ${dataDir}/wallets/wallet.jmdat ${dataDir}/wallets/old.jmdat + 2. Autogenerate a new p2wpkh wallet: + systemctl restart joinmarket + 3. Transfer your funds manually by doing sweeps for each mixdepth: + jm-sendpayment -m -N 0 old.jmdat 0 + + Run this command for every available mixdepth (`-m 0`, `-m 1`, ...). + IMPORTANT: Use a different for every run. + + Explanation of the options: + -m : spend from given mixdepth. + -N 0: don't coinjoin on this spend + old.jmdat: spend from old wallet + 0: set amount to zero to do a sweep, i.e. transfer all funds at given mixdepth + : destination p2wpkh address from wallet.jmdat with mixdepth 0 + + Privacy Notes: + - This method transfers all funds to the same mixdepth 0. + Because wallet inputs at the same mixdepth can be considered to be linked, this undoes + the unlinking effects of previous coinjoins and resets all funds to mixdepth 0. + This only applies in case that the inputs to the new wallet are used for further coinjoins. + When inputs are instead kept separate in future transactions, the unlinking effects of + different mixdepths are preserved. + - A different should be used for every transaction. + - You might want to time stagger the transactions. + - Additionally, you can use coin-freezing to exclude specific inputs from the sweep. + + More information at + https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/v0.8.0/docs/NATIVE-SEGWIT-UPGRADE.md + ''; + } ]; incompatibleChanges = optionals @@ -51,9 +91,8 @@ in }; }; - ## No config because there are no backwards incompatible releases yet - # config = { - # # Force evaluation. An actual option value is never assigned - # system.extraDependencies = optional (builtins.length incompatibleChanges > 0) (builtins.throw errorMsg); - # }; + config = { + # Force evaluation. An actual option value is never assigned + system.extraDependencies = optional (builtins.length incompatibleChanges > 0) (builtins.throw errorMsg); + }; } diff --git a/pkgs/joinmarket/default.nix b/pkgs/joinmarket/default.nix index 36bf050..db52369 100644 --- a/pkgs/joinmarket/default.nix +++ b/pkgs/joinmarket/default.nix @@ -1,10 +1,10 @@ { stdenv, lib, fetchurl, python3, nbPython3Packages, pkgs }: let - version = "0.7.2"; + version = "0.8.0-bcfa7eb"; src = fetchurl { - url = "https://github.com/JoinMarket-Org/joinmarket-clientserver/archive/v${version}.tar.gz"; - sha256 = "03gvs20d2cfzy9x82l6v4c69w0j9mr4p9zj2hpymnb6xs1yq6dr1"; + url = "https://github.com/JoinMarket-Org/joinmarket-clientserver/archive/bcfa7eb4ea3ca51b7ecae9aebe65c634a4ab8b0e.tar.gz"; + sha256 = "05akzaxi2vqh3hln6qkr6frfas9xd0d95xa3wd56pj8bzknd410m"; }; runtimePackages = with nbPython3Packages; [