top of page
Writer's pictureeconoalchemist

STONEWALLx2, a privacy enhancing tool from Samourai Wallet

This article explains a privacy enhancing transaction tool called StonewallX2. Developed by Samourai Wallet, this tool can be used to collaborate in cahoots transactions to create decoy outputs. You can also find this article published on the Bitcoin Magazine, here.



When it comes to defensively guarding the privacy of Bitcoin users, Samourai Wallet has been on the bleeding edge for many years. Maintaining privacy while using Bitcoin requires paying close attention to the way your transactions are being built; which inputs are being used and what kind of history your inputs are bringing with them. Common input ownership heuristics are used by chain analysis companies to surveil Bitcoin users. These heuristics make the assumption that when there are multiple inputs to a Bitcoin transaction, those inputs belong to the same entity. Techniques can be used to break these assumptions thus rendering the ability of a chain analysis company to maintain such assumptions utterly indefensible.


Any Samourai Wallet user can start using StonewallX2 and other privacy enhancing tools right now. Here is a video example of a StonewallX2 transaction being built between Alice & Bob with a payment being sent to Charlie:


(Also available on the Samourai Wallet YouTube channel, here and in Spanish here)


Animated logo design by: @artdesignbySF


Step 1: Setup the Transaction

StonewallX2 transactions can be built between two collaborators with the payment going to a third party.


Bob selects his Whirlpool wallet from the home-screen so that he can spend bitcoin from his mixed outputs.


In this example, Bob wants to send a payment of 0.007 BTC to Charlie. Bob is going to collaborate with Alice by having her provide some inputs to the transaction as well. Alice will pay half the miner fee and receive the benefit of added privacy in return.


Bob has copied Charlie's receiving address to his clipboard and he pastes it in the "To" address dialog box.


Then Bob enters the amount to spend, 0.007 BTC.


Next, Bob enables the Cahoots privacy addon. Then selects StonewallX2. Then selects online participant.


At this point, Bob's PayNym contact list is retrieved and Bob is able to select Alice's PayNym from his list. In order for PayNym contacts to populate on your list, you will need to have followed each other. It is not necessary to take the added step of connecting to each other.


Once Alice's PayNym has been selected, Bob will have a chance to review the transaction details and set the miner fee. Bob is ready to begin the StonewallX2 transaction.


Step 2: Out-of-Band Communication

It is necessary for Bob to coordinate the timing of the transaction with Alice out-of-band using a preferred communication method such as e2ee text, secure email, or phone call, ect.


Once Bob has coordinated with Alice, then Alice knows to start listening for the Cahoots request by selecting "Receive" from her wallet home screen, navigating to the 3-dot menu in the upper right-hand corner, and then selecting "Receive Online Cahoots".


Alice could also receive the Cahoots request from her Whirlpool post-mix wallet which will offer all parties optimal privacy benefits.


Alice receives the notification and approves the request.


Step 3: Soroban

Soroban is an application agnostic communication layer that shares the transaction details between both wallets encrypted over Tor. This development enhances the user experience and achieves a complete transaction, ready to broadcast, within seconds regardless of geographic distance.


Both Alice and Bob will observe a progress bar at the top of their wallet screens.


Bob's wallet is providing inputs and Alice's wallet is also providing inputs.


StonewallX2 transactions can have many inputs but will always have four outputs. The 0.007 BTC payment to Charlie is one output, with an identical 0.007 BTC output going back to Alice. The other two outputs are change being returned to Alice and Bob.


Step 4: Finalize & Broadcast

Once the transaction has been built, Bob has an opportunity to review the details and then he can send the transaction. He will be asked to confirm and then with that, the transaction is broadcast to the Bitcoin network.



Background:

One technique used in the fight for privacy is a tool brought to you by Samourai Wallet called StonewallX2. When someone wants to enhance their privacy while sending bitcoin, they can choose to collaborate with another user to build a cahoots transaction, which will take multiple inputs from both parties and always produce four outputs. Two of the outputs will be identical in size, one is the actual spend to the third party and the other one is a decoy which is sent back to the collaborator. Then the other two outputs are the change returned to the two collaborating parties.


For example, if Bob wants to send Charlie 0.007 bitcoin, Bob can collaborate with Alice to build the transaction in a privacy enhancing way. The transaction will have 4 outputs:


