📖
Wiki
  • RAILGUN 101
    • Overview
    • Getting Started
    • RAILGUN Privacy System
      • Zero-Knowledge Cryptography
      • Trusted Setup Ceremony
      • Community Broadcasters
      • Privacy Overview
    • Wallets and Keys
    • Shielding Tokens
    • Using Shielded Tokens
      • Gasless Interactions
    • Unshielding Tokens
    • Integrating RAILGUN
      • RAILGUN SDKs
      • Adapt Modules
      • Example - DEX Swaps
    • RAILGUN Deductions
    • Helpful Links
  • User Compliance Tools
    • Private Proofs of Innocence
    • RAILGUN Assurance Suite
    • Koinly Tax Exports
  • RAIL Token & Governance
    • RAIL Token Overview
    • RAIL Active Governor Rewards
    • RAIL Tokenomics
    • How to Stake RAIL
    • Decentralized Governance
Powered by GitBook
On this page

Was this helpful?

  1. RAILGUN 101

Unshielding Tokens

Unshielding is the process where funds are withdrawn from the RAILGUN privacy system to a public 0x address. Users can withdraw tokens out of RAILGUN by initiating an unshield interaction and inputting any 0x address, owned or otherwise. Under the hood, withdrawals are identical to a regular private send interaction in that they call the transact() function.

The only difference is that the zk-SNARK circuit outputs for withdrawals are unencrypted, and they contain a check to establish whether the interaction is flagged as a withdrawal or not. The check is contained in the unshield parameter. If unshield is non-zero, the transaction is confirmed as an unshield interaction, and the smart contract will check whether the hashed note matches the transaction hash output.

If all the inputs pass the ZK proof, the tokens are then sent to the unshield address, which is a public 0x address selected by the user.

PreviousGasless InteractionsNextIntegrating RAILGUN

Last updated 10 months ago

Was this helpful?