Railgun, A DeFi Privacy Protocol Praised by Vitalik

BeginnerApr 22, 2024
RAILGUN is a privacy system built on multiple blockchains, using zero-knowledge cryptographic technology to protect the privacy of DeFi transactions. It has the advantages of security, decentralization, and a full ecosystem to enable complex privacy-preserving DeFi transactions.
Railgun, A DeFi Privacy Protocol Praised by Vitalik

1. What is RAILGUN?

RAILGUN is a privacy system built directly on the Ethereum, BSC, Polygon and Arbitrum chains. It uses zero-knowledge (ZK) cryptography to enable smart contracts and DeFi privacy without sacrificing the security of users’ preferred chains.

RAILGUN simply refers to a set of smart contracts that support backend privacy infrastructure. Wallet providers can choose to integrate the RAILGUN protocol.

Because RAILGUN is just on-chain smart contract logic, achieving privacy without the need for a separate L2 validator set or a vulnerable bridge has two major advantages:

  • Security and decentralization - Fewer questions on validator set and no bridge risk. RAILGUN is as secure as the EVM chain it’s deployed on.
  • Full Ecosystem – Rather than an isolated ecosystem on a standalone privacy chain, RAILGUN users have access to all the economic activity on Ethereum and benefit from the rich history of existing dApps and builders.

The user experience is similar to using a public wallet like MetaMask to interact with the Ethereum/EVM chain for liquidity and DeFi, except with the added ability to trade privately.

RAILGUN mainly consists of two major components:

  • RAILGUN integrated wallet - an EVM wallet built by independent community developers through which users can use the RAILGUN protocol.
  • Developer Tools - TypeScript SDKs for building RAILGUN privacy into existing or new wallets, or dApps with privacy-preserving features.

2. What are the advantages and use cases of RAILGUN?

Complex DeFi transactions help make RAILGUN more private than other protocols with similar anonymity. All transfers, exchanges, loans and dApp calls add interactive changes in RAILGUN.

Compared to other privacy systems, RAILGUN achieves better privacy protection with less liquidity and shorter time frames. dApp interaction within the RAILGUN privacy system also incentivizes users to hold assets in RAILGUN longer, as there is no reason to move funds out of RAILGUN.

Potential use cases are:

  • Privacy: Wallet dynamics are not known, account balances are private, trading strategies are protected, trading habits are not monitored, and data collection is prevented.
  • Alpha Protection: Traders who want to keep their alpha secret can trade feely and maintain their hard-fought informational advantages.
  • Private Payroll: Payroll services for companies that pay in cryptocurrency. Using public blockchains in their current state for payroll reveals each employee’s exact salary
  • Censorship Resistance: Censorship resistant donations to causes by citizens who live in countries with unfriendly or corrupt governments officials
  • Anonymized Analytics: Counteracts services like Nansen or Etherscan, where notable wallets are labelled or known, meaning that some large investors are personally identifiable
  • Compliance: Financial companies remaining compliant with data protection laws such as GDPR

RAILGUN is a revolutionary toolkit and is objectively the most uncompromising and complete privacy solution for DeFi. Private DeFi will enable new business possibilities for the cryptocurrency industry not possible on public blockchains. All other privacy solutions have some trade-offs, such as requiring users to trust custodial bridges or trade with fragmented/non-existent liquidity.

3. How is RAILGUN different from other privacy protection protocols?

Other security solutions often require dedicated infrastructure to operate and are known as L2 solutions. L2 solutions do not have direct access to DeFi protocols and rely on bridging technology that has quite a few security holes. Since L2 solutions use their own nodes, they do not have the full security or liquidity of the main blockchain.

Other solutions, such as mixers, lack functionality and ease of use. For example, mixers typically do not support internally shielded transactions or interactions with smart contracts. They may also require users to send and receive a fixed amount, such as 1 or 10 ETH. Mixers cannot use the protocol simply and efficiently while protecting privacy. They also don’t allow users to keep their balances private in their wallets. However, RAILGUN makes users’ privacy safe and worry-free, and users’ privacy will be maintained even if no transactions occur.

Previous generation privacy protocols cannot match the convenience, flexibility and privacy that RAILGUN ensures.

4. What tokens does RAILGUN support?

RAILGUN is permissionless. By default, all standard ERC-20 tokens can be used in the RAILGUN privacy system.

Some ERC-20 tokens are non-standard, such as rebasing tokens and lottery tokens. These tokens are currently incompatible with the RAILGUN privacy system and should not be stored.

Although it is not fully ERC-20 compliant, Tether (USDT) can be used in the RAILGUN privacy system.

5. How easy is RAILGUN to use?

RAILGUN is very easy to use through front-ends such as web apps. The technology can also be easily integrated into existing protocols.

Although the code is very complex, using the RAILGUN privacy system is easy. Wallet apps that contain RAILGUN smart contracts (such as RAILWAY) have very intuitive user interfaces.

6. How to achieve balanced privacy? What are the principles of cryptography?

RAILGUN wallet consists of two keys: Spending Key and Viewing Key: The RAILGUN wallet address (also known as the 0zk address) is the corresponding public key of two - the spending public key and the viewing public key.

Therefore, if user A (Alice) knows the RAILGUN address of user B (Bob), she can initiate a transaction.

Alice does this by creating a note that contains what is called a commitment in cryptography. The commitment contains information about the tokens and the amount of tokens to be transferred. These commitment values ​​are encrypted using information from Bob’s public key.

Next, Alice creates a zk-SNARK proof showing that her spending did not exceed her deposit. This also shows that she didn’t double-spend—she spent the tokens elsewhere.

Finally, Alice sends the proof, commitment, and ciphertext to the RAILGUN smart contract. This smart contract verifies the proof, accumulates the commitment and emits the ciphertext as an event. This means that it checks that everything is correct and enables Bob to interact with the transaction.

Only Bob can use his view key to decrypt the ciphertext and obtain the private information. With this information and his spending key, Bob can spend the note - meaning he can transfer or withdraw the tokens.

statement:

  1. This article is reproduced from [goldFinance], the original title is “6 Questions to Understand the Privacy Agreement RAILGUN Used and Liked by Vitalik”, the copyright belongs to the original author [Golden Finance xiaozou], if you have any objection to the reprint, please contact Gate Learn Team, the team will handle it as soon as possible according to relevant procedures.

  2. Disclaimer: The views and opinions expressed in this article represent only the author’s personal views and do not constitute any investment advice.

  3. Other language versions of the article are translated by the Gate Learn team, not mentioned in Gate.io, the translated article may not be reproduced, distributed or plagiarized.

Start Now
Sign up and get a
$100
Voucher!
Create Account