1) Change to Alice

2) Change to Bob

3) Spend to Charlie

4) Identical decoy spend returned to Alice


It is necessary for Alice & Bob to communicate the timing of their transaction out of band, meaning that in the example video above, Bob will have contacted Alice using a communication method outside of the Samourai Wallet application such as a phone call, an e2ee text, or a secure email, ect.


To an external observer of Alice, Bob, & Charlie's transaction, they will no longer be able to make any certain conclusions about the ownership of inputs and outputs to the transaction. When the external observer looks at Alice & Bob's transaction on-chain, this is what they will see:



Q & A:

One of the things I like most about Samourai Wallet is that they build the tools they want to see in the world, tools that they themselves use day in and day out. I think this approach is summarized well on their website: "We are privacy activists who have dedicated our lives to creating the software that Silicon Valley will never build, the regulators will never allow, and the VC's will never invest in. We build the software that Bitcoin deserves."


I had the chance to ask Samourai Wallet a few questions about on-chain privacy:


Why should Bitcoiners care about on-chain privacy and what do they have to lose by not using the tools?

"The blockchain is an immutable publicly available ledger. The tracks you leave behind today will be available for the public (the good, the bad, and the ugly) to scrutinize forever more. By taking steps to improve your on-chain footprint now, you are helping not only your present situation, but more importantly your future situation."


How does StonewallX2 help enhance a user's privacy?

"STONEWALLx2 has a few benefits. First, it supplements the normal STONEWALL transactions because both transactions have the exact same on-chain footprint this means that every one person STONEWALL can be a two person STONEWALLx2 from the perspective of an external observer of the blockchain. Second, the composition of a STONEWALL is designed as such to create a transaction with as many interpretations as possible. Most transactions have a single interpretation, making tracking the flow of funds trivial. When a STONEWALL is encountered, the number of interpretations is increased significantly in addition to doubt as to the number of participants in the transaction (1 or 2?)"


What do you think is the most important privacy development in Bitcoin that developers could be working on today to mitigate future on-chain privacy concerns?

"The lowest hanging fruit is eradicating address reuse. A great way of helping this along are PayNym (BIP47) derived stealth addresses. These special addresses are reusable and allow you to share them publicly without any privacy loss, unlike sharing a static bitcoin address. After that I would suggest implementing an advanced coin selection algorithm such as STONEWALL."


What advice would you give to someone new to Bitcoin? What do you wish you had known when you were first starting out with Bitcoin?

"Stay away from KYC services. They will try to lure you in with convenience at the cost of your sovereignty and freedom, stay away. Take it slow, don't rush anything. Use the tools."


I'm glad I had the chance to hear Samourai Wallet's perspective and I think anyone using Bitcoin would benefit from their advice.


Conclusion:

Samourai Wallet has developed many privacy focused tools, bringing new features and improvements to users that help achieve anonymity through their CoinJoin implementation, Whirlpool; and maintain privacy with spending tools like Stowaway, Stonewallx2, Richochet, & PayNyms. Samourai Wallet is also the only Bitcoin wallet to date that has implemented BIP47, additionally, they recently implemented the app agnostic Tor based communication layer, Soroban. Soroban brings tremendous UX improvements to users engaging in collaborative cahoots transactions like Stowaway & Stonewallx2. See usecahoots.com for an article I wrote on Cahoots transactions and the UX evolution of building the transactions manually versus automatically over Soroban.


Sonewallx2 is a powerful privacy enhancing tool that can be used to break common input ownership heuristics while spending to a third party. To learn more, visit Samourai Wallet's website here. You can start taking steps today to increase your privacy and minimize your on-chain foot print. Supplementing your Samourai Wallet with your own Bitcoin full node is a logical next step, if you're not running your own node then you are trusting someone else's. The Ronin Dojo team has built the perfect full node companion for your Samourai Wallet. Learn more at the Ronin Dojo website here.


Both developer teams maintain resourceful community support channels on Telegram:


Samourai Wallet: https://t.me/SamouraiWallet



 

Thanks for reading! I hope that this article helped you understand Stonewallx2 a little better and got you thinking about your on-chain footprint and the tools available to you to guard your privacy like Stonewallx2.


If you enjoyed this content, leave me a tip here: Donate.


This article can be found on Twitter as a thread here.

1,288 views

Comments


bottom of page