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.

Last updated