Decentralized Layer 1 vs Centralized Layer 2: A Comparison between RAILGUN and Aztec Privacy Protocols

RAILGUN Project
6 min readJun 28, 2022

--

Maybe you’ve heard about privacy systems — not all are made the same. Many have serious differences that put them apart. The most advanced is RAILGUN. Here’s how RAILGUN compares with another privacy solution, Aztec:

- RAILGUN has no risk of changes from a centralized entity, meaning no risk of a rug-pull or changes that put privacy at risk

- RAILGUN does not use vulnerable bridges that take custody of tokens and risk expensive hacks

- RAILGUN has open-source, audited code

- RAILGUN is compatible with all standard ERC20 tokens, and also has NFT compatibility — NFTs are not ERC20 tokens

- RAILGUN allows users to build up a private balance with multiple assets or NFTs

- RAILGUN executes transactions as the user requests them, with no need to wait for batched transactions. Trading in real time!

Let’s examine these assertions in more detail.

What is RAILGUN?

RAILGUN is a cutting-edge privacy-preserving smart contract developed on Ethereum and now also deployed and fully operational on Polygon and Binance Smart Chain — with others still to come. The RAILGUN Privacy System works essentially as a secure wallet that removes all identifying information from transactions.

Users send their tokens to a RAILGUN wallet, and then the system hides wallet addresses and other identifying information from the blockchain, replacing that information with the RAILGUN contract address or, if necessary, of relayers who forward transactions on the user’s behalf.

What is Aztec?

Aztec offers users privacy by utilizing a layer-2 solution. This means sending tokens through a smart contract to another lower security area where transactions can take place with low gas costs. Aztec makes use of a ZK-rollup system. To define what a rollup is, the protocol takes numerous transactions from a blockchain and rolls them up all together into a single transaction. Doing so can remove identifying user information and preserve privacy, but not in real time.

Users send transaction requests to Aztec, and the transaction is then put into a batch, rolled up with other users’ transactions. These transactions are then executed together four times a day, so with unfortunate timing, an Aztec user may have to wait almost six hours before your batch is executed.

Are both useful for DeFi?

Yes, both protocols can be used for DeFi interactions, though with Aztec it is not in real time. Aztec Connect allows users to make use of DeFi protocols with added privacy, though similar to the rollup system, users have to wait for a batch of transactions to be fulfilled. For example, a user who wants to swap their ETH to DAI on Uniswap will have to wait for a batch of 100 ETH/DAI swaps to be filled by other users before their transaction can take place. However, their privacy is preserved. At present, these DeFi interactions can only happen with the three tokens Aztec supports — ETH, DAI and renBTC.

RAILGUN’s defining feature is that it can interact with DeFi privately. RAILGUN uses adapters to connect its smart contract with DeFi protocols. The blockchain records that the RAILGUN contract has interacted with another smart contract, showing only the token and the transaction amount, but no wallet information or other identifying information about the user. As RAILGUN is a smart contract on the primary layer of the blockchain, this can be executed at any time without waiting for a rollup or batch transaction. Any standard ERC20 token is compatible with the RAILGUN Privacy System, which means that even if a brand new token is launched, RAILGUN users can add it to their wallets, make anonymous transactions and even multi-sends from day one. In addition to ERC20 tokens, the RAILGUN contract is also compatible with NFTs, which are not ERC20 tokens.

Flash loans are also possible with RAILGUN private balances, whereas this is not possible with a rollup system.

Are they both secure for users?

RAILGUN has been externally audited by highly-respected firms Trail of Bits, ABDK and Zokyo. The smart contract is open source and can be reviewed by anyone with sufficient technical knowledge. The project is also fully decentralized, governed by its DAO through a voting system, so no one person or group controls the protocol or its future direction.

Aztec’s protocol and smart contracts have not been externally audited, and while their smart contracts and client-side libraries are open-source, their sequencer code is private. This means there is a higher chance of bugs and exploits that could have been caught by auditors — a double-spending vulnerability was identified, thankfully before it could be used maliciously. Very recently, another vulnerability was identified that could have been caught by a comprehensive audit. While the team is demonstrating honesty in sharing these issues with the public, Aztec is at least a year or two years away from a professional-ready, audited platform

Aztec is also a centralized protocol with a single sequencer node that all transactions must pass through, meaning the team retains full control over their smart contracts and verifier. Deployer keys could potentially be abused to steal funds, or a court order could force the team to change their code to reveal previously private information without prior warning to users. Aztec is as secure and private as its centralized team chooses it to be.

As Aztec is a layer-2 protocol, it also requires a smart contract bridge to get tokens to the separate layer. A bridge is what you use to send tokens from one blockchain to another, or from the primary layer of a blockchain to a layer-2. Bridges are not secure and exploitation of the vulnerabilities of bridges have resulted in hackers stealing around one billion USD in a single year. To mitigate potential security issues, Aztec has limited its maximum deposit to 30 ETH.

Costs of use

As a layer-1 smart contract, the costs of using RAILGUN are affected by the cost of gas on the primary blockchain, whereas one major reason layer-2 solutions exist is to avoid high gas costs. By batching or rolling up transactions, fees can be heavily amortized. Though it requires users to make sacrifices in security and versatility, Aztec is cheaper to use when compared with the gas fees to use RAILGUN on Ethereum.

While RAILGUN is highly portable and can be deployed on EVM-compatible blockchains with low gas costs, and can currently be used on Polygon and BSC with low fees, gas prices do mean that it is expensive on Ethereum. Users can save costs when interacting with Ethereum-based DeFi protocols by using Aztec, but with the trade-off of significantly riskier chain security and much slower speed.

Which tool is best for me?

Privacy tools are developed in different ways, with different approaches to protecting user data. This means that some tools will fit particular user requirements better than others.

Users who want to save on gas fees, who can accept the higher security risks of using a centralized service, and who are happy to wait for roll-up could consider using Aztec. But RAILGUN is best for traders and DeFi users who want their transactions executed immediately while preserving their privacy and anonymity. It is also the better option for anyone wanting to utilize tokens beyond the three that Aztec supports.

RAILGUN offers so much to users, enabling them to do so much:

· Performing darkpool-style trading — strategies cannot be copied or countertraded

· Entering into new coin investments without alerting those who follow your wallet

· Building a shielded balance without outsiders knowing the specifics of your holdings

· Preventing spying and data collection related to transaction habits

· Keeping DeFi habits invisible to advertisers or fraudsters looking to target individuals with particular interests

· Making confidential payments to your attorney when seeking legal advice on personal disputes

· Receiving donations without outsiders being able to view donation history

All in real time, with any standard ERC20 token, as well as NFTs which are not ERC20 tokens. RAILGUN is the most complete privacy solution in crypto, and whenever protecting private data is a priority, the RAILGUN Privacy Solution is the best option on the market. The first wallet to use RAILGUN systems, RAILWAY, can be accessed at railway.xyz — why not try it today?

--

--

RAILGUN Project

Framework for ZK Privacy on EVM blockchains. Send transactions and interact with DeFi on Ethereum, Polygon, Arbitrum, and BSC privately. https://railgun.org