![Offshift Logo](./assets/logo-2.png) ---- Read The Offshift Yellowpaper [here](https://offshift.io/content/Yellowpaper.pdf). ---- Offshift provides a private derivatives platform that supports the following functions: * [Shifting](#Shifting) - Convert XFT to zkAssets, which are the confidential tokens that enable anonymous transactions. * [Staking](#Staking) - Provide XFT liquidity on SushiSwap and/or PancakeSwap and earn rewards on your tokens. * [Bridging](#Bridging) - Move XFT between Ethereum (ERC-20) and Binance Smart Chain (BEP-20). ## Benefits Our shifting, staking and bridging functions can lead to the following benefits for users: * Anonymity - Anonymous transactions on multiple blockchains. * Zero Knowledge Assets - Private derivatives with prices pegged to any asset with a market and a price feed. * Rewards - Rewards paid in XFT and SUSHI on SushiSwap, and rewards paid in XFT on PancakeSwap, for providing liquidity to the pool. ## Implementation We currently support staking LP tokens on Ethereum and Binance Smart Chain, and shifting on both the Ethereum and Moonbeam Testnets. This repo includes the following resources: * [Ethereum](./Ethereum)- Backend scripts and a frontend UI for shifting on Ethereum's Rinkeby Testnet, and backend scripts and a frontend UI for staking SushiSwap LP tokens on the Ethereum mainnet. * [Moonbeam](./Moonbeam)- Backend scripts and a frontend UI for shifting on the Moonbase Alpha testnet. * [BSC](./BSC) - Backend contracts and a frontend UI for staking PancakeSwap LP tokens on Binance Smart Chain. * [Confidential Tokens](./Confidential_Tokens) - Detailed analysis of our approach to confidential contracts. See the README file for the specific component you are implementing for installation and configuration details. ## Support For support, contact us on [Telegram](https://t.me/OffshiftXFT) or [Discord](https://discord.gg/vkXQ3wW84w). Our team monitors these channels and will respond to your questions as fast as possible. ## Additional Resources We provide our own front ends for obtaining test assets, shifting, staking and bridging: * [Ethereum xftT Faucet](https://offshift.io/xftT-faucet.html#) - Obtain test XFT that you can use to develop your Ethereum-based application. * [Ethereum Shifting UI](https://offshift.io/xftT-shift.html#) - Burn XFT to create zkAssets with the price pegged to one of several existing underlying assets. * [Ethereum Shifting CLI scripts](https://open.offshift.io/offshiftXFT/protocol-main/-/tree/master/Ethereum/Shifting/frontend/scripts) - Use the Offshift dapp in the CLI without the need of a web browser. * [Moonbeam xftT Faucet](https://offshift.io/moonbeam-faucet.html#) - Obtain test XFT that you can use to develop applications on Moonbeam, which supports interoperability between the Polkadot and Ethereum blockchains. * [Moonbeam Shifting UI](https://offshift.io/moonbeam-shift.html#) - Shift between XFT and zkAssets that can be transferred on Polkadot and Ethereum. * [Moonbeam Shifting CLI scripts](https://open.offshift.io/offshiftXFT/protocol-main/-/tree/master/Moonbeam/Shifting/frontend/scripts) - Use the Offshift dapp in the CLI without the need of a web browser. * [Offshift SushiSwap Staking Dashboard](https://dashboard.offshift.io/stake-now) - Supply liquidity for XFT on SushiSwap to earn XFT and SUSHI tokens. * [Offshift ETH<>BSC Bridge Dashboard](https://offshift.io/bridge/) - Move XFT tokens between Ethereum and Binance Smart Chain. * [Offshift PancakeSwap Staking Dashboard](https://offshift.io/stake/) - Supply liquidity for XFT on PancakeSwap to earn XFT tokens. See our articles on the Offshift Blog for detailed, step-by-step descriptions of shifting, staking and bridging using our dashboards with MetaMask: * [Shifting on Ethereum Testnet](https://offshift.io/public/blog/2020-09-30-offshift-testnet-guide-phase-two/) * [Shifting on Moonbeam Testnet](https://offshift.io/public/blog/2021-01-04-offshift-testnet-guide-moonbase-alpha/) * [Staking LP tokens on SushiSwap](https://offshift.io/public/blog/2021-03-19-offshift-sushiswap-dual-liquidity-mining-goes-live/) * [Staking LP tokens PancakeSwap](https://offshift.io/public/blog/2021-07-15-offshift-lists-xft-on-pancakeswap-launches-pancake-lp-rewards-bolsters-lp-rewards-on-sushiswap/) * [Bridging between ETH and BSC](https://offshift.io/public/blog/2021-05-27-offshift-eth-bsc-bridge-goes-live-on-mainnet/) The sections below provide an overview of how to use our [shifting](#shifting), [staking](#staking) and [bridging](#bridging) tools. By using the code in this repository, you can add the functionality described below to your own application. ## Shifting Shifting converts XFT to zkAssets and vice versa. zkAssets are private synthetic derivatives that can be anonymously transferred on the Ethereum blockchain. The value of a zkAsset is pegged to the price of any asset with a market and an available price feed. When you mint a zkAsset by shifting from XFT, you choose the underlying asset that sets the price of the zkAsset. This repo includes resources for using the shifting tool in two different ways: * Website - Use our prebuilt web apps and MetaMask to obtain test tokens and convert XFT to zkAssets. * Scripts - Use our backend scripts to shift tokens using the command line. The README files in the [Ethereum](./Ethereum) and [Moonbeam](./Moonbeam) directories provide more details about installing and running the shifting scripts. The steps below provide an overview of how to use our shifting resources with the website frontend. 1. Set up MetaMask and obtain test tokens. You will need Rinkeby ETH and XFT Test Assests (xftT) to test shifting. 1. In MetaMask, select the Rinkeby Test Network and obtain Rinkeby ETH from the [Rinkeby faucet](https://faucet.rinkeby.io/). 2. Use the token addresses below to add the Offshift test tokens to MetaMask: * xftT - 0x1190fb1b00d20656549cdff689e55d072ba764f3 * zkB - 0x0e1bff82509994170026f47f1d0857fb275c3003 2. Install the backend scripts. See the [Ethereum](./Ethereum) or [Moonbeam](./Moonbeam) README files for details. 3. Open the `faucet.html` file in the `frontend/website` directory and follow the prompts to connect MetaMask to the app. 4. Click the xftT(testnet) Faucet button and follow the instructions in MetaMask to obtain xftT that you can use to perform a test shift. 5. Open the `shift.html` file in the `frontend/website` directory. 6. In the first dropdown menu, select XFT. This is the asset that you will burn to mint zkB. 7. In the second dropdown, select the underlying asset that will set the price for the zkB that you are about to mint. For example, if you select BTC, you will mint zkBTC, which is a zkAsset price-pegged to BTC. 8. Click the Approve button. 9. Follow the prompts in MetaMask and the shifting UI to complete the shift. 10. MetaMask will notify you when the transaction is complete, and your asset balance will update to show an amount of zkB. ## Staking Staking provides a way for users holding XFT to earn rewards for providing liquidity on either SushiSwap or PancakeSwap. #### Staking on SushiSwap Before staking, you must have equal amounts (in USD) of XFT and ETH in your wallet. The steps below provide an overview of how to use our staking resources. The README file in the [Ethereum](./Ethereum) directory provides more details about installing and running the scripts: 1. Use the [SushiSwap Add Liquidity XFT-ETH page](https://app.sushi.com/add/0xabe580e7ee158da464b51ee1a83ac0289622e6be/ETH) to exchange XFT and ETH for SushiSwap Liquidity Pool (SLP) tokens. 2. Clone this repository and add the files to your project. 3. Install the dependencies. 4. Start the server. 5. Open [`http://localhost:4200/`](http://localhost:4200/) in your web browser to launch the staking dashboard. 6. Follow the onscreen prompts or see the [staking] information at the root of this repository to connect to your MetaMask wallet and stake the SLP you obtained in step 1. 7. Rewards accrue every block and are paid in XFT and SUSHI. Claim your rewards in the Rewards tab on the staking dashboard. #### Staking on PancakeSwap Before staking, you must have equal amounts (in USD) of (BEP-20) XFT and BNB in your wallet. To bridge ERC-20 XFT on Ethereum to BEP-20 XFT on Binance Smart Chain, see [Bridging](#Bridging). The steps below provide an overview of how to use our staking resources. The README file in the [BSC](./BSC) directory provides more details. 1. Use the [PancakeSwap Add Liquidity XFT-BNB page](https://exchange.pancakeswap.finance/#/add/0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c/0xe138c66982fd5c890c60b94fdba1747faf092c20) to exchange XFT and BNB for PancakeSwap Liquidity tokens (Cake-LP). 2. Open the [PancakeSwap Staking Dashboard](https://offshift.io/stake/) to stake and unstake your Cake-LP. 3. Rewards accrue every block and are paid in XFT. Claim your rewards in the Rewards tab on the staking dashboard. ## Bridging XFT can be moved between Ethereum (ERC-20) and Binance Smart Chain (BEP-20) using the [Offshift ETH<>BSC Bridge](https://offshift.io/bridge/). Step-by-step [bridging instructions](https://offshift.io/public/blog/2021-05-27-offshift-eth-bsc-bridge-goes-live-on-mainnet/) can be found on the Offshift Blog.