Staking ERC-20 Tokens With {Sets}

Ghilia Weldesselasie
Underdawg by Ghilia Weldesselasie
6 min readDec 11, 2017

Written by Ghilia Weldesselasie

Disclaimer: I thought it would be pretty cool to explore a neat use case of both Proof of Stake tech and an upcoming protocol called {Set}.

I’m not that familiar with everything about Ethereum and I’m not a developer either so I don’t know if the ideas I’m proposing are feasible at all. I’m writing this because I thought it was a cool idea and I wanted to get some feedback on it. If you have any criticisms about this idea feel free to respond, in fact I would really appreciate if an Ethereum developer would respond to this post with his/her thoughts.

As always, don’t forget to share and recommend if you liked this.

Introduction

As Ethereum’s implimentation of Casper nears, the network is getting ready to switch to PoS. If you don’t know what PoS is, here’s a quick summary from the Ethereum wiki on Github:

Proof of Stake (PoS) is a category of consensus algorithms for public blockchains that depend on a validator’s economic stake in the network. In proof of work (PoW) based public blockchains (e.g. Bitcoin and the current implementation of Ethereum), the algorithm rewards participants who solve cryptographic puzzles in order to validate transactions and create new blocks (i.e. mining). In PoS-based public blockchains (e.g. Ethereum’s upcoming Casper implementation), a set of validators take turns proposing and voting on the next block, and the weight of each validator’s vote depends on the size of its deposit (i.e. stake). Significant advantages of PoS include security, reduced risk of centralization, and energy efficiency.

— Proof of Stake (POS) FAQ on Github

In a nutshell, PoS is an energy efficient and secure alternative to PoW that works by staking (depositing) your ETH. In return, validators are rewarded in ETH for processing transactions on the network and creating new blocks. However, no plans have been made to allow staking with tokens so far.

With the recent rise of Decentralized Exchange (DEX) protocols such as AirSwap and 0x, that got me thinking;

“What if we could stake ERC-20 tokens on the Ethereum blockchain using a DEX protocol?”

Initial Phase

At first I thought that through a Decentralized Application (Dapp) using a smart contract and the 0x protocol, we could stake individual tokens on the Ethereum blockchain.

It would go something like this:

  1. The user decides to stake an ERC-20 token (say SNT) on the Ethereum blockchain using our Dapp.
  2. The SNT is sent to the smart contract, converted into ETH through the 0x protocol.
  3. The ETH is staked until the user wishes to withdraw their deposit.
  4. When the user decides to withdraw their deposit, they get back their initial deposit plus whatever reward they earned through staking as interest (converted from ETH to SNT).

One problem with this approach however is that it does not allow the staking of baskets of tokens or rather it would be too complicated to build.

That’s when I found {Set}

Enter {Set}

{Set} is a new primitive that facilitates the low-cost, trustless creation and exchange of a collateralized basket of tokens.

website

whitepaper

{Set} is a new protocol that enables anybody to easily create a collateralized basket of ERC20 tokens on the Ethereum Blockchain. {Sets} would be like tokenized Index Funds or ETFs. Being able to wrap several tokens into a single {Set} (which is also it’s own ERC-20 token btw!) has several advantages like:

  • Being able to save on gas when transferring several tokens at once.
  • They are fully collateralized.
  • Composed of a limitless numbers of tokens, as long as they’re ERC-20.
  • Can be traded and their underlying tokens can be redeemed at any time.

The {Set} protocol is exciting enough with just these benefits but one thing that is particularly amazing is potential use case that caught my eye while reading the whitepaper:

Let’s say a developer wants programmatically to process a file in a MapReduce fashion on computers all over the world using Golem and then store it in a decentralized manner using Storj. Using a decentralized exchange protocol such as 0x protocol, the developer can programmatically purchase a single {ComputeStore Token} which is composed of 100x Golem and 100x Storj tokens using wrapped Ether, ether that has been converted into the ERC20 specification. Then the developer can call the redeem function in the {ComputeStore Token} contract to get the underlying Golem and Storj tokens for usage on the Golem and Storj networks. Any unused tokens can be traded, sold, or issued into a new {Set}.

What it’s basically saying is that {Sets} can be used to wrap several tokens and pay for a service using only one token. In this case you’re paying to process and store a file using only one token and paying one gas fee.

Staking with {Sets}

With those capabilities in my mind, using a {Set} and the 0x protocol, any ERC-20 tokens you put in your Set could be used to Stake ETH on the Ethereum blockchain.

You can hold ERC-20 tokens in a {Set}, use the 0x protocol to exchange them to ETH in real time and stake them that way. As soon as you wrant to stop staking you can take them out and you will have your {Set} back with all of the original tokens that were there initially. Since {Sets} automatically rebalance themselves, ETH earned as a reward from staking would go into the {Set} and be returned as the tokens you had initially in the same ratio as before. So if you have a {Set} with a value of $10K, 50% ETH, 25% OMG and 25% BAT. You stake that {Set}, it gets converted into ETH through a Dapp, you earn say 5 ETH from staking. Those 5 ETH would be redistributed among your {Set} in order to conserve the initial ratio by using the 0x protocol to exchange in real time.

There are several issues with this idea however that I’ve noticed:

  1. In the rare case that nobody is selling their ETH (say if everyone decided to stake their ETH) on any 0x powered exchange then it would be impossible to stake with tokens since nobody would be buying those tokens with ETH.
  2. When trading your ETH back to your original {Set} there’s no guarantee that same {Set} with the same underlying tokens back to you. However a smart contract that had that swapped your {Set} for Ether, then staked that on your behalf could handle it assuming it had a liquidity pool to handle the swap for you.
  3. {Sets} automatically rebalance themselves in order to retain the same ratios of tokens, however when trading from ETH to your tokens you can expose yourself to price volatility. Meaning you’ll get back the same ratio of tokens but you might receive less tokens then you had initially. That is one of the risks that come with trading tokens.

Tl;dr

To summarize, we’ve seen how by using the {Set} protocol we might be able to stake ERC-20 tokens on the Ethereum blockchain. One could theoretically wrap all of his crypto assets in a single {Set}, stake it on the Ethereum chain and get a decent amount of interest depending on how PoS will be implemented. {Set} + PoS could act as the high interest savings account of the future.

About Me

Hi, I’m Ghilia a 17 year old student, investor (or speculator depending on who you ask) and blockchain enthusiast.

In the short time I’ve been involved in the crypto community I’ve had the privilege of working with AirSwap and Signals Network and also help build r/tokentrade, the world’s first decentralized exchange built on Reddit that leverages the 0x protocol.

I hope I can help build a lot more projects on top of Ethereum. In fact I have a whitepaper in the works right now, it’s crazy and I can’t wait to share it with you guys. Stay tuned to my blog for more updates.

I’m also open to advising opportunities if you’re looking for an adviser for your project.

If you liked this article please share it far and wide and don’t forget to recommend since it helps my ideas reach a wider audience.

--

--