Ethereum has shown itself to be the ultimate platform for building token economies. Thousands of contracts have been created which support standards like ERC20 and ERC721.
However, businesses using Ethereum have struggled adopting new users into the ecosystem due to the upfront costs of Gas to interact with these token contracts. Many newcomers do not understand why they need ETH to be able to interact with other tokens they actually are interested in.
Businesses have shown that they would be more than happy to fund the usage of their users. Some have done this by providing a faucet or ETH drop to their users, while others may have implemented L2 solutions or have made compromises building centralized solutions.
What it does
Supercharger Network removes the pains and costs of blockchain transaction fees from end users, by offloading those costs onto the token owners and community contributors who want to support a token.
Supercharger Network is a blockchain protocol, developed on top of the Substrate blockchain framework, which provides an alternative mechanism for transfer fees on tokens. Ultimately, each token built on the network is backed by a fund of the native blockchain currency. This fund is used to pay for the transfers of that token, on behalf of the user.
First, we developed a protocol level ERC20 compatible token factory within our blockchain. This allows any user to easily create a new token which can be used on the blockchain, without any coding necessary. At the time of creation, the user creating the tokens is given the option to deposit funds into the account
Next, we extended the ERC20 protocol, exposing a function called
try_free_transfer, which allows a user to make free transfers of these tokens. The transfer fees are taken from the fund for that token, and users are limited on the number of times they can make a free transfer per time period.
For example, the "Better Energy Foundation" issue a new token to be used as electricity credits. When they do this, they fund the token with an initial supply of the underlying blockchain currency 10,000 units, and specify that the users of their token have 10 free transactions every 1,000 blocks. They can sell their tokens and transfer them to the buyers just like a normal ICO. These buyers can then call the
try_free_transfer function when trying to trade the token among their peers, and the fees are paid for using the fund. Anyone in the community can continue to add more funds, and allow the free transfers to continue.
If a user does not have any more "free" transactions left, they can always make a transaction using the normal
transfer function which will charge them like normal.
How we built it
First we had to set up and prepare all the people on the team to build on Substrate, including learning Rust!
Then we initially ported the ERC20 standard using the Substrate framework through a Substrate runtime module.
We extended the protocol so that a single module can support the creation of multiple independent assets.
Then we built an additional set of functions which enable the mechanics around funding tokens and supporting free transfers.
Then we configured and tweaked the underlying blockchain logic to enable fee-less transfers. We also enabled hooks to start taking fees from the fund for a token.
Sounds pretty straight forward in retrospect, but challenging for sure.
Challenges we ran into
The first challenge we ran into was getting everyone to a point where they were able to start contributing to the project, which meant learning Rust and Substrate.
At that point, we had to think critically about the best way to port the ERC20 protocol to Substrate, which was optimized for how Substrate is designed. But more than that, we extended the protocol to support the creation of any number of tokens, all through a single protocol. We think this is a powerful module which may be reused by other teams also interested building token factories on Substrate.
Then we looked into how we can tweak the underlying fee structure around individual calls to the Substrate blockchain, which is a bleeding edge feature in Substrate, and one that we had to mostly discover on our own. This was obviously critical to make our idea work at all.
We actually built functionality which enables a user to transfer a token by paying fees in the token they want to transfer. However, we found that the front-end libraries available for Substrate is not yet general enough to encode this kind of information in the transaction to be processed by the blockchain.
Finally, we had to be clever in how we track the number of free transaction each user had for each token. As the system scales, it is not trivial to clean up this kind of data on the blockchain. What we decided was to put all the information in a tree, which we can ultimately destroy in a single action every time we reset the counter.
We tried working on a custom front-end to show off our end to end scenario, but time proved to be the limiting factor here.
Accomplishments that we're proud of
Learning to build on a new platform with a new language.
Module is written generically enough that it can easily be reused in other Substrate projects.
Taking a complicated problem and creating what feels like a simple solution.
What we learned
Alternative solutions in the space (EOS, Gas Station, Meta-Transactions, etc...)
What's next for Supercharger Network
Modify the ERC20 token factory to be an ERC1155 token factory, supporting fungible and non-fungible tokens.
Alternative fee payment mechanisms for example mini-PoW which can allow a transfer to go through.