Press "Enter" to skip to content

Making Bitcoin Anonymous Again – With CoinJoin Using Samurai Wallet and Whirlpool

April 5 was Coinjoin day, to celebrate, we tried the Samourai Whirlpool mobile mixing on testnet and spoiler alert it worked. The article is about the what it is and the importance of CoinJoin, the ability to do so using several tools, and how to do it yourself.

Coinjoin is a kind of bitcoin transaction in which few peers participate using their UTXOs (Unspent outputs from Bitcoin transactions OR just bitcoin balance) which enters the system (in this case it is one of the pools in whirlpool) and after a group of transactions using the coinjoin implementation, different outputs are created and nobody should ideally be able to make out which belongs to the which peer that initially spent their UTXOs. I have drawn a shapes diagram below to make it easier for everyone to understand the concept of coinjoin in bitcoin.

Greg Maxwell started the thread on bitcointalk forum about coinjoin back in 2013.

Steps of coinjoin process in Samourai Whirlpool

Tx0    –    Premix    –    Mixing    –    Postmix    –    Spend

Why Use CoinJoin?

CoinJoin offers financial freedom, to keep your transactions private and secure, if bitcoin transactions aren’t private, how is it different from fiat currencies where the government, banks etc. can run surveillance. 

Bitcoin being an open ledger for anyone to access, a user may leak sensitive information about your identity, your wallet balance, your past transactions and your future transactions to your payers and recipients.

Blockchain analysis companies are already paid to deanonymize, spy and profile blockchain users, leading to payment censorship and affecting Bitcoin fungibility.

How to do a coinjoin?

We used Samourai wallet mobile app to coinjoin.

All the testers created a testnet wallet after installing the app. User can directly do the same with mainnet wallet and real Bitcoin.

Select TestNet or Mainnet based on the requirement on Samourai.

Once the user have created a new wallet and received some BTC in it, they can follow the below steps to use whirlpool coinjoin in samourai mobile app.

Whirpool option on Samurai Wallet
Mix UTXOs on Samurai Wallet.
User will select the UTXO from where the funds are to be used.
Fee selection on Samurai wallet

Select priority and this might be different on the mainnet. I will share some information about fees involved in whirlpool towards the end.

Information about basic things before confirming the cycle to begin including unmixed change left from tx0 outputs.

  • TX entropy computes the number of possible interpretation of a transaction (high entropy = good privacy)
  • Entropy density (ED) computes entropy per input/output, this as an efficiency metric regardless tx size. ED(tx) = entropy(tx) / count(tx.inputs + tx.outputs) (high ED = good privacy)
  • UTXO- Unspent Transaction Output

This is the change which was separated from the coinjoin process initially during tx0 to avoid issues. My personal opinion is that user can spend it later to send to some exchange like bisq or hodlhodl, do XMRBTC or BTC-LN trades to mix and later consolidate in your cold storage at different times in different amounts.

UTXO paired in Whirlpool, waiting for premix
One UTXO enters mixing stage and waits for other 4 peer
A new UTXO with 0.01 BTC from each in post mix state.

Tx0 transaction:

Post-mix transactions:

Post-mix UTXOs:

Example of a tx0 transaction on mainnet: is also a cool bitcoin block explorer which also has graphical views to analyze different transactions

After the post-mix stage you can either keep the UTXOs for remixing in whirlpool for free and increase anonymity every time you join a mixing or spend the post-mix UTXOs to pay someone or use for yourself or send to cold storage using post-mix tools in Samourai. Post-mix usage is more important than mixing itself in my opinion.

Once you complete Tx0 and have your first mix done, in the app you’ll go to the post-mix section. Each UTXO will have an option to be marked as unspendable or spent or sent to whirlpool . The UTXOs will be queued one at a time (to prevent mixing with yourself) and selected at random to participate in additional mixes with new users, who pay the mining fee for the tx.

Stonewall: A basic transactions that looks like a mini Coin Join on chain.

Stonewallx2: A real mini Coin Join where your friend provides you inputs.

Stowaway: A special transaction which looks like a normal transaction but actually is a mini Coin Join between you and your friend where the real transacted amount is obfuscated on chain.

Ricohet add on to Samurai Wallet

Ricohet is also a good privacy add-on in Samourai Wallet app which adds extra hops to your transaction to make it hard for anyone analyzing your transactions

Fees involved in whirlpool coinjoin:

Fees for Whirlpool bot. Source: Telegram
Whirlpool Entry Fee Example (0.01 BTC POOL)

Whirlpool Entry Fee Example (0.01 BTC POOL)

» FLAT Fee is 0.0005 BTC (5%*0.01BTC)

» FLAT entry fee of 0.0005 BTC paid regardless of BTC mixed

» The more you deposit in single tx0 the cheaper the overall fee as a percentage of mixed BTC

» Total mix fees will be slightly higher including miner fees

Usually 3 free riders are present in a mix. Minimum is 2. Exceptions: the genesis mix of a pool is always 5-0 (no remixers) and the second mix of a pool is always 4-1 (only one prev tx allowed and no 5-0 is allowed after genesis)

One of the important things to consider while using Samourai Whirlpool is Dojo because you should always run your own full node and not depend on others or share information about your wallet transactions with Samourai. More info on Dojo

If you want to run your full node and have other options apart from dojo you can also consider buying a nodl: 

nodl DOJO

Some people think Android is not secure enough to be used for bitcoin related stuff which is a myth because Android phones with stock ROMs and backdoored hardware of Chinese companies can be insecure however you can always use a different kernel, custom ROM, privacy apps, customized hardware etc. Also you can use the Samourai wallet app in any emulator or Google Android Studio to test things. I am working on a website to create an open source self hosted environment for using Samourai Wallet in a browser. Hopefully it will be live soon.

I think the best phone right now in terms of privacy is: pinephone

Samourai wallet links:



SW Telegram:

SW Whirlpool Trollbox Telegram:

My favourite- SW offtopic aka Memepool (Secret Room):

Always feel free to join the above mentioned groups for any feedback or questions. Everyone from the SW team and people voluntarily contributing are really helpful in things related to Bitcoin, Privacy, Anonymity etc.

You can also check the below mentioned podcasts and videos for understanding Samourai, Privacy and Coinjoin better:

Thanks to everyone who participated: hesh870, nafkz18, x0x00, amiermhc, Ardent_cule, jombie99 and ItsMeLA. Also appreciate the help from one of the Samourai developers, Sarath who is always supportive and helpful in things related to Bitcoin and Coinjoin. Before I explain how whirlpool works and share our experience, I want to give a short description of our group and our goals. 

We are a group of people who want to contribute to Bitcoin in different ways with our skills. It’s not sponsored by anyone. We get involved in a lot of things voluntarily to make Bitcoin better and spread the word about it. Recently did a Bitcoin meetup in Bangalore and you can check the details here:






Memes taken from @dammkewis_memes

What do you think about Coinjoin, let us know in the comments below

Be First to Comment

Leave a Reply

Your email address will not be published.

Latest Posts
Send this to a friend