dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.19k forks source link

feat: allow manipulation of CoinJoin salt using RPC, make coinjoin a composite command and remove inapplicable keypool exhaustion warning #6093

Open kwvg opened 6 days ago

kwvg commented 6 days ago

Motivation

CoinJoin utilizes a salt to randomize the number of rounds used in a mixing session (introduced in dash#3661). This was done to frustrate attempts at deobfuscating CoinJoin mixing transactions but also has the effect of deciding the mixing threshold at which a denomination is considered "sufficiently mixed", which in turn is tied this salt, that is in turn, tied to the wallet.

With wallets that utilized keypool generation, this was perfectly acceptable as each key was unrelated to the other and any meaningful attempts to backup/restore a wallet would entail backing up the entire wallet database, which includes the salt. Meaning, on restore, the wallet would show CoinJoin balances as reported earlier.

With the default activation of HD wallets in legacy wallets (and the introduction of descriptor wallets that construct HD wallets by default), addresses are deterministically generated and backups no longer require a backup of the wallet database wholesale.

Users who export their mnemonic and import them into a new wallet will find themselves with a different reported CoinJoin balance (see below).

https://github.com/dashpay/dash/assets/63189531/dccf1b17-55af-423d-8c36-adea6163e060

Demo

Based on c00a3665

https://github.com/dashpay/dash/assets/63189531/c60c10e3-e414-46af-a64e-60605a4e6d07

Additional Information

Checklist:

Go over all the following points, and put an x in all the boxes that apply.