How To: Use RAILGUN as an alternative to coin mixers on ETH, BSC, and POLY

Who is tracking your wallet?

Dude Diligence
8 min readJun 17, 2022
Credit: Ged Carroll, 2010

With a blockchain explorer, anyone can view the transactions in or out of your wallet.

Although crypto wallets are pseudonymous when created, every transaction has the potential to be tied back to you personally, especially if that wallet has ever interacted with a centralized 3rd party, or if you swapped assets directly with another person in the real world.

Just as you wouldn’t place your bank statements on social media, you likewise should not be broadcasting sensitive data on-chain when you interact with dAPPs across various crypto ecosystems.

This not only carries financial risk, but could also pose a risk to your personal safety.

For large OTC desks or other institutions, their wallets are often easily identified and tracked today by analytics firms such as Nansen or Glassnode. When leaked, this alpha risks breaching clients’ privacy and exposes proprietary strategies, opening institutions up to liability as well as putting them at a competitive disadvantage. If your clients can simply copy-trade you, what exactly are they paying you for?

Enter RAILGUN

RAILGUN secures privacy for DEX trading, lending and other DeFi interactions. There’s no bridge or layer-2, rather it uses smart contracts to provide zk-SNARK privacy to any transaction or smart contract interaction on Ethereum and other EVM compatible chains.

RAILGUN allows users to be untraceable when they trade, use leverage platforms, or add liquidity, with absolutely any dApp.

Step-By-Step Guide

Follow the process below for a permissionless, decentralized, and unstoppable way to achieve on-chain privacy.

NOTE: The example given is for shielding MATIC, but RAILGUN currently works with ANY token on Ethereum, Polygon, or Binance Smart Chain.

To begin, visit railway.xyz and launch the app.

Visit railway.xyz to begin

Next, create a new wallet by tapping Create wallet. This will be a public wallet that you fund with the tokens you want to privatize.

Create a new wallet

Choose a password for your wallet. The app will ask you to enter this password at various times to confirm certain actions.

Choose a password

Give your wallet a name. This is to help you keep track of wallets in the app, and it is only visible to you.

Give your wallet a name

If it is safe to do so, click to show the seed phrase and write it down somewhere safe.

NOTE: Heed the warning! If you lose the seed and your browser cache is cleared, you will lose access to this wallet forever.

Write down the seed

Once you have copied the phrase, click next and you will see a confirmation containing your 0zk (private) and 0x (public) address. There is no need to write this down, as the app will remember it for you.

Review wallet details

At this stage you should verify that you are on the correct network by checking the dropdown in the upper left of the screen. The default is Ropsten Test Network.

Choose your network

Now it’s time to fund the wallet. Copy the 0x (public) address, and send whichever funds you want to make private to it.

NOTE: Send tokens only to the 0x address! If you see the 0zk address instead, tap the Private button in the top right to switch to your public wallet.

Once the wallet is funded, tap Shield to begin shielding the asset.

Fund the wallet, and tap Shield

Before you can shield a token you need to approve the Railway app to use it. This only needs to be done once.

The app needs approval first

Review the network fee, and tap Approve.

Approve the token

Observe that the recipient is a 0zk address. This private address was generated at the time you created the public wallet, and it belongs to you, but it cannot be tied to you.

At this stage you can add another token, or if you’re ready to shield, go ahead and tap Next.

Note the 0zk address (pre-filled)

To complete the shielding, review the details of your transaction and tap Shield.

Review and Shield

Accounting for various block times and network congestion, the transaction will appear in the Activity tab in the menu to the left.

Confirm in the Activity tab

Now switch to your Private wallet by tapping the button in the top right of the screen, and verify that your asset was shielded successfully.

Notice that in the example given, we now have Wrapped Matic (WMATIC) instead of Matic. In some cases (ETH is another example) the app converts to the wrapped version automatically, and can unwrap it when you unshield to a wallet if you prefer.

Switch to Private wallet and verify funds

You’re halfway done! Your asset is now safely shielded inside of the RAILGUN contract, where no one — not even RAILGUN — can know any of the details of your private balance.

NOTE: For maximum anonymity, stop here and complete the remaining steps at a later time. The more distance you put between the shield/unshield transactions, the better. Consider varying the token amounts, as well, or even swapping to a different token from inside of Railway.

To make your assets public (yet untraceable) again, send them back out to a new, unused, public wallet that you created for this purpose. If you haven’t created one yet, now is the time.

Enter the new wallet 0x address in the Recipient field, enter the number of tokens you wish to send, and tap Confirm amount.

Enter recipient, token amount, and confirm

If a wrapped and unwrapped version of a token are available, choose which one you want to send.

Choose if you want wrapped or unwrapped

Wait for the app to find a relayer. When it does, review the details of the transaction and tap Generate Proof.

NOTE: If no relayer accepts the token you want to unshield, you will see an error. In that case, you will want to fund the wallet with something else in order to pay the relayer for the service and gas.

Generate the proof

At this point the app is performing some heavy computations, so you may have to wait a bit. Don’t navigate away while this work is being performed.

Wait for the proof to be generated

Now the proof is generated, and you have 2 minutes to complete the transaction before it becomes invalid. Tap Unshield before the time runs out.

Unshield to the public wallet

Aaaaaaand you’re done!

Done!

You now have a fresh wallet containing untraceable assets. Pull up a block explorer if you’re curious to see what the wallet history looks like to prying eyes. They won’t find much worth knowing.

Additional info and best practices

  • Remember! Write down the seed phrase for your wallet, as nothing is stored server side and you’ll lose the wallet forever if you clear your browser cache
  • You can shield and unshield multiple different tokens in a single transaction to save time and gas. This can be useful in the case where you are funding a new wallet with untraceable funds, as that wallet will need some gas in the chain’s native token in order to make any transactions.
  • To shield and unshield you need to compensate a relayer, as they are performing a service as well as paying gas on your behalf. You can usually pay with the token you’re shielding (eg. USDC), but if no relayer accepts your token you will need to fund the wallet with something else (eg. ETH).
  • It is recommended that you wait some period of time between shielding and unshielding, and to vary the amounts, in order to decrease the likelihood that someone may correlate the transactions. The longer you wait, the better. This is especially important with niche tokens that have low volume (I see you, Dogshitsafemoon2.0elon bagholder).
  • You can swap tokens privately inside of Railway once an asset is shielded in order to further increase the difficulty of connecting the two wallets. In your private wallet tap Swap to trade tokens using the 0x (Matcha) API.
  • It is NOT recommended to shield lottery or rebasing tokens in Railway (unless it is a quick roundtrip deposit/withdrawal), as they cannot be seen from outside the contract and will miss out on any rebases.

Lastly…

The above is only one use case for RAILGUN. In the future, RAILGUN will allow you to interact with all of DeFi from within the dark forest of Railway, so you never have to unshield your assets.

If you’d like to know more, visit the website and join the RAILGUN community on Telegram. Membership in the DAO only requires staking a single RAIL token, and we encourage you to take part in shaping the future of RAILGUN in a variety of ways — from introducing and debating proposals, to earning bounties for DAO contributions — or even just as a passive supporter of privacy across all of decentralized finance. Financial privacy is a right, not a privilege, and only through exercising that right will it be protected.

Website: railgun.org
Telegram: @railgun_privacy
Twitter: @railgun_project

RAIL: 0xe76C6c83af64e4C60245D8C7dE953DF673a7A33D
RAILPOLY: 0x92A9C92C215092720C731c96D4Ff508c831a714f
RAILBSC: 0x3F847b01d4d498a293e3197B186356039eCd737F

Follow me: @Dude_diligenced

--

--