FEATURE HOW TO MAINTAIN PRIVACY WHEN SPENDING MIXED BITCOIN

in crypto •  2 years ago 

Considerations should be made when spending Whirlpool unspent transaction outputs (UTXOs) so that the anonymity benefits of mixing your bitcoin are kept intact. There are transaction tools that help you spend your post-mix bitcoin in a way that maintains anonymity, each tool offers different techniques and it's important to understand the differences so that you can always use the right tool for the job.

This article will explore some basic concepts related to the wallet structure around Whirlpool and demonstrate the post-mix spending tools built into Samourai Wallet and Sparrow Wallet.

Although this article focuses on using these tools from the post-mix wallet, they can be used from the other wallets as well.

BASIC BITCOIN WALLET STRUCTURE
In both Samourai Wallet and Sparrow Wallet, the Whirlpool implementation is such that there is a four wallet structure used. These four wallets are all managed by your wallet software in the background, and from the user's perspective, you can navigate between wallets seamlessly.

Structuring the wallets in such a way is important so that your UTXOs remain sequestered from each other, this way your UTXOs follow a logical path through the different stages along their way to the post-mix stage and arrive there without any deterministic links to prior transaction history.

Both Samourai Wallet and Sparrow Wallet have support for the following address formats:

Pay-to-Public-Key-Hash (P2PKH) addresses that look like “17SkEw2md5avVNyYgj6RiXuQKNwkXaxFyQ,” also referred to as "legacy."
Pay-to-Script-Hash (P2SH) addresses that look like “3EEJFjZURxShNr2AoJtbfcvCB749yzP7LP,” also referred to as "nested SegWit."
Pay-to-Witness-Public-Key-Hash (P2WPKH) addresses that look like “bc1qqmmc3s46efrdq0jglhf8l8jg0xw37exgne6q3k,” also referred to as "native SegWit" or "Bech32."
Pay-to-Taproot (P2TR) addresses that look like “bc1p0004nx9sh2qkvd7nzrkffx4xe5wacl8ya9yv5gtqkasatqrtgpaqrrcdg7,” also referred to as "Taproot." Samourai Wallet has support to spend to these addresses, Sparrow Wallet has support to spend to and receive to these addresses.
Testnet Pay-to-Witness-Public-Key-Hash (P2WPKH) addresses that look like “tb1qqakszcjex7zvjg7slarps5mpdngwlwsc5ll8v7,” these are only for testing and retain no value.
Having support for all of these address types does not mean that they all work with Whirlpool. Whirlpool only works with P2WPKH addresses on both Bitcoin’s mainnet and testnet. Therefore the Pre-Mix, Post-Mix, and Bad-Bank wallets described below all handle receiving P2WPKH addresses only and can spend to P2PKH, P2SH, P2WPKH or P2TR addresses.

The wallet software uses different derivation paths to achieve the separate wallets. Derivation paths use different numbers to represent different details about the key path: “m / purpose' / coin_type' / identity'.” In the example below, the deposit wallet can handle a variety of address types, hence the “m/44'|m/49'|m/84'|m/47'” for each of the different purposes. The pre-mix, post-mix and bad bank wallets only handle the “m/84'” purpose.

MTkxMDc2OTgzNTI5MjE5NzM5.webp

Deposit Wallet:
This is the wallet you would make your deposits to. UTXOs in this wallet can be used to create inputs for Whirlpool CoinJoins through what is called a "Transaction Zero" (tx0). You can also just spend from this wallet like any other Bitcoin wallet.

Pre-Mix Wallet:
This is where UTXOs go once they leave the deposit wallet through a tx0. UTXOs do not reside here for long, this is just a pass through where UTXOs are registered as available inputs for Whirlpool CoinJoins. You do not want to deposit directly to this wallet or spend directly from this wallet, your software interface makes this very easy to manage.
Post-Mix Wallet: This is where your UTXOs go once they have been through a Whirlpool CoinJoin. These UTXOs can reside here for as long as you would like them to continue being randomly selected as free-riders to additional Whirlpool CoinJoins for free.

Bad Bank Wallet:
This is where your toxic change goes from your tx0s.
In Samourai Wallet, you can toggle from your deposit wallet to your post-mix wallet by pressing the Samourai icon in the upper left-hand corner.

wallets00.png

In Sparrow Wallet, you can toggle between the four wallets using the tabs on the far left-hand side of the interface.

MTkxMDc2OTgzNTI5MzUwNTEw.webp

