ERC20 is a standard protocol for smart contracts on Ethereum. This protocol supports the token to call some advanced capabilities on Ethereum, such as query balance, transfer, authorization, etc. Tokens that support this standard can be better used by wallets Integrate or be accessed by exchanges.
The standard ERC20 protocol stipulates multiple functions. When each project party edits the smart contract of its own token on Ethereum, it needs to declare these functions in turn. Other functions can be added in the process, but cannot be reduced.
When the ABS on Stafi was issued, it was not issued on Ethereum, but as a decentralized bond asset issuance platform, the cross-platform nature of assets is particularly important. Among them, there are many Defi infrastructures on Ethereum, and most of the supported assets are ERC20 standard. Therefore, it is particularly important to convert ABS into ERC20 assets and circulate them to Ethereum's decentralized exchanges.
So how can ABS tokens be converted into ERC20 standard tokens?
A unified approach is to issue an identical ERC20 token on Ethereum, and the quantity is related. The former is generated, the latter is generated together, the latter is destroyed, and the former is destroyed together. In short, the quantity conversion between the two is done well. relation.
Among them, cross-chain is designed, and it is a chain with cross-PoW consensus, so the difficulty is quite high.
(Looking at Ethermint, the application of Cosmos bridged to Ethereum, you can see how difficult it is without doing it for 2 years)
Below I will list some schemes, or practices, that include the above associations.
1. Swap exchange
For better financing, many public chain projects choose to issue ERC20 first, and convert them into main network Token 1:1 after the main network goes live. This exchange process is actually a cross-chain operation.
Under normal circumstances, the user sends the ERC20 token to a contract address. After the contract receives the information, it issues an equal number of tokens to the user at the corresponding address on the main network. In this process, the contract address on Ethereum acts as the receiver, and the smart contract on the main network acts as the issuer. When the issuer monitors the information received by the receiver, it triggers the issuance behavior and locks or destroys the ERC20 token at the same time. complete the exchange.
If ABS tokens are to be circulated on Ethereum, this exchange method can be adopted. There is an issuance contract on the Stafi main network, which monitors a receiving contract on Ethereum in real time, and completes the quantity change operation between the two.
This method is actually simple to say, but because it involves cross-chain consensus with PoW, there will be many security problems in the whole process. Generally speaking, one-way operations will simplify the security issues of the model. For example, the receiving contract only provides receiving services and does not provide transfer out. Will coexist with ERC20.
We generally see that when the mainnet is launched, the exchange upgrades the mainnet tokens, which is actually a one-time exchange.
However, ABS cannot achieve one-way transfer. As an asset, the transfer of ABS tokens between different basic chains is a very important requirement, so we have done a lot of work on cross-chain bridging to ensure safety.
There are several typical practices in the industry, and I found a few characteristic ones:
Loom has established a Plasma sidechain on the upper layer of Ethereum. Loom's staking mechanism is carried out on the Plasma chain. When users want to staking, they need to transfer the ERC20 token Loom to Plasma first, and then bind (Mapping) A Plasma address, use the new address for staking. When the user completes staking and prepares to get back Loom tokens, it needs to be transferred from the Plasma sidechain to Ethereum. During this process, there is a quantitative interaction between the contract on Ethereum and the contract on Plasma. At the same time, the conversion between them is mutual.
IOTX supports ERC20 tokens and mainnet tokens to exist at the same time. At the same time, both tokens can be staking in different contracts. The mystery is that the entrance of staking is only ERC20, so it has been converted into mainnet IOTX tokens. When doing staking, the mainnet IOTX will actively convert to ERC20 before staking. Among them, there is also a quantitative interaction relationship between the main network contract and the Ethereum contract, and their conversion is also mutual.
FSN’s staking is one-way, and only supports mainnet FSN for staking. If FSN holders want to get rewards, they must first exchange. After the ERC20 FSN exchange is completed, it will be destroyed and replaced by the FSN of the main network.
2. Wrap packaging
Wrap packaging is a term for converting non-ERC20 into ERC20.
On Ethereum, ETH is not an ERC20 standard token. In order to allow ETH tokens to be exchanged with other ERC20 tokens in DEX and Dapp, someone created an ERC20 compatible WETH, also called Wrapped-ETH. The method is to send ETH to a contract, the contract locks ETH, and gives you the same amount of WETH, ETH and WETH have a 1:1 relationship.
There is also a Wrap solution for cross-chain assets, the main representative of which is WBTC. The WBTC issuance scheme tends to be centralized. Users deposit BTC into the custodian institution through the intermediary, and the intermediary initiates the WBTC generation contract, which is finally confirmed by the custodian. The whole result is similar to WETH, which is to lock BTC and give WBTC. But because it involves cross-chain, BTC cannot directly participate in the smart contract created on Ethereum, so WBTC adopts a simple centralized method.
Among them, the intermediaries and custodians are elected by an alliance, which includes many famous Dapps, Dex, etc. on Ethereum. Providing BTC to the intermediary to obtain WBTC means that you need to fully trust all institutions in this alliance.
In this way, ABS tokens also need an alliance to manage related assets. The alliance means centralization and requires a lot of trust, and its decentralization technology is not very mature at present, especially in the face of The cross-chain of PoW is not only safe, but also the feeling of experience will be much worse.
To sum up, there are not many solutions for ERC20 compatible design of assets, and they all have different technical difficulties. The way of Swap is more mature, and the way of Wrap is more complicated. Of course, ETH is an exception because it itself is an tokens. The ABS assets issued by Stafi will choose between these two solutions, and will actively explore better cross-chain solutions.
In particular, after the transformation of Ethereum to 2.0, there will be more possibilities for this mechanism.
