Stonewall & Samourai Wallet: Enhancing Bitcoin’s Privacy

Pinterest LinkedIn Tumblr

Privacy is a continuously evolving struggle that is aptly demonstrated by Bitcoin’s consistent improvement proposals and innovative techniques for providing users with enhanced privacy. Stonewall is a clustering analysis protection concept initially proposed by privacy-focused Samourai Wallet back in May.

Mapping user addresses through transaction clustering is challenging but possible with many emerging blockchain forensic companies such as Chainalysis. Stonewall makes the task of linking transaction inputs to outputs in Bitcoin much more difficult by making transactions seem like a CoinJoin transaction when in reality, they’re not.

Bitcoin Privacy

Features such as Stonewall are not as significant privacy protections as zero-knowledge proofs or confidential transactions. However, they represent a growing initiative by wallet teams to provide complementary and default privacy features that were previously not readily available to more mainstream users without technical backgrounds.

Background on Samourai Wallet and CoinJoin

Samourai Wallet emerged as a non-custodial wallet service emphasizing user privacy and security. The wallet integrates numerous advanced privacy features including Stonewall, PayNyms, and Tor + VPN support. Privacy-oriented wallets are increasingly in demand — especially for Bitcoin — following revelations among more mainstream users about specific deanonymizing techniques that are possible.

There have been several publications focusing on forensic techniques for mapping Bitcoin user IP addresses and linking transaction inputs and outputs that can be used to identify transaction flows of users. The proliferation of blockchain forensics companies such as Chainalysis and CipherTrace has led to further progression in the field. Luckily, several innovative privacy protection methods have been developed in response to growing threats to Bitcoin user privacy.

Samourai Wallet

From network level protections such as the Dandelion Protocol to coin mixing concepts like CoinJoin, Bitcoin is addressing privacy, security, and fungibility concerns head-on.

CoinJoin was initially proposed by Greg Maxwell and is a relatively well-established technique in the cryptocurrency field for mixing transactions. The basic application of CoinJoin is:

“When you want to make a payment, find someone else who also wants to make a payment and make a joint payment together.”

There are several variations of CoinJoin, some more complex and others more straightforward. Signatures within a Bitcoin transaction are entirely independent of each other, meaning that users can agree on a set of inputs to spend and a set of outputs to pay to and subsequently merge signatures after separately signing a transaction. Once all signatures are provided, the transaction is validated, effectively muddling the origin of inputs and outputs in a transaction.

Many of the initial services using CoinJoin had centralized services, a security hole. These services would be where users negotiated transactions they wished to join. Further, CoinJoin transactions are not very efficient.

The looming implementation of Schnorr signatures can have a net positive effect on CoinJoin transactions, however. Schnorr signatures would allow for much more efficient CoinJoin transactions, meaning smaller size transactions and lower fees by enabling users to combine transactions and signatures into one. Moreover, wallets could potentially seek to integrate CoinJoin as a primary feature after Schnorr signatures are integrated with Bitcoin, increasing privacy for everyone. The more users of CoinJoin in Bitcoin, the greater the net privacy effects for all users in the network, even those not using the service.


Stonewall is intriguing because it does not actually use CoinJoin, it only seems like it does. However, two wallet Stonewall in Samourai will contain real CoinJoin transactions between two interacting parties who trust each other.

Stonewall transactions produce higher entropy than standard Bitcoin transactions which subsequently make chain analysis more expensive for automated analysis and challenging for a human to analyze a transaction graph. Stonewall is not as strong of a privacy feature as other techniques such as Confidential Transactions (CTs), but it is important for reducing the information available for blockchain forensics and making chain analysis rely more on probability assumptions.

Stonewall transactions are made to look like people are combining their transactions into one by adding an arbitrary number of inputs and outputs to a regular Bitcoin transaction. To an outside observer, the transaction would look like a CoinJoin one, making it challenging and less effective to rely on standard blockchain analysis assumptions about the transaction.

Stonewall transactions are designed to achieve a Boltzmann score of more than zero. Boltzmann is a script that returns the entropy of a transaction by providing a metric for the linkability of inputs and outputs using blockchain analysis mapping techniques. Stonewall was designed to replace BIP126 in the original Samourai Wallet implementation after shortcomings that could lead to less entropy in transactions were discovered.

Overall, Stonewall assists in polluting the blockchain analysis process as a default feature of the Samourai Wallet. Stonewall does not occur for every transaction necessarily, but it is also more frequent than the initial BIP126 implemented by Samourai.

Understanding how to stay ahead of cutting-edge analysis techniques requires constantly evolving how transactions are manipulated. Stonewall is a useful tool for enhancing user privacy and subsequent fungibility in Bitcoin but augmenting Stonewall and adapting to the shifting privacy landscape will continue to be necessary.

Advancing Bitcoin’s Privacy

There have been several advances in Bitcoin’s privacy over the course of the last year with some important innovations still in development or on the horizon. Privacy is a constant battle, and with Bitcoin’s established dominance in the industry, it will continue to be a target for deanonymizing users.

Privacy in Bitcoin is not only important as a matter of ideological preference between users. Fungibility is a vital concept to its sustainability and maintaining adequate privacy from chain analysis is necessary to achieve that fungibility. The Lightning Network adds a layer of user privacy between two transacting parties off-chain, but on-chain transactions require continual obfuscation from both blockchain and network level transaction mapping.

Network privacy technologies such as Tor and VPN work well but still have their deficiencies. Dandelion offers another network level privacy protection, but techniques for unmasking users and identifying “dirty” bitcoins will continue to adapt to these new privacy solutions.

Advances in cryptographic obfuscation techniques such as confidential transactions (CTs) and zero-knowledge proofs show significant potential. CTs are already implemented in the recently launched Liquid from Blockstream, and it will be interesting to watch how the development of zero-knowledge proofs and optimizations like bulletproofs continue to progress in the broader industry.

Privacy-oriented wallets like Samourai offer some unique advantages over other Bitcoin wallets. Clever privacy integrations such as Richochet help to increase fungibility by introducing additional transaction hops, and Samourai’s work as part of TxTenna will allow for offline UHF radio wave transactions utilizing the GoTenna mesh network.

Bitcoin’s privacy is a topic that will persist as paramount to the success and sustainability of the legacy cryptocurrency. Methods for unmasking users, tracking transactions inputs and outputs, and mapping transaction messages across the network will continue to progress. However, the Bitcoin community has shown a determined resilience to mitigating these efforts by building some fascinating and clever solutions that give users the privacy they seek.

Important Note: There have been reports of scammers approaching companies via Telegram, LinkedIn and Other Social platforms purporting to represent Blockonomi and offer advertising offers. We will never approach anyone directly. Please always make contact with us via our contact page here.


Blockchain writer, web developer, and content creator. An avid supporter of the decentralized Internet and the future development of cryptocurrency platforms. Contact

Beanstalk Gaming & NFTs
As Featured In
As Featured In