How the shielded bridge works¶
Veylor lets you exchange shielded ZEC on Zcash for USDC on Ethereum and swap back. The wallet calls USDC held in Railgun 0zkUSDC. You can receive it at your own Railgun 0zk address, send it to another Railgun wallet, or withdraw regular USDC to an Ethereum address. On testnet the two assets are TAZ on Zcash testnet and tUSD on Ethereum Sepolia. Both are test assets. Veylor wallet
Watch a forward swap¶
Follow a shielded ZEC-to-0zkUSDC swap. Before escrow opens, the maker may quote a separate, nonrefundable opening fee to cover Ethereum gas and discourage abandoned swaps. The four steps below follow the swap deposit after that fee decision.
Open the interactive swap walkthrough
- It settles. The maker locks USDC. Your wallet verifies the lock, then sends ZEC to the joint address. Your claim reveals your key share. The relayer shields the net payout into Railgun, and the maker uses both shares to spend the ZEC.
- It stalls. If the maker cancels an unready swap or refunds during its allowed window, reclaiming the USDC reveals its share. Your wallet combines both shares to recover deposited ZEC, less the Zcash sweep fee. An opening fee already paid stays with the maker. Prices and fees · Claim and refund windows
Where the funds and keys live¶
The maker quotes an exchange rate and supplies the asset you want to receive. Each swap uses a public Ethereum contract to hold the tokens under agreed terms. On Zcash, the ZEC moves to a fresh shielded Orchard address. Its spending key has two shares. Your wallet holds one, the maker holds the other, and spending from this joint address requires both.
Your wallet chooses a secret share z and the maker chooses e. They exchange public points Z = z·G and E = e·G on the Pallas curve and prove they know the corresponding secrets. Adding the public points gives E + Z = (e + z)·G. This lets both derive the joint address while neither can spend its ZEC alone.
The contract can verify a revealed share against its public counterpart. To claim the tokens, one side reveals the share the other side needs to spend the ZEC. On refund, whoever supplied the tokens reveals their share so the original ZEC sender can recover the deposit. This is what makes the exchange atomic across two chains. The transactions still happen at different times, and the wallet follows them through to the final payout or refund. Protocol overview
Your wallet keeps its recovery phrase and long-term spending keys locally. The maker can view the joint Zcash account to verify payment. A relayer submits signed actions on Ethereum, so a relayed payout can reach your private balance even if you hold no ETH. Railgun shields balances and transfers inside its pool. The Ethereum escrow amount, its timing, and token movements into or out of Railgun are public. The services you contact also see the requests they handle. Wallet privacy policy
The current mainnet wallet beta uses one maker. The protocol assumes the maker and relayer act independently. The maker can observe the joint deposit, and the relayer handles the claim it is authorized to submit. Users depend on timely confirmation and must follow the applicable claim or refund window. Deadlines and refunds
From shielded ZEC to 0zkUSDC¶
The Veylor wallet uses this route for swaps. For regular USDC, you can withdraw from your resulting Railgun balance to an Ethereum address. A client integrating the protocol can also choose a public payout when requesting the quote.
- Get a quote. The wallet creates a fresh Railgun payout note so only its keys can spend the tokens it receives. The maker quotes a ZEC deposit and a gross token amount and proves it knows its share. The wallet checks the network, contract, token and proof. If the quote asks for an open fee, the wallet checks and pays it before accepting.
- Open and check the escrow. The wallet accepts with proof of its own share. The maker locks the quoted tokens on Ethereum. Before sending the ZEC deposit, the wallet reads the confirmed contract state itself. It checks the amount, parties, public shares, deadlines and commitment to its chosen payout note.
- Deposit the ZEC. The wallet sends the quoted amount to the joint shielded address. After the deposit confirms on Zcash, the maker marks the swap ready on Ethereum. This gives up its right to cancel early.
- Claim and receive. In the claim window the relayer submits the wallet’s claim, revealing its per-swap share. The maker can now combine both shares and move the ZEC to its own shielded wallet. A separate payout sends the tokens through the swap’s vault into the committed Railgun note, after deducting the authorized relayer fee. The wallet can follow the payout even if the claim has already settled. Forward wallet client
Direct payout in regular USDC¶
A forward swap can pay regular USDC directly to the Ethereum account that signs the claim and withdrawal. The client quotes using that account’s 0x address and omits payoutNote. It checks that the escrow matches the quote before sending ZEC. When the claim settles, the contract credits the account. The client then withdraws the tokens to that account. The address and amount are public. The account needs ETH for gas on both transactions. This route skips Railgun shielding and the relayer fee. Reference client for account payouts
From 0zkUSDC to shielded ZEC¶
- Quote and prepare to receive. The maker quotes the ZEC it will send for a specific token amount. The wallet checks the deployment, maker proof, amounts, funding deadline, settlement deadlines and its Railgun refund note. It accepts the quote and starts watching the joint Zcash account before funding.
- Authorize funding. The first authorization moves tokens from the wallet’s Railgun balance into the Ethereum escrow. Unshielding and opening the agreed escrow succeed together. The maker independently verifies the funded contract and waits for confirmations before sending ZEC to the joint address.
- Check the ZEC and authorize settlement. The wallet scans Zcash until the full quoted deposit is confirmed and spendable in the joint account. A maker status message or transaction ID alone is insufficient. Only then does the wallet give its second authorization, ready, through the relayer. It must land before the ready deadline.
- Collect the ZEC. After ready confirms, the maker claims the tokens before the claim deadline and reveals its per-swap share. The wallet verifies the revealed share on Ethereum, combines it with its own and moves the ZEC into a fresh shielded address it alone controls. This final Zcash transaction is called a sweep. Its fee comes out of the gross ZEC deposited by the maker. Reverse protocol
Reading the price and fees¶
The quote specifies the deposit and the gross token payout. A forward opening fee, when quoted, is paid separately in ZEC. A relayer fee comes out of a shielded payout. Compare the costs of each route
Deadlines, refunds and interrupted swaps¶
The contract uses separate windows for claiming and refunding. Which party can act depends on the swap direction, current state and Ethereum block time. Find the recovery path for your swap