How Transactions Get Linked
A zero-knowledge proof hides which shield (a deposit into the pool) paid for which unshield (a withdrawal from it). That link is hidden by cryptography, every time. The shield and the unshield themselves are public, so whether anyone can connect your two addresses depends on how many other shields could explain your unshield.
This page shows how that connection is made, one signal at a time, and what to do about each one. The examples use two addresses: an old address that other people already know, and a new address that should not be connected to it. For the step-by-step version, see Move Funds Away From an Exposed Address.
The goal is financial privacy and personal safety: a person who learns one of your addresses should not be able to read your balance and your payment history. This page does not help anyone avoid the checks described in Compliance & POI, and nothing on it changes them.
What Is Public and What Is Hidden
To shield is to move tokens from a public address into the Railgun pool, the shared contract that holds every user's private balance. To unshield is to move tokens from the pool to a public address. A zero-knowledge proof lets you spend from the pool without showing which funds are yours.
| Stage | Public on-chain | Hidden |
|---|---|---|
| Shield | The address that shields, the token, the amount, the time | The private (0zk) address that receives the funds |
| Private transfer inside the pool | That a Railgun transaction happened, the time, the account that submitted it | Sender, recipient, token, amount |
| Private swap inside the pool | Both tokens, both amounts, the time | Who swapped |
| Unshield | The receiving address, the token, the amount, the time, the account that submitted it | Which shield or shields the funds came from |
The Crowd
An observer who sees an unshield asks one question: which shields could have paid for this? The answer is a list of candidates. This page calls that list the crowd. Privacy researchers call it the anonymity set.
- The crowd is counted per chain and per token. USDC on Arbitrum, USDC on Ethereum and WETH on Arbitrum are three separate crowds.
- Each public detail removes candidates: shields made after the unshield, shields that do not fit the amount, shields that do not fit the timing.
- The observer cannot prove a link. They can only shorten the list. When the list is short, a guess is usually correct.
The crowd has no fixed size. It changes with the chain, the token, the amount and the day. Anon does not currently show you the size of the crowd. The advice below reduces the ways in which your transactions differ from other people's. It is not a guarantee.
The Signals
Amount
Amount is usually the strongest signal. It works in four ways.
The same amount. You already have a private balance. You shield 10,000 USDC from one address, and later you unshield 10,000 USDC to a new address on the same chain. The two public numbers are identical, and few other shields explain that unshield.
The fee-adjusted amount. A different number does not hide the match. Shielding and unshielding each cost 0.38%: a 0.13% Anon fee and a 0.25% Railgun fee, taken one after the other. The rates are public and the same for everyone, so the amount that comes out is a known function of the amount that went in.
| Step | USDC |
|---|---|
| Leaves the public address | 10,000.00 |
| Arrives in the private balance | 9,962.03 |
| Arrives at the new address if all of it is unshielded | 9,924.21 |
Anyone can multiply 10,000 by 0.99242 and search for an unshield near 9,924.21. If the network fee is paid in the same token, the result is slightly lower, so the match is a narrow range and not one exact number. A narrow range is enough.
Amounts that add up. You shield 30,000 USDC. Over the next two days, three new addresses receive 9,900 USDC each. The total is 29,700 USDC, just under the 29,772.63 USDC that a shield of 30,000 USDC can pay out. Splitting did not help, because the parts are equal, close in time, and add up to one deposit.
Distinctive amounts. A shield of 10,412.77 USDC is probably the only shield of exactly that size. The matching unshield, 10,333.85 USDC, is just as rare.
What to do
- Do not unshield everything you shielded in one transaction. Leave part of it in the pool, or pay part of it out later.
- Choose unshield amounts that do not equal your shield, do not equal each other, and do not add up to your shield within a short time.
- Prefer amounts that other people are likely to use. A round amount such as 5,000 USDC is more likely to be shared than 5,127.43 USDC.
- Read the public amounts on the review screen. The number you type is not always the number recorded on-chain. With Include unshield fee on, which is the default, the amount you type is the amount that arrives. On the extension's Unshield page the same switch is named Add unshield fee to input.
Token
A token that few people shield has a small crowd, whatever the amount. Suppose 15 addresses have ever shielded a small governance token on Polygon, and 2 of them did so this month. An unshield of that token today has at most 15 candidates, and 2 likely ones, before anyone looks at the amount.
What to do
- Move value through the pool in a token that many people shield on that chain. The public explorer Railscan shows how many shields and unshields each token has on each chain.
- If the old address holds a rarely shielded token, you can swap it at that address first and shield the result. That address is already public, so a public swap there does not create a new link.
Share of the Pool
A large unshield can only come from someone who put a large amount in.
Suppose most USDC shields on a chain are below 20,000 USDC, and four addresses have each shielded 500,000 USDC or more. An unshield of 450,000 USDC points to those four first. If only one of them shielded during the last week, the crowd is close to one.
What to do
- Keep each unshield within the ordinary range for that token and chain.
- Spread a large balance over more transactions and more time. The percentage fee is the same for small and large amounts. Each extra transaction adds a network fee.
Time
The sooner an unshield follows a shield, the fewer other shields lie between them.
An address shields at 14:02. A new address receives a matching amount at 15:10 on the same day. Older shields are still possible sources, but the shield made 68 minutes earlier is the obvious candidate.
A new shield cannot be spent for about one hour. During that time the app lists the funds under Shielding tokens while Railgun's Private Proofs of Innocence checks run (see Compliance & POI). The wait is the same for everyone. An unshield that follows a shield by a little more than one hour is therefore a recognizable pattern, not a random delay.
A schedule is also a pattern. An unshield every Friday at 09:00, or always twenty minutes after a salary arrives at your public address, can be matched even when the amounts differ.
What to do
- Let time pass between shield and unshield. Days are better than hours, because more shields arrive in between.
- Vary the time of day and the day of the week.
Links Outside the Pool
The pool hides the path between two addresses. It cannot hide a second path that you create outside it. The usual second paths are:
- Gas. The new address receives its first ETH from the old address. Example: the old address sends 0.01 ETH so that the new address can pay network fees. That single transfer links the two addresses permanently.
- Direct transfers. Any transfer between the old and the new address, in either direction, of any size, at any later date.
- A shared exchange deposit address. An exchange gives each customer a deposit address. Two addresses that pay into the same deposit address are publicly connected, and the exchange knows that both are yours.
- A shared ENS name. ENS records are public. If you point an existing name such as
alice.ethat the new address, you publish the link. - The account that pays the fee. The account that submits an unshield and pays its gas is public. If one of your own public addresses pays, it is connected to the receiving address.
What to do
- Pay the fee privately. In the fee settings choose Private (on mobile, Private fee). The fee is taken from your private balance. Anon's paymaster, a service that submits the transaction and pays the network gas, sends it for you, so none of your existing addresses pays. Both apps require a private fee when you unshield to an address that is not your own. In transaction details, the party that submits the transaction is called the broadcaster, and its fee is the broadcaster fee.
- Take gas from the pool. If the new address needs the chain's native token (ETH, POL or BNB) for its own later transactions, unshield a small amount of that token to it. Do not send it from the old address.
- Use a stealth account. A stealth account is a new public address that Anon derives from your wallet. You fund it from your private balance and withdraw from it back to your private balance.
- Be careful with a gas account. A gas account is a separate address that you fund from your private balance so that it can pay gas for your private transactions. It is public as the payer of every transaction it sends, so reusing one connects those transactions to each other. For that reason the app does not let a gas account pay for an unshield to another person's address.
- Never transfer between the old and the new address. Do not pay from both into one exchange deposit address. Do not attach an existing ENS name to the new address.
Swaps Inside the Pool
A private swap is not a private transfer. In one transaction, your tokens leave the pool to a one-time account, they are swapped on a public exchange, and the result is shielded again. Nobody sees who swapped. Everybody sees both tokens, both amounts and the time.
Example: you shield 5 WETH. Two hours later a private swap takes 4.981 WETH out of the pool, which is exactly what a shield of 5 WETH leaves after fees, and puts 14,841.65 USDC back in. The next day a new address receives 14,729.17 USDC, which is exactly what 14,841.65 USDC leaves after the shield and unshield fees. Each step fits the step before it. The swap did not remove the link. It added one more public step.
What to do
- Treat the input and the output of a swap as public amounts, and apply the Amount and Time advice to them.
- Do not swap the full amount you just shielded, and do not unshield the full output of a swap.
Chains
Each chain has its own pool. Anon supports private balances on Ethereum, Arbitrum, Polygon, BNB Chain and Base. A shield on Arbitrum is one of the shields on Arbitrum only, and the crowd for the same token can be very different on another chain.
Funds do not move between pools privately. To change chain, funds leave one pool, cross a bridge and enter another pool. A bridge is public on both sides.
What to do
- Judge the crowd on the chain you use, not on Railgun as a whole.
- Treat a bridge like a swap: public token, public amounts, public time.
What the Pool Cannot Do
- It does not erase history. Everything the old address did before the shield stays public.
- It does not hide the shield. Anyone can see that an address put 10,000 USDC into Railgun, and when. Railscan lists the pool transactions in which an address appears, and the app links to it from your own transactions (View on Railscan).
- It does not make an exposed address private. An address that is tied to your name stays tied to your name. The pool protects what you do afterwards, from an address that has no other connection to you.
- It does not guarantee a crowd. With few users on a token or a chain, the proof is still valid and the link is still hidden by cryptography, but statistics can be enough for a confident guess.
- It does not skip checks. A shield has to pass Private Proofs of Innocence before it can be spent. A shield that is blocked can only be returned to the address it came from. See Compliance & POI.
- It does not hide your network activity. Servers can still see IP addresses and timing. See Wallet Syncing and Network Guard.
Checklist
- Accept that the shield is public, and plan from the unshield side.
- Wait. Days are better than hours. Do not unshield as soon as the one-hour wait ends.
- Unshield to a new address that has never sent to or received from your other addresses. Do not unshield back to the address that shielded.
- Use amounts that do not match your shield, its fee-adjusted value (the shield multiplied by 0.99242), or parts that add up to it.
- Use a token that many people shield on that chain, and keep each unshield ordinary in size.
- Pay the fee with Private (on mobile, Private fee).
- Give the new address gas from the pool, never from the old address.
- Make no transfers between the old and the new address. Share no exchange deposit address and no ENS name between them.
- Treat private swaps and bridges as public amounts.
- Remember the limit. These steps lower the chance of a link. They do not make a link impossible.
Related
- How Privacy Works: what observers see with and without Anon
- The Railgun Protocol: the pool and its contracts
- Shielding & Unshielding: steps and fees
- Network Fees and the Paymaster: who submits a transaction and what each fee method makes public
- Sending Tokens: private transfers and unshields from the Send page
- Swapping Tokens: how a swap from the private balance runs and what it costs
- Stealth Accounts: extra public addresses that you fund from your private balance
- Compliance & POI: Private Proofs of Innocence and spendability