Offshift Dev Update Late September 2022: Relayer Integrations
Offshift Core is pleased to announce the newest release of Offshift anon following a successful relayer integration process. Integrating relayers marks a major milestone for the Offshift anon protocol, as relayers play an indispensable role in enabling users to maintain anonymity after Shifting with Offshift anon.
Completing relayer integrations also brings Offshift Core to the final stage of the Offshift anon Roadmap to Testnet: the feature-complete Testnet release slated for October.
Breaking Down Offshift anon Relayers: Composition, Role, & Functionality
Now, let’s break down what relayers will be doing for users on Offshift anon, and why they play such an important role in the protocol. In the mission to bring privacy to Ethereum Layer 1, Offshift anon and its native anonAssets will run and live on Ethereum. As such, users interacting with Offshift anon and anonAssets must maintain sufficient ETH balances in their wallets at all times in order to conduct further transactions on the network. Without additional support from the protocol, a mandatory ETH balance imposes practical challenges for users attempting to remain anonymous.
A relayer broadly describes an entity or piece of software that transfers information between parties. In the context of a blockchain-based application, a relayer traditionally submits user transactions to a blockchain network – say, Ethereum – and pays the associated gas fee on behalf of the user.
The Role of Relayers in Offshift anon
Users seeking to restore their anonymity via Offshfit anon will conduct a Shift by burning either XFT or existing anonAssets in order to mint new anonAssets to a fresh Ethereum address. However, in order to access their newly minted anonAssets – whether to provide liquidity, execute a trade, or even conduct a Simple Shift back to XFT – users must first fund their fresh address with sufficient ETH to pay for gas.
Naturally, that funding process invariably links a user’s fresh address to his or her existing wallet address(es), transaction history, asset balance(s), and potentially personal or sensitive information. Simply put, the process of funding a fresh address threatens to compromise user anonymity, and therefore establishes a strong demand for a solution that can supply users with ETH such that they may begin using their freshly minted anonAssets as fully anonymous network participants.
On Offshift anon, relayers satisfy this demand by acting as decentralized intermediaries that exchange assets between existing addresses from which XFT or existing anonAssets are burned and fresh addresses where newly minted anonAssets are designated to be sent.
When a user burns XFT or existing anonAssets, a relayer takes a predetermined portion of the user’s newly minted anonAssets as a fee, and sends an equal value in ETH along with the remaining balance of anonAssets to the user’s fresh Ethereum address. At this stage, the user is free to access, stake, transfer, or Shift his or her anonAssets, and has the necessary ETH balance to do so with anonymity intact. 1
Of course, the process is substantially more technical than that. For those interested in getting granular, here’s what’s going on under the hood.
Breaking Down the Tech: Relayers, Deposit Notes, and Decryption
The process begins with the storage of the encrypted deposit note. When a user makes a deposit, there is a client-side password generation process that randomly generates a 32-byte password. Once that password is chosen, the raw deposit note is encrypted using a one-time pad – an unbreakable encryption technique that employs a single-use, pre-shared key which is at least as large as the message being sent (in this case, the deposit note).
This encrypted string is given as a second argument in the deposit function when a user executes his or her deposit. The storage contract holds a mapping from a deposit address to an array of encrypted notes, and when it comes time to execute a withdrawal, the encrypted note is retrieved by giving the storage contact a deposit address and the index of the deposit.2
Then, the encrypted note is decrypted using the same process (the one-time pad) and the note is parsed into its respective components and fed into the SNARK proof generation process.
The relayer enters the process when the user begins the withdrawal process. At this point, the user executes the above decryption process using a valid password and unspent deposit, and uses them to generate a SNARK proof locally with specified public and private parameters. Once a valid proof is generated, the raw transaction is sent to the relayer using an
http post request.
The relayer signs and submits the transaction on behalf of the user executing the withdrawal, and the transaction hash is returned to the user as the response to the post request. Here, The relayer takes a predetermined portion of the freshly minted aUSD as a fee and sends the rest to the address given as the recipient in the transaction.
Ready to try the latest release of anon? Just follow the Offshift anon Guide below.
Have questions, comments, or ideas of your own about Offshift anon’s Relayer Integrations, the rest of the development process, or the platform in general? Perfect!
Offshift Core is holding our September PriFi AMA on Thursday, September 29 at 12pm ET. Send in your questions via our submission link, and tune in live on YouTube to get them answered during the AMA. As always, we’ll be giving out 100 XFT to the individuals that send in the 3 best submissions!
Offshift anon Guide
1. Create a new Ethereum wallet in MetaMask that you will use exclusively for the Offshift anon pilot.
2. Navigate to the Goerli PoW Faucet, copy/paste your new wallet address, complete the Captcha, and click the green “Start Mining” button. Leave this window open, and you can complete the next steps while you mine some GöETH.
3. Next, let’s go ahead and add the two testnet tokens you’ll be interacting with, XFTMock and aUSDMock, to MetaMask. Open MetaMask and make sure you have Goerli Test Network selected in the Networks drop-down menu at top.
From here, click “Import tokens.”
Paste the XFTMock address below into the “Token Contract Address” field. Once Token Symbol and Token Decimal fields auto-fill, click “Add Custom Token.” Repeat for aUSDMock using the address below.
4. Navigate back to your open Goerli PoW Faucet window. Make sure “Your Mining Reward” is at least 0.5 GöETH, then click the red “Stop Mining & Claim Rewards” button.
5. Next, let’s swap some of your freshly mined Goerli ETH for some testnet XFT. Navigate to Uniswap’s Goerli Swap Page.
Click “Select token.”
Paste in the XFTMock address above, and then import the token.
Swap for at least 20 XFTM.
6. With GöETH and XFTM in your wallet, navigate to the Offshift anon Frontend.
Click “Connect wallet.”
Choose MetaMask, select your wallet, and click “Connect.”
7. First, you’ll need to give the frontend permission to spend your testnet XFT. For this version of the Offshift anon Pilot, the dashboard will burn the XFT equivalent required to create a note that is redeemable for 10 aUSD. As noted above, the rate is determined via oracle price feed from the Goerli Uniswap pools.
With the Burn and Mint amounts populated, click Approve, and then confirm the transaction in MetaMask.
8. When the transaction is confirmed, click Shift and confirm in MetaMask.
9. When the transaction is confirmed, your XFT balance will change, accounting for the number of XFT you burned to create a deposit note. To redeem the note and mint aUSD, click Withdraw, and then confirm in MetaMask.
Your aUSD balance will now show 9, as 1 aUSD was used to pay the relayer for its service.
10. To Shift from aUSD back to XFT, first shift once more from XFT to aUSD so that your aUSD balance is greater than 10, then click the toggle button to move aUSD to the top and XFT to the bottom. Click Simple Shift, and confirm in MetaMask.
Thanks for trying the Offshift anon Pilot!
In this version, relayers do not yet conduct an exchange into ETH. As of now, they only carry out the deposit and withdrawal functions for anonAssets (aUSD, as per the testnet), and do not conduct exchanges into ETH. Complete relayer functionality will be integrated for the feature-complete testnet release in October. ↩︎
For those getting their hands dirty exploring the Pilot, you will notice in the current version that the interface fetches the most recent deposit for a given depositing address. ↩︎