How to Create Bridges and Assistants on Counterstake for Cross-Chain Transfers (and Rewards)

How to Create Bridges and Assistants on Counterstake for Cross-Chain Transfers (and Rewards)

Counterstake is your portal between Obyte and external networks, like Ethereum or Binance Smart Chain. It’s user-friendly, decentralized, and truly community-owned. What we may tend to overlook is that moving assets from one chain to another (e.g., USDC from Ethereum to Obyte) involves little effort and time thanks to the assistants and existing bridges. And anyone can set up one of those, too —and be rewarded for it.On Counterstake, users must lock their own assets while an equivalent amount of the same token is claimed on the foreign chain. After this, for security purposes, there’s a challenging period of three days (minimum) in which challengers can dispute fraudulent claims by staking their own funds. Since waiting three whole days to exchange your assets is inconvenient, we have assistants. An assistant claims a transfer and pays the user immediately, minus a reward. The assistant then waits through the challenging period before withdrawing the claimed funds. In other words, the assistant temporarily provides liquidity while taking on the risk that the transfer could be challenged. If that happens, the assistant stakes again to protect the claim. Finally, they receive a reward for handling the transfer, initially set at 1% of the whole amount. Let’s see how to become an assistant on Counterstake, and how to create new bridges. Set Up an Assistant You’ll need to code a bit for this one. An assistant on Counterstake is a bot that you need to set up from GitHub and keep online 24/7. Start by installing Node.js 12+ and cloning the official ‘counterstake-bridge’ repository, then install its dependencies with yarn. After launching the bot, it displays addresses for Obyte, Ethereum, and BSC. Fund these addresses with the native coins and tokens users are expected to transfer. You also need to send imported tokens (brought from another chain) to the bot so it can pay users on the destination chain. If you already have these tokens, you can send them directly to the bot. Otherwise, you can obtain them through Counterstake – in this case, funds become available after the default three-day challenging period. The bot can assist transfers and monitor them for fraudulent claims or challenges. You can configure settings such as the minimum reward, maximum risk exposure, and transfer confirmation time. Set ‘control_addresses’ to authorize your wallet to manage the bot, and ‘payout_addresses’ to enable withdrawals. Pair your GUI wallet with the bot using its pairing code, then use commands such as balances, deposit, and withdraw to manage funds. Email notifications can also be configured to alert you if the bot stops running. There are individual assistants, which use the operator’s own capital, and collective or pooled assistants, which pool the capital of several participants under the management of an administrator. You can build a pooled assistant from the “Create” menu on the Counterstake website by simply filling out the required fields and sharing the address of your assistant bot. Set Up a New Bridge A new bridge will let you transfer any Obyte-based token to another external network, like Ethereum or BNB Chain. Even if the token is recently created, you can set up a bridge for it. The option is available through the “Create” menu on Counterstake. Once there, instead of choosing ‘pooled assistant’, you pick ‘bridge’. The steps may vary slightly from here, depending on whether the token is already in the Obyte Token Registry or not. After entering the token symbol, this is determined automatically. If it isn’t, you’ll need to register it in the Obyte Token Registry, which features a user-friendly interface. You’ll need your token ID (found on the DAG and in your wallet) and at least 0.1 GB for registration. **With that out of the way, you can start setting up your new bridge on Counterstake. The bridge creation interface is divided into four parts. The first two are ‘Obyte-side export’, where you set the challenging periods, longer periods for large transfers, the threshold that defines a large transfer, the minimum stake, and the minimum transaction age; and ‘[External Network]-side import’, where you select the staking asset, configure the same challenging-period rules, define the large-transfer threshold, and choose an oracle for price data. You can find price oracles at Obyte.io, or create one yourself in the Obyte wallet. Final Steps The other parts are the optional pooled assistants on both sides, where you specify the assistant bot manager, shares symbol, management fee, and success fee. The external network assistant section also includes a ‘swap fee’, which applies to swaps involving the assistant pool. Remember: to set up an assistant, you’ll need to install and fund the bot first. You can also skip having pooled assistants for your bridge. Two more sections are pending to confirm the creation of the new bridge and the new assistants —if any. Once everything is filled out, the new bridge will appear in the Counterstake user interface, and all that will be left is to spread the word to promote its use. **Besides, once the technical pieces are in place, the bridge needs ongoing liquidity and configuration so users can transfer the supported assets anytime. Governance (by the whole community) can also adjust parameters such as challenging periods, minimum stakes, and other rules that influence how transfers are secured. Building a bridge or running an assistant can benefit both operators and the wider community: operators can earn fees or rewards for providing infrastructure and liquidity, while users get more routes and smoother cross-chain transfers. In turn, more bridges and reliable assistants can help expand Counterstake's ecosystem and make cross-chain activity more accessible. Featured Vector Image by vectorjuice / Magnific

Original Source

Read the full article at Hackernoon →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.