# Veylor documentation for agents Veylor is a self-custodial Zcash and Railgun wallet with an atomic bridge. Use https://api-testnet.veylor.cash for public API integrations. The wallet runs a capped mainnet beta. The public mainnet API is coming soon. ## Contents - [What is Veylor?](https://docs.veylor.cash/) - [Networks and availability](https://docs.veylor.cash/networks/) - [Common questions](https://docs.veylor.cash/faq/) - [Set up your wallet](https://docs.veylor.cash/wallet/) - [Shield and send ZEC](https://docs.veylor.cash/wallet/zcash/) - [Receive, send and withdraw](https://docs.veylor.cash/wallet/transfers/) - [Make a swap](https://docs.veylor.cash/wallet/swaps/) - [Downloads and release notes](https://docs.veylor.cash/releases/) - [Verify a download](https://docs.veylor.cash/security/release-verification/) - [How atomic swaps work](https://docs.veylor.cash/protocol/) - [What stays private?](https://docs.veylor.cash/bridge/privacy/) - [Prices and fees](https://docs.veylor.cash/bridge/fees/) - [Deadlines and refunds](https://docs.veylor.cash/bridge/recovery/) - [Testnet quickstart](https://docs.veylor.cash/quickstart/) - [API reference](https://docs.veylor.cash/api/) - [Using Veylor with agents](https://docs.veylor.cash/ai/) # What is Veylor? Veylor is an open-source, self-custodial Zcash wallet with an atomic bridge to Ethereum. You can swap shielded ZEC for USDC in Railgun’s shielded pool and back. Veylor calls that private USDC balance **0zkUSDC**. ## Get started - **[Use the wallet](https://docs.veylor.cash/wallet/)** Install Veylor, back up your recovery phrase and receive your first payment. - **[Build with the API](https://docs.veylor.cash/quickstart/)** Get a testnet quote for TAZ to Sepolia tUSD before funding a wallet. - **[Understand the bridge](https://docs.veylor.cash/protocol/#watch-a-forward-swap)** Follow a swap from the first quote to settlement or refund. - **[Build with an AI agent](https://docs.veylor.cash/ai/)** Load the Markdown guide and ask for a testnet quote. ## Where the funds go | You start with | You want to receive | How to get there | | --- | --- | --- | | Shielded ZEC | **0zkUSDC** in Railgun | Swap in Veylor. The payout goes into your wallet’s shielded Ethereum balance. | | Shielded ZEC | **Regular USDC** at a public Ethereum address | In Veylor, swap and then choose **Withdraw**. An API client can also choose a direct payout to its signing Ethereum account. | | **0zkUSDC** in Railgun | **Shielded ZEC** | Start a reverse swap. Your wallet verifies the Zcash deposit before authorizing settlement. | | **Regular USDC** in an Ethereum wallet or exchange | **Shielded ZEC** | Send USDC on Ethereum to your Veylor deposit address. Once it shields, swap the resulting 0zkUSDC for ZEC. | ZEC stays in Zcash’s shielded pool throughout a bridge swap. On Ethereum, the escrow amount and timing are public. A public USDC withdrawal also exposes its destination and amount. [What stays private?](https://docs.veylor.cash/bridge/privacy/) ## Availability The wallet and its bridge run on mainnet in a capped beta. The public developer API is available on **testnet**. The public **mainnet API is coming soon**. [Downloads and release notes](https://docs.veylor.cash/releases/) · [Networks and availability](https://docs.veylor.cash/networks/) · [Common questions](https://docs.veylor.cash/faq/) # Networks and availability Choose the environment for the task. The Veylor wallet can bridge real funds today. Developers and agents can integrate against the public testnet gateway. | Product | Network | Availability | | --- | --- | --- | | Veylor wallet and built-in bridge | Zcash mainnet and Ethereum mainnet, using ZEC and USDC | Capped public beta. Veylor currently uses a single maker. No external audit has been published. [Wallet releases](https://docs.veylor.cash/releases/) | | Public bridge API | Zcash testnet and Ethereum Sepolia, using TAZ and tUSD | Available at `https://api-testnet.veylor.cash`. [Testnet quickstart](https://docs.veylor.cash/quickstart/) | | Public bridge API | Mainnet | **Coming soon.** | ## Check the testnet deployment The maker’s discovery response identifies the Zcash network, Ethereum chain, token and swap contract. The relayer’s terms identify the chain and contract for a relayed payout. The quickstart checks both responses against the expected Sepolia deployment before the wallet prepares any payment. [Connect to testnet](https://docs.veylor.cash/quickstart/#connect-to-testnet) TAZ and Sepolia tUSD are test assets. A mainnet USDC balance, ZEC balance or deposit address belongs to a different network. # Common questions ## Which address should I share for USDC? For payment from an exchange or Ethereum wallet, open **Receive → USDC** and share the displayed Ethereum deposit address. For payment from another Railgun wallet, open **Receive → 0zkUSDC** and share the `0zk` address. Tell the sender which network you expect. [Receiving addresses](https://docs.veylor.cash/wallet/transfers/#choose-a-receiving-address) ## Why is a fee due before I send the swap deposit? Opening and later cancelling an unused Ethereum escrow costs the maker gas. A forward quote may include a small, nonrefundable opening fee to cover that cost and discourage abandoned requests. Your wallet checks the escrow before sending the much larger swap deposit. [Prices and fees](https://docs.veylor.cash/bridge/fees/) ## Why does the Ethereum payout differ from the quote? The quote shows the gross token amount. On a shielded forward swap, the authorized relayer fee comes out before shielding and Railgun’s fee can further reduce the private balance. The direct public route uses the signing account’s ETH for gas. [Read the net amount](https://docs.veylor.cash/bridge/fees/#read-the-net-amount) ## My swap stopped updating. Should I start over? Reopen the existing swap and let the wallet sync. A request can time out after a transaction has already been broadcast. The wallet checks whether it can finish the claim, complete a pending payout, or recover the ZEC after a refund. [Deadlines and refunds](https://docs.veylor.cash/bridge/recovery/) ## Can an agent get a price without wallet keys? Yes. An agent can check the testnet deployment and request a disposable quote before it accepts anything or pays a fee. The public mainnet API is coming soon. [Quote-only agent prompt](https://docs.veylor.cash/ai/#ask-for-a-quote-first) ## Where can I ask for help? Email Veylor for support, or find the community on Telegram and X. For a wallet problem, include your platform, app version and the step where it stopped. Keep your recovery phrase and signing keys private. [Email Veylor](mailto:hello@veylor.cash) · [Telegram](https://t.me/veylorwallet) · [X](https://x.com/veylorwallet) # Set up your wallet Veylor builds on the open-source Vizor Zcash wallet. It adds a Railgun wallet and the bridge between them. One recovery phrase restores access to your shielded ZEC and 0zkUSDC. You authorize payments on your device. ## Install Veylor 1. Open the releases page and choose your platform. For a direct download, match the filename and architecture to your device. [Wallet releases](https://veylor.cash/releases/) 2. Check the downloaded file before opening it. Each release lists its SHA-256 checksum and any available build verification commands. [Verify a download](https://docs.veylor.cash/security/release-verification/) 3. Create a wallet, or restore an existing Veylor wallet with its recovery phrase. Store a backup of the phrase offline. Anyone with it can spend from both balances. 4. Allow the wallet to sync. Open the asset you want to receive and share the address for that asset and network. [Receive, send and withdraw](https://docs.veylor.cash/wallet/transfers/) ## Your keys and balances The Zcash wallet holds shielded ZEC. Veylor derives its Railgun wallet from the same seed using BIP-85. Its `0zk` address receives private transfers on Ethereum. A fresh Ethereum authorization key is derived for each wallet swap, so successive swaps use different authorization addresses. The maker provides the other asset in a swap. The relayer broadcasts the Ethereum actions your wallet authorizes and collects the agreed fee. Neither needs your recovery phrase. Keep it on your device and in your own backup, including when seeking support or working with an agent. [Wallet source](https://github.com/ChinmayGopal931/vizor-fork) · [Wallet privacy policy](https://veylor.cash/privacy/) ## Make your first transfer To receive a payment, start with **Receive**. To exchange an existing balance between chains, start a **swap**. These actions use different addresses and charge different fees. [Shield and send ZEC](https://docs.veylor.cash/wallet/zcash/) · [Choose a receiving address](https://docs.veylor.cash/wallet/transfers/) · [Make a swap](https://docs.veylor.cash/wallet/swaps/) # Shield and send ZEC Shielding moves ZEC from a transparent Zcash balance into a shielded pool on the same chain. The asset stays ZEC. Use the bridge when you want to exchange that ZEC for USDC on Ethereum. ## Shield a transparent balance 1. Sync Veylor after receiving ZEC at your transparent address. 2. Choose **Shield** when the transparent balance is spendable and covers the Zcash network fee. Review the amount and authorize the transaction with your wallet. 3. Follow the transaction in wallet activity. Once it confirms and the wallet syncs, the ZEC becomes available in your shielded balance. The transparent side of the shielding transaction remains visible on Zcash. Future shielded payments use the shielded pool. You can also receive directly at a shielded Zcash address. ## Pay a Zcash address From the ZEC balance, choose **Send**, enter the recipient’s Zcash address, then review the amount, fee and privacy information. A shielded recipient can receive privately. Sending to a transparent recipient makes the destination and amount public on Zcash. Both actions are signed by your wallet and require no bridge quote. ## Exchange ZEC for USDC Start a ZEC-to-0zkUSDC swap to receive USDC in Railgun on Ethereum. If you want regular USDC at a public Ethereum address, Veylor can withdraw from that private balance. The public testnet API also supports a direct public payout to its signing account. [Make a swap in the wallet](https://docs.veylor.cash/wallet/swaps/) · [Payout routes](https://docs.veylor.cash/protocol/#direct-payout-in-regular-usdc) # Receive, send and withdraw The sender’s asset determines which address to share. Both Ethereum receiving options can leave you with the same shielded balance in Veylor. ## Choose a receiving address | What the sender has | What to share | What arrives | | --- | --- | --- | | ZEC | Your Zcash receiving address for a shielded payment | ZEC in your Zcash wallet once the payment confirms and the wallet syncs. | | 0zkUSDC in another Railgun wallet | Choose **0zkUSDC** under **Receive** and share your `0zk` address. | A private USDC transfer within Railgun. | | Regular USDC on Ethereum | Choose **USDC** under **Receive** and share the displayed Ethereum `0x` deposit address. | A public deposit first. Veylor then shields eligible funds into your 0zkUSDC balance. | For a public USDC deposit, select **Ethereum** on the sending wallet or exchange. Check the minimum and fee shown in Veylor, then keep Veylor open and unlocked while it shields the deposit. The deposit address rotates after use. Get the current address from **Receive** for your next payment. [Receiving USDC in Veylor](https://veylor.cash/#paid) ## Pay another Railgun wallet Choose **Send** from your 0zkUSDC balance, enter the recipient’s `0zk` address, then review the amount and fee. The payment stays inside Railgun. A newly shielded deposit may need time to clear Railgun’s checks before it can be spent. ## Withdraw regular USDC Choose **Withdraw**, enter the recipient’s Ethereum `0x` address, and review the amount, network and fees. The recipient receives regular USDC. Its address and the withdrawn amount are visible on Ethereum. Withdrawing uses your Ethereum-side balance. To receive ZEC in your Zcash wallet, use a [reverse swap](https://docs.veylor.cash/wallet/swaps/#from-0zkusdc-to-zec). ![Veylor’s 0zkUSDC balance screen with Send, Withdraw, Receive and Bridge actions](https://veylor.cash/art/app-0zkusdc.webp) # Make a swap A swap exchanges one asset for the other. A forward swap sells shielded ZEC for USDC. A reverse swap spends 0zkUSDC to buy shielded ZEC. Check the direction, quoted amounts, fees and expiry before authorizing either. ## From ZEC to 0zkUSDC 1. Choose the direction from **ZEC to 0zkUSDC** and review the quote. If the maker asks for an opening fee, that separate ZEC payment is nonrefundable. 2. Authorize the swap. The maker locks the tokens on Ethereum. Your wallet checks the confirmed escrow before sending your shielded ZEC deposit. 3. Once the deposit confirms and the claim is available, the wallet can authorize the claim. With **auto-claim** enabled, the wallet can arrange this without a second prompt. Otherwise, return to the swap and authorize the claim in its window. 4. Follow the swap through payout. The USDC reaches your Railgun balance after the authorized relayer fee and applicable shielding fee. If you want regular USDC at a public address, choose **Withdraw** from that balance. [Withdraw regular USDC](https://docs.veylor.cash/wallet/transfers/#withdraw-regular-usdc) ## From 0zkUSDC to ZEC 1. Choose the direction from **0zkUSDC to ZEC** and review the maker’s quote. 2. The first authorization funds the Ethereum escrow from your Railgun balance. The maker then deposits shielded ZEC at the joint address. 3. Your wallet checks that the full quoted ZEC is confirmed and spendable. The second authorization marks the swap ready. Return to the wallet in time to complete it. 4. When the maker claims the tokens, your wallet obtains the remaining key share and moves the ZEC to a fresh shielded address you control. The Zcash transaction fee comes out of the amount swept home. ## Resume a swap If a connection drops, reopen the existing swap so the wallet can check both chains. A pending payout and a pending claim are different stages. Check the current stage before retrying a payment or starting another swap. [Deadlines and refunds](https://docs.veylor.cash/bridge/recovery/) · [Prices and fees](https://docs.veylor.cash/bridge/fees/) # Wallet downloads and release notes The releases page is the source for current installers, release notes, checksums and build records. Choose your platform there to see the latest version, or use **Browse versions** to find an older build. [Open wallet releases](https://veylor.cash/releases/) | Platform | Distribution | | --- | --- | | Android | Google Play or the direct APK. Keep the same distribution channel when updating an existing installation. | | Windows | Choose the x64 or ARM64 installer for your device. | | Linux | Choose the package for your architecture. Use the `.deb` on Ubuntu or Debian for 0zkUSDC support. | | iPhone | Join the TestFlight beta from the releases page. | | Mac | Coming soon. Availability is listed on the releases page. | ## Check the file you downloaded Under the matching release, find the exact filename. Compare its SHA-256 checksum and run the listed verification command when a build record is available. Android APKs also have a signing certificate to check. [Verify a wallet download](https://docs.veylor.cash/security/release-verification/) ## Read what changed Open **Release notes and checksums** for the version and platform you use. Each entry links its source revision and the upstream release, so you can review changes between versions. [Browse wallet versions](https://veylor.cash/releases/#versions) # Verify a wallet download Open the version you downloaded on the releases page. Match the **platform, version, architecture and filename**. Some releases reuse the same installer name. Each file row has its own SHA-256, and files with a build record have a verification command for that release. [Find your release](https://veylor.cash/releases/#versions) ## Check the file hash Run one of these commands from the folder containing your download. Substitute your actual filename. Compare the entire 64-character SHA-256 with the value for that file on the release page. Uppercase and lowercase digits represent the same hash. **Linux** · Example Debian package ```bash sha256sum veylor_0.9.4_amd64.deb ``` **macOS** · Example Android APK downloaded to a Mac ```bash shasum -a 256 veylor-1.0.6-14.apk ``` **Windows** · PowerShell, x64 installer ```powershell (Get-FileHash .\Veylor-windows-x64-Setup.exe -Algorithm SHA256).Hash ``` A match establishes that your file has the published bytes. To check who built those bytes and which source revision they used, verify the build record as well. ## Linux and Windows Under the file you downloaded, open **Verification commands** and run the build check with GitHub CLI. It verifies the file against a signed attestation and checks the repository, the platform’s workflow and the full source commit. For example, this command checks the x64 Debian package from Linux v0.9.4. [GitHub CLI](https://cli.github.com/) · [Linux v0.9.4](https://veylor.cash/releases/#v-linux-0.9.4) ```bash gh attestation verify veylor_0.9.4_amd64.deb --repo ChinmayGopal931/vizor-fork --signer-workflow ChinmayGopal931/vizor-fork/.github/workflows/veylor-linux.yml --source-digest a7d212d44da49735643ba3b9fc1200854e05fdec ``` A successful command exits with status zero. GitHub’s build record and Windows publisher signing are separate checks. The Windows v0.9.4 installers ship without an Authenticode publisher signature. Older entries labeled **No build record** offer checksum verification only. [Windows v0.9.4](https://veylor.cash/releases/#v-windows-0.9.4) · [GitHub verification options](https://cli.github.com/manual/gh_attestation_verify) ## Android For a direct APK, download the installable APK **and** the matching `-unsigned.apk` from the same release. The unsigned file is the build GitHub attests. Veylor signs the installable file afterward. The commands below use v1.0.6, build 14. [Android v1.0.6](https://veylor.cash/releases/#v-android-1.0.6) ### Check the APK signer Use `apksigner` from Android SDK Build Tools. Check that verification succeeds and compare the full value for `Signer #1 certificate SHA-256 digest` with the fingerprint below. [Android SDK Build Tools](https://developer.android.com/tools/apksigner) ```bash apksigner verify --print-certs veylor-1.0.6-14.apk ``` **Veylor direct-download certificate, SHA-256** ```text 83f16e2037b09e731e51b3472466db43c4a962ada1fb4e40eaa4c3215a2174f5 ``` You can cross-check the fingerprint in the release’s source tree. [Veylor’s Android signing instructions](https://github.com/ChinmayGopal931/vizor-fork/blob/a7d212d44da49735643ba3b9fc1200854e05fdec/docs/releases.md) ### Verify the unsigned build Use the command from its file row. For this version, the expected source commit is pinned below. ```bash gh attestation verify veylor-1.0.6-14-unsigned.apk --repo ChinmayGopal931/vizor-fork --signer-workflow ChinmayGopal931/vizor-fork/.github/workflows/veylor-android.yml --source-digest a7d212d44da49735643ba3b9fc1200854e05fdec ``` ### Compare the two APKs With `apksigner` and `apksigcopier` on your PATH, run the comparison. It must exit successfully. This checks that Veylor’s signing step preserved the contents of the attested APK. [apksigcopier](https://github.com/obfusk/apksigcopier) ```bash apksigcopier compare veylor-1.0.6-14.apk --unsigned veylor-1.0.6-14-unsigned.apk ``` For Google Play, update through the Veylor Play listing. The Play and direct-download channels use different signing certificates. If Android reports a signature conflict, keep your existing wallet installed and contact support. [Veylor on Google Play](https://play.google.com/store/apps/details?id=com.veylor.app) ## iPhone and Mac The releases page links to Veylor’s iPhone TestFlight beta and lists Mac availability. Use the channel shown for your platform. The downloadable wallet checks above apply to the files listed for Android, Linux and Windows. [Wallet releases](https://veylor.cash/releases/) ## Verify a build offline On a connected machine, use GitHub CLI to download the artifact’s attestation and obtain Sigstore’s trusted roots. The example uses the Linux v0.9.4 file from above. ```bash gh attestation download veylor_0.9.4_amd64.deb --repo ChinmayGopal931/vizor-fork gh attestation trusted-root > trusted_root.jsonl ``` Keep the trusted roots and expected commit from a trusted machine. Transfer the artifact, the bundle named by the download command, and the roots to the offline machine. Run the file’s build check there, adding `--bundle` and `--custom-trusted-root`. On Linux the bundle filename for this example contains the artifact’s SHA-256. ```bash gh attestation verify veylor_0.9.4_amd64.deb \ --repo ChinmayGopal931/vizor-fork \ --signer-workflow ChinmayGopal931/vizor-fork/.github/workflows/veylor-linux.yml \ --source-digest a7d212d44da49735643ba3b9fc1200854e05fdec \ --bundle sha256:008d6bd8bf757e792a4690b88e83ff4d176c72386ace6f0f81d4b51a2b90d1b3.jsonl \ --custom-trusted-root trusted_root.jsonl ``` An offline check uses the trust information you brought with you. Refresh the roots when preparing a new set of files. [GitHub’s offline verification guide](https://docs.github.com/en/actions/how-tos/secure-your-work/use-artifact-attestations/verify-attestations-offline) ## If a check fails Leave the file unopened. Confirm the filename, architecture and release tag, then download a fresh copy from the official release. If the hash, build verification or APK certificate still differs, report the platform, version, filename and failed check to Veylor. Keep your recovery phrase private. [Contact Veylor](https://veylor.cash/#support) # 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](https://veylor.cash/) ## 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](https://veylor.cash/how-it-works/#how) - **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](https://docs.veylor.cash/bridge/fees/) · [Claim and refund windows](https://docs.veylor.cash/bridge/recovery/) ## 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](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/README.md) 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](https://veylor.cash/privacy/) 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](https://docs.veylor.cash/bridge/recovery/) ## 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. 1. **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. 2. **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. 3. **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. 4. **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](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/crates/zecswap-client/src/user.rs) ## 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](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/crates/zecswap-client/src/user.rs#L267-L292) ## From 0zkUSDC to shielded ZEC 1. **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. 2. **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. 3. **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. 4. **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](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/docs/reverse-flow.md) ## 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](https://docs.veylor.cash/bridge/fees/) ## 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](https://docs.veylor.cash/bridge/recovery/) # What stays private? A Veylor swap touches two chains. The ZEC stays in Zcash’s shielded pool. Ethereum records the escrow and the token movements into or out of Railgun. The privacy of the final payment depends on its destination. | Activity | What an observer can see | | --- | --- | | Shielded ZEC deposit | The public Zcash chain records a shielded transaction. The maker has viewing information for the joint address so it can confirm that the agreed ZEC arrived. | | Ethereum escrow | The swap contract, token, escrow amount, timing and claim or refund activity are public. | | USDC into Railgun | The transfer into the pool is public. Inside Railgun, your private balance and transfers between `0zk` addresses are shielded. | | Public USDC payout or withdrawal | Ethereum records the destination `0x` address and amount. For a direct public bridge payout the signing account also appears on-chain. | ## What self-custody covers Your recovery phrase controls your wallet. The maker can verify a joint ZEC deposit and the relayer can submit the actions you sign. Neither needs your long-term spending keys. The swap still depends on timely chain confirmations and on the wallet following its claim or refund window. Public amounts and timing can allow an observer to correlate activity. Choosing a shielded payout changes what is visible after settlement. It cannot erase the Ethereum escrow history. [Wallet privacy policy](https://veylor.cash/privacy/) · [How atomic swaps work](https://docs.veylor.cash/protocol/) # Prices and fees Compare the amount leaving your spendable balance with the amount arriving in the destination wallet. `amount` is the gross token amount locked on Ethereum. `depositZat` is the ZEC or TAZ going into the joint address. One ZEC or TAZ has 100,000,000 zatoshis, and one USDC or tUSD has 1,000,000 token base units. ## What you pay on each route | Cost | When and how you pay | | --- | --- | | Maker’s quoted price | The two quoted amounts give the exchange rate. When the quote includes `networkCost`, it identifies the maker’s own gas and Zcash transaction costs already reflected in that price, expressed in token base units. You pay the quoted deposit once. | | Maker’s open fee | On the forward route only, `openFee.zat` is a separate shielded payment directly to the maker. Opening an escrow costs Ethereum gas before the maker receives ZEC. An abandoned open can also cost gas to cancel. Charging up front deters requests that impose those costs without a deposit. The fee is optional per quote and nonrefundable once paid, even if the quote expires or the maker never opens. Review its cap before paying. On the reverse route the user funds first. | | Relayer’s fee | On the shielded forward route, the relayer pays Ethereum gas to submit the claim and payout. The wallet authorizes its fee in token units, deducted from escrow before shielding. On a sponsored reverse route, `reverseFunding.fee` is a separate token payment for broadcasting the initial funding. The relayer sponsors reverse ready, and a reverse refund payout carries the authorized payout fee. | | Railgun fees | A shielded forward payout or reverse refund enters Railgun. Its shield fee can reduce the private balance below the amount sent to shield. Reverse funding leaves Railgun, so the wallet must also cover the unshield fee. | | Your Zcash transaction fees | Budget for the forward ZEC deposit and, if required, the separate open-fee payment. A reverse receive sweep or forward refund sweep also uses a Zcash transaction and pays a network fee. | ## Read the net amount For a shielded forward quote, add the Zcash deposit, any opening fee and the Zcash transaction fees to estimate your total ZEC spend. On the Ethereum side, subtract the authorized relayer fee from the gross token amount, then account for Railgun’s shielding fee. For example, a gross **1 tUSD** testnet payout with a **0.1 tUSD** relayer fee sends **0.9 tUSD** into the shielding step. The live quote and terms supply the actual amounts. A direct public payout uses the signing account’s ETH for gas and skips those two token deductions. In the reverse direction, budget for unshielding, any quoted funding fee, and the Zcash sweep fee on the received deposit. [Preview a testnet quote](https://docs.veylor.cash/quickstart/#preview-a-quote) ## If the swap expires or refunds The open fee is the amount you entrust to the maker before seeing the forward escrow. Set a limit on it separately from the relayer fee. For current amounts, use the quote, the relayer’s terms and the wallet’s own transaction estimate. [Wallet quote fields](https://github.com/ChinmayGopal931/vizor-fork/blob/d2a6430e9cfac488dc685c4b13cd62a591908ad9/rust/src/wallet/private_usd/models.rs#L195-L221) · [Open fee protocol](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/docs/open-fee.md) · [Railgun payout vault](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/contracts/src/ShieldVault.sol) # Deadlines and refunds The contract uses Ethereum block time. **`t0`** is the deadline for marking a swap ready. **`t1`** is the end of the ordinary claim window. The quote’s expiry and the reverse funding deadline come earlier in the process. Use the deadlines and late-window length for the deployment that holds your swap. The table applies while the escrow is unsettled. [Settlement contract](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/contracts/src/ZecSwap.sol#L504-L524) | If a swap stalls | What the wallet can do | | --- | --- | | Forward, before `t0` | If ready, the user can claim. If the deposit is missing or short and the swap is still unready, the maker can cancel. Cancellation reveals the maker’s share, so the wallet can sweep back any ZEC it sent. | | Forward, from `t0` until `t1` | The user can claim even if the maker went offline before marking ready. | | Forward, from `t1` | Only the maker can refund during the contract’s late window. A refund releases its share for the wallet to recover the ZEC. If the window ends with the escrow still open or ready, the user can claim again. | | Reverse, still unready | The user can refund. An unready reverse escrow stays refundable even after `t0`. If the wallet already signed ready, it waits until that authorization can no longer land, then checks the chain before requesting a refund. | | Reverse, already ready | The maker has until `t1` to claim. From `t1` onward the user can refund an unclaimed escrow. The refund reveals the user’s share so the maker can recover any ZEC it deposited. A separate payout shields the tokens into the user’s committed refund note. | ## Resume after an interruption If the app closes or a request times out, resume with the same wallet and saved swap. Check the recorded transactions and current chain state before retrying a payment. A submitted transaction can still confirm after a timeout. If a claim or refund settled but shielding failed, retry the payout. If Railgun returned the tokens to the swap’s vault, the wallet can authorize a rescue to shield them again. [Recovery and persistence](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/docs/reverse-flow.md#waiting-cancellation-and-recovery) # Testnet quickstart Get a quote for selling testnet ZEC (TAZ) for test dollars (tUSD) on Ethereum Sepolia, then complete one shielded swap using the reference wallet. You can stop after the quote without creating a wallet or paying a fee. The example pays shielded tUSD to your Railgun balance. For a public tUSD payout, the API also supports an Ethereum account that pays its own Sepolia gas. [Payout routes](https://docs.veylor.cash/protocol/#direct-payout-in-regular-usdc) The public mainnet API is coming soon. All commands below use test assets. ## Connect to testnet First identify both services. The maker offers the exchange and locks its tokens on Sepolia. The relayer submits the Ethereum claim and shielded payout your wallet authorizes. The public gateway is `https://api-testnet.veylor.cash`. Use `/maker` for quotes and `/relayer` for fees and settlement. Discovery and quotes are public. Keep the wallet seed and swap state on the machine running the CLI. For discovery and a quote, you only need Bash, curl and jq. Run these snippets in the same shell so later steps can use the values you set here. ```bash set -euo pipefail export ZECSWAP_MAKER_URL=https://api-testnet.veylor.cash/maker export ZECSWAP_RELAYER_URL=https://api-testnet.veylor.cash/relayer export EVM_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com export ZECSWAP_CONTRACT=0x62ce626c5a30528b8ee33145d491785082a6cf8a export ZECSWAP_TOKEN=0x64c4a5cb09fe0b706d4cf24dc0a45fff275d727c info=$(curl -fsS "$ZECSWAP_MAKER_URL/v1/info") terms=$(curl -fsS "$ZECSWAP_RELAYER_URL/v1/terms") jq -e --arg c "$ZECSWAP_CONTRACT" --arg t "$ZECSWAP_TOKEN" ' .apiVersion == 1 and .zcashNetwork == "testnet" and .chainId == 11155111 and .contract == $c and .token == $t ' <<< "$info" jq -e --arg c "$ZECSWAP_CONTRACT" ' .chainId == 11155111 and .contract == $c ' <<< "$terms" ``` Both checks must print `true` before you continue. They catch a service pointing at a different network or contract before your wallet creates a payment. The pinned addresses identify this testnet deployment. Stop on a mismatch and check for a deployment update. [Sepolia swap contract](https://sepolia.etherscan.io/address/0x62ce626c5a30528b8ee33145d491785082a6cf8a) · [Sepolia tUSD token](https://sepolia.etherscan.io/token/0x64c4a5cb09fe0b706d4cf24dc0a45fff275d727c) ## Preview a quote A quote tells you how much TAZ you would spend and how much tUSD is available before the relayer’s fee. Asking for one does not open an escrow. This example uses a nonzero placeholder payout address for a disposable quote. Leave that quote to expire. The CLI requests a fresh quote bound to its own payout when you run a swap. ```bash units=1000000 quote=$(curl -fsS -H 'Content-Type: application/json' \ --data "{\"units\":$units,\"payout\":\"0x0000000000000000000000000000000000000001\"}" \ "$ZECSWAP_MAKER_URL/v1/quote") jq '{amount, depositZat, openFeeZat: (.openFee.zat // 0), expiresAt}' <<< "$quote" jq '{fee, feeExpiresAt}' <<< "$terms" ``` | Field | How to read it | | --- | --- | | `units` | Number of maker denominations. Read the resulting token amount from the quote. | | `amount` | Gross tUSD payout as a decimal string in base units. 1,000,000 base units = 1 tUSD. | | `depositZat` | Shielded TAZ required for the swap. 100,000,000 zatoshis = 1 TAZ. | | `openFee.zat` | Optional, nonrefundable TAZ fee paid to the maker before opening. Budget it separately from the deposit and Zcash transaction fees. | | `networkCost` | Optional cost component already reflected in the quoted price. Use `depositZat` as quoted. | | `fee` | Relayer fee in token base units, deducted from the payout. It must be below the gross amount. | | `expiresAt`, `feeExpiresAt` | Unix times in seconds. Refresh the quote or terms after expiry. | **Reading the numbers.** If `amount` is `"1000000"` and the relayer’s `fee` is `"100000"`, the amount sent to Railgun for shielding would be 900,000 base units, or **0.9 tUSD**. Railgun’s shield fee may reduce the final private balance. On Zcash, budget the quoted `depositZat`, any separate `openFee.zat`, and the wallet’s transaction fees. Your live quote supplies the actual amounts. ## Fund a test wallet To go beyond a quote, install Git, rustup and a native C/C++ build toolchain on Linux or macOS. Build the public CLI from the revision used by this guide. `init` creates the wallet and prints its Zcash testnet address. Run it once per wallet. ```bash git clone https://github.com/ChinmayGopal931/zecSwap.git cd zecSwap git checkout --detach 2470b7cf535185e837bfe5af5e641ea2c964a23f cargo build --locked -p zecswap-cli cli="$PWD/target/debug/zecswap-cli" umask 077 export ZECSWAP_CLI_DIR="$HOME/.veylor/bridge-testnet" "$cli" --network testnet init ``` Send TAZ to the printed address from another test wallet or a testnet faucet. Wait for the spendable balance to cover the quoted deposit, the open fee, and Zcash transaction fees. [Valar testnet faucet](https://faucet.testnet.valargroup.dev/) ```bash "$cli" --network testnet status ``` ## Run a shielded swap Use the same wallet directory for the whole swap. The example caps the open fee at 20,000 zatoshis and the relayer fee at 100,000 token base units (0.1 tUSD). Check the fresh terms against your budget before starting. Starting this command authorizes the wallet to spend test funds. It takes a fresh quote and can pay the nonrefundable open fee immediately. The flags cap the two fees. For an integration with a hard maximum total TAZ spend or minimum net payout, check those limits on the actual quote before paying or accepting. ```bash terms=$(curl -fsS "$ZECSWAP_RELAYER_URL/v1/terms") jq -e --argjson amount "$(jq -r .amount <<< "$quote")" ' (.fee | tonumber) as $fee | $fee <= 100000 and $fee < $amount and .feeExpiresAt > now ' <<< "$terms" "$cli" --network testnet swap --units "$units" \ --relayer "$ZECSWAP_RELAYER_URL" \ --max-open-fee 20000 --max-fee 100000 ``` After the maker opens escrow, the CLI reads the locked tokens and payout terms from Sepolia. Only then does it send the quoted TAZ deposit to the joint shielded address. Once the deposit is confirmed and the claim is allowed, the relayer submits the wallet’s authorization and shields the net tUSD payout. A successful payout prints `claimed; shielded … into …` with the amount sent for shielding and the destination. A cancellation or refund has its own output. A successful process exit alone does not identify which outcome occurred. Run one swap at a time per wallet directory. If interrupted, restore the same settings and rerun the swap command with the same directory to resume an **unfinished** swap. Running it again after completion starts another swap. Preserve the seed, wallet database, and swap state together. # Bridge API reference The public testnet gateway is `https://api-testnet.veylor.cash`. It serves the maker and relayer routes below. An HTTP quote is enough to preview a price. A wallet is needed to authorize a swap, verify escrow on Ethereum, create a shielded Zcash payment and recover it if the swap refunds. The public mainnet API is coming soon. For a first request and sample fee calculation, follow the [testnet quickstart](https://docs.veylor.cash/quickstart/). ## Forward API reference Use these routes for shielded TAZ to Sepolia tUSD. Append each path to the gateway URL. POST requests use JSON. For a custom wallet, use the public Rust client to construct proofs, check the contract and determine when to reveal the user share. | Method and path | Purpose | | --- | --- | | `GET /maker/v1/info` | Read the Zcash network, chain ID, swap contract and token. | | `GET /relayer/v1/terms` | Read the relayer address, fee and expiry for this deployment. | | `POST /maker/v1/quote` | Send `units` and a nonzero Ethereum `payout`. A shielded payout also binds the wallet-generated `payoutNote`. | | `POST /maker/v1/quote/{quoteId}/accept` | Send the wallet’s `userShare`, `userProof` and `viewingKeys`. Save the returned `swapId`, deadlines and `ticket` before depositing. | | `POST /relayer/v1/claim` | Submit the claim prepared by the client when the contract permits it. Send the accepted swap’s `ZecSwap-Ticket` header. | | `POST /relayer/v1/payout` | Submit the client’s signed payout and shield data for a claimed swap, with the same ticket. | Choose the payout route **before requesting the quote**. For shielded tUSD, use `Route::Railgun` with the wallet-generated note and a relayer fee limit. For regular tUSD, use `Route::Account` with a signing Ethereum connection. Set `payout` to that signer’s address and omit `payoutNote`. The signer pays Sepolia ETH for the on-chain claim and withdrawal. The two relayer POST endpoints in the table apply only to the shielded route. [Reference CLI route selection](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/crates/zecswap-cli/src/swap.rs#L115-L132) On `402 feeRequired` after broadcasting the open fee, wait for the existing payment to be mined and retry the same acceptance after `Retry-After`. On `503`, respect `Retry-After` when supplied. Keep the original state across retries so a timeout cannot trigger a second payment. ## Reverse API reference For Sepolia tUSD to shielded TAZ, check `reverseEnabled` in maker info. A wallet with a funded Railgun balance authorizes escrow first, then authorizes settlement after observing the Zcash deposit. The quickstart CLI’s `swap` command runs the forward direction. For reverse swaps use a wallet integration with the public reverse client. [Reverse client](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/crates/zecswap-client/src/reverse.rs) | Method and path | Purpose | | --- | --- | | `POST /maker/v1/reverse/quote` | Request terms with `units`, the wallet’s swap authorization address (`user`) and its committed `refundNote`. | | `POST /maker/v1/reverse/quote/{quoteId}/accept` | Accept the checked quote. Persist the swap and set up the local Zcash account that will watch for the joint deposit before funding. | | `POST /relayer/v1/reverse/fund` | When reverse funding is offered in relayer terms, submit the wallet’s prepared Railgun funding transaction. Confirm escrow on Sepolia. | | `GET /maker/v1/reverse/swaps/{swapId}` | Read progress. The wallet independently scans Zcash for the full spendable deposit. | | `POST /relayer/v1/reverse/ready` | Submit the wallet’s second authorization after it has verified that deposit. Follow the maker’s claim, then sweep the ZEC home. | | `POST /relayer/v1/reverse/refund` and `POST /relayer/v1/reverse/refund-payout` | Recover eligible escrow and return tokens to the committed Railgun refund note. Use the client to check the contract state and deadlines first. | The protocol guide explains when each side can claim or refund. Use the public wire types when constructing a request for a particular swap. [Reverse request types](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/crates/zecswap-api/src/reverse.rs) · [Reverse flow](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/docs/reverse-flow.md) ## Build a wallet integration A quote-only tool needs the discovery, terms and quote endpoints above. For an agent that spends TAZ, run the CLI with a persistent wallet directory or integrate the Rust client into your wallet. The gateway handles quoting and relaying. Your wallet holds the keys, builds the proofs, broadcasts the Zcash payments and follows the swap on Sepolia. | Integration step | Reference client behavior | | --- | --- | | Configure a wallet for a shielded payout | Construct `User` with `Network::Testnet`, `Settlement::read_only`, the pinned token, and `Route::Railgun` with your relayer fee cap. Set the maker fee cap with `with_max_open_fee`. | | Quote and budget | Reserve a fresh wallet swap index. `User::quote(index, units)` checks the deployment and maker proof and binds the payout to the wallet. Apply your spend limit to this quote’s `depositZat` and fees before paying. Parse token amounts and fees as integer base units. | | Open the swap | Persist the index and `Quoted` together. If `Quoted::fee_due` returns a fee, save the prepared payment’s transaction ID before broadcasting and wait for it to be mined. Call `User::accept` and persist the returned `UserSwap`. | | Fund and settle | `User::verify` checks the opened swap and returns the joint account. Save the deposit transaction ID before broadcasting. Follow `User::state` on Sepolia. Use `User::claim` for settlement and `User::refund_key` to recover a deposited balance after an on-chain refund. | - The CLI’s working implementation covers swap-index allocation, payment persistence, resuming and sweeping a refund. [Forward swap driver](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/crates/zecswap-cli/src/swap.rs) - The Rust client implements the wallet checks, proof construction, claim windows and payout confirmation. [Wallet client](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/crates/zecswap-client/src/user.rs) - The wire types define the JSON field names, integer encodings, proofs and payout signatures. [Maker types](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/crates/zecswap-api/src/lib.rs) · [Relayer types](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/crates/zecswap-api/src/relayer.rs) - The protocol describes fee address validation, quote expiry and retrying an acceptance after payment. [Open fee protocol](https://github.com/ChinmayGopal931/zecSwap/blob/2470b7cf535185e837bfe5af5e641ea2c964a23f/docs/open-fee.md) # Using Veylor with agents Give an agent Veylor’s documentation before asking it to build a wallet integration or fetch a quote. The public API runs on Zcash testnet and Ethereum Sepolia. The public mainnet API is coming soon. ## Load the documentation [Open llm.txt](https://docs.veylor.cash/llm.txt) The single Markdown file contains the wallet guides, supported payout routes, swap protocol, fees, refund rules, testnet quickstart and API reference. It is generated with the website. Give a web-enabled agent the URL, or save the file and attach it as context in your coding assistant. ```bash curl -fsSL https://docs.veylor.cash/llm.txt -o veylor-docs.md ``` ## Ask for a quote first This is a first task you can paste into an agent with HTTP access. It reads deployment data and requests a disposable quote. It requires no wallet or test funds. ```text Read https://docs.veylor.cash/llm.txt. On Veylor testnet, preview one forward quote with units=1000000, as in the quickstart. I want to swap TAZ for shielded Sepolia tUSD. Verify the network, contract and token against the quickstart. Report the TAZ deposit, any separate nonrefundable open fee, the gross tUSD, the relayer fee, the tUSD left for shielding, and when the quote and fee expire. Explain which costs could still change the final balance. Stop after the quote. Do not accept it, sign anything or send funds. ``` Check that the answer identifies **TAZ**, **Sepolia tUSD** and the quote expiry. The deposit and opening fee are separate amounts in zatoshis. A relayer quote is in token base units. The amount left for shielding can still be reduced by Railgun’s fee. [Read a quote](https://docs.veylor.cash/quickstart/#preview-a-quote) ## Move from a quote to an integration Decide whether the user wants a Railgun payout or regular tokens at a public address before requesting an executable quote. Have the wallet verify the escrow itself, enforce the user’s fee and spend limits, and persist state before broadcasting each payment. A funded run requires authorization to spend test assets. Keep seed phrases and signing keys in the local wallet, outside prompts and API requests. [API reference](https://docs.veylor.cash/api/) · [Recovery after an interruption](https://docs.veylor.cash/bridge/recovery/)