Hey guys I’ve been exploring how ethereum smart contracts work and figured out a way for MaidSafe to host a ERC20 token that would be backed 1:1 by Omni MAID.
This video has been the basis for my understanding to easily deploy an ERC20 token and work in the following way:
Omni protocol and the Ethereum blockchain cannot communicate to each other thus a central server must bridge the calls. This requires a omni core node (on top of full bitcoin node) that can receive RPC calls to know the balance of the public address that receives and sends MAID for claiming ERC20 tokens and claiming back MAID. To ensure safety of deposited funds I would say this wallet with the private keys and server must be controlled by MaidSafe or else the potential risk for a third party to run away with funds is too high.
There will be a smart contract that represents the ‘MAID’ ERC20 token. This will have same limit as tokens as MAID = 452,552,412.
There will be a smart contract (lets call it TokenIssuer) that issues, keeps publicly track of the amount that is being issued and redeemed. This smart contract is similar to the video (where it is called TokenFarm) being controlled by the owner, in this case MaidSafe, by using function to issue ERC20 to the address of the person who deposits MAID or transfer ERC20 back to the ERC20 token smart contract when someone redeems his MAID.
This also means that only as many ERC20 tokens can be issued as MAID deposited to the public address held by MaidSafe, if only 10000 MAID is deposited and locked-up, only 10000 ERC20 tokens will exist. This TokenIssuer must be called by a server that monitors the Omni Core wallet and is able to give RPC commands to return MAID to the people who redeem their MAID by sending back their ERC20 Tokens.
In the video they demonstrate farming with the TokenFarm smart contract. For our example this would not be added. Basically a deposit address with 0% interest.
A problem here is transferring MAID in and out the controlled wallet because this requires BTC to pay for transaction fees plus GAS fees for the Ethereum Network also have to be payed. The user who wants to claim MAID thus has to send both to pay for these fees and I assume this kind of asynchronous logic would be tedious to develop and ensure it works flawlessly. The main issue here is really the cross-chain interaction of both Omni and Ethereum.
If successful it could be a great two way route,
a) Omni Maid ==> Get’s locked up ==> ERC20 Amount Gets Issued and is tradable on any DEX
b) ERC20 Tokens ==> Get Redeemed and Unlocked ==> Send out to address of redeemer who pays for tx fees.
This is just my personal findings and if anything is unclear or could be done differently please reply. Would also be great if @SwissPrivateBanker could explain how his team would proceed in making this a reality and who would control the MAID that is being transfered for ERC20 Tokens.
Note I added an image of what I think the layout would be, the ERC20 Token and TokenIssuer are deployed on the Ethereum Network but I think some kind of polling would be required by the server to know the current state of these on-chain values to be used by the RPC distributing MAID or having the server call command to issue ERC20 for people who deposit MAID and receive ERC20 Tokens.