POOLS AND TX0
There are four pool sizes in Whirlpool: 0.5, 0.05, 0.01 and 0.001 BTC. This means that each Whirlpool output will be the same as the pool size. When you select UTXOs from your deposit wallet for Whirlpool CoinJoins, they go through a tx0 first. The results of this tx0 vary based on which pool size you select. For example, if you want to Whirlpool 10 bitcoin, the different pool sizes would produce these results through tx0:

0.5 POOL
10.00000000 BTC in
1 x 0.01750000 BTC UTXO for the Whirlpool coordinator fee
19 x 0.50001000 BTC UTXOs for Whirlpool inputs carrying a small extra amount for the miners fee. 1,000 sat miner fee was used in this example but this changes based on mempool congestion and desired urgency.
1 x 0.48231000 BTC UTXO as toxic change
0.05 POOL
10.00000000 BTC in
1 x 0.00175000 BTC UTXO for the Whirlpool coordinator fee
199 x 0.05001000 BTC UTXOs for Whirlpool inputs carrying a small extra amount for the miners fee. Again, 1,000 sats used as an example here.
1 x 0.04626000 BTC UTXO as toxic change
0.01 POOL
10.00000000 BTC in
1 x 0.00050000 BTC UTXO for the Whirlpool coordinator fee
998 x 0.01001000 BTC UTXOs for Whirlpool inputs carrying a small extra amount for the miners fee. Again, 1,000 sats used as an example here.
1 x 0.00952000 BTC UTXO as toxic change
0.001 POOL
10.00000000 BTC in
1 x 0.00005000 BTC UTXO for the Whirlpool coordinator fee
9,900 x 0.00101000 BTC UTXOs for Whirlpool inputs carrying a small extra amount for the miners fee. Again, 1,000 sats used as an example here.
1 x 0.00095000 BTC UTXO as toxic change
Note that the Whirlpool coordinator fee remains the same regardless of how much bitcoin you are mixing. If you mix 1 BTC or 100 BTC in the 0.5 pool as an example, you will pay 0.0175 BTC for the coordinator fee either way.

Also note that the miner fee included with each pre-mix UTXO can accumulate to a large amount in miner fees as the number of pre-mix UTXOs increases. In the 0.001 pool example above, the total in miner fees is 0.099 BTC.

tx0 applies in both Samourai Wallet and Sparrow Wallet. A tx0 is always constructed in such a way that one or more inputs from your deposit wallet are divided into:

Several like-sized outputs, these are the pre-mix UTXOs that will go into Whirlpool CoinJoins later.
One output for the Whirlpool coordinator fee.
One output for the remaining change, this is called "toxic change."
Here is an actual tx0 example, you can see that there was:

One input of 0.81804189 BTC
16 equal-sized outputs of 0.0501 BTC
One Whirlpool coordinator fee output of 0.0025 BTC (current fee has been reduced to 0.00175 BTC)
One toxic change output of 0.0136981 BTC
You can view this transaction on KYCP.org.

MTkxMDc2OTgzNTI5MjE5NDM4.webp

Each of the 16 equal-sized outputs will be individually selected for inputs to downstream Whirlpool CoinJoins. These outputs reside in the pre-mix wallet temporarily as available inputs to Whirlpool CoinJoins. As new Whirlpool transactions are initiated, the coordinator will look for available inputs such as these. The Whirlpool coordinator enforces strict rules that ensure no two outputs from the same tx0 or same wallet wind up in the same Whirlpool CoinJoin transaction. Each of these 16 outputs carries a small amount of extra bitcoin so that once they are selected as inputs, they can help cover the miners fee for the Whirlpool CoinJoin transaction.

The coordinator will randomly switch between creating transactions that have either two fresh participant UTXOs and three re-mix UTXOs or three fresh participant UTXOs and two re-mix UTXOs. The fresh participant UTXOs always cover the miner fee and the "free-rider" UTXOs always get to re-mix for free. This way, you only pay the Whirlpool coordinator fee once and then your UTXOs can remain in your post-mix wallet remixing for free for as long as you want to keep them there.

TOXIC CHANGE

Special considerations should be given to toxic change from the tx0. By default, Samourai Wallet will prompt you to mark the toxic change UTXO as "unspendable" during the tx0 initiation. Marking this UTXO in such a way prevents your wallet from displaying it as an available UTXO and excludes it from your displayed balance.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Your post was upvoted and resteemed on @crypto.defrag

ok