Part of the “Secret Solutions” series, this post explores how solving for privacy with Secret Network helps with adoption and growth of decentralized technologies. Today, Itzik Grossman of Enigma (aka Cashmaney) writes about staking derivatives on Secret Network, which unlock new liquidity for DeFi while keeping networks secure and data private. Read on to learn about "secret" staking derivatives (launching with the secret contracts mainnet upgrade) and find out how you can build alongside our community!

“DeFi.” That’s probably a word you’ve been hearing a lot lately. It seems like everybody in the blockchain space can’t stop talking about the latest and greatest type of produce 🍠 or international food 🍣

The concept of “decentralized finance” is the new cool kid in an ecosystem that is constantly searching for the “next big thing”, growing at an explosive rate of over 300% in just the past 2 months, bringing the total value of assets locked in DeFi to nearly $8 billion.

Source: DefiPulse

The lifeblood of DeFi is liquidity. Liquidity refers to assets that can be used to power financial instruments such as lending, forex, derivatives, and more. Those that provide the liquidity earn interest, usually paid by those who are leveraging that liquidity. Historically, there have been hundreds of billions of dollars worth of crypto assets sitting in vaults as a purely speculative tool. The new ability to also earn interest on those assets has been the catalyst powering DeFi growth.

One of the easiest ways to earn interest on your crypto holdings in modern blockchains is by staking. This will sound familiar to anyone who’s heard of Proof of Stake networks (like our own Secret Network). Without going too far down the rabbit hole (yet), staking is the act of locking your coins in order to mine blocks on a network. The more you lock, the more you can earn. For example, on Secret Network, validators can currently receive 30% annualized rewards for staking SCRT. Starting to sound a lot like DeFi, right?

Well, I would argue staking is a slightly different creature. Unlike most DeFi tools (such as lending) in which users must opt into participating, staking is usually a mechanism native to the blockchain itself and essential for network security. By this, I mean that staking on Proof-of-Stake (PoS) Blockchains is so common it effectively depreciates any assets that aren’t actively staked. So PoS blockchains incentivize you to lock up your coins for staking, but by doing so there is much less liquidity available for use in other DeFi tools. To add insult to injury, the returns from DeFi on these networks must also directly compete with staking rewards. (It’s worth mentioning at this point that Ethereum, the ‘main’ DeFi chain, is transitioning to PoS in the near future.)

Not all hope is lost, however, for DeFi on PoS blockchains. Staking derivatives can come to the rescue! Here’s the basic gist: when you stake some of your native coins, you receive a synthetic token in return. This token can then be used as currency for DeFi applications. In my opinion, staking derivatives are an essential building block for DeFi on PoS networks, and without them DeFi is not sustainable. Moreover, if done right, staking derivatives are actually symbiotic with DeFi and may amplify gains in ways we haven’t seen yet. That’s the theory, anyway. Proof-of-Stake blockchains are relatively young, and staking derivatives haven’t been tried yet. Until now, that is.

I believe that Secret Network is a great place for financial services, especially in the Cosmos ecosystem. The encrypted nature of secret contracts allows us to create both privacy-preserving and front-running resistant solutions. To that end, we have created dxSCRT - a unique staking derivative token on the Secret Network, which will be available on our public testnet in the coming weeks, as well as on mainnet with the launch of secret contracts.

What can dxSCRT mean for Secret Network? Right now, the unbonding time for Secret Network is 21 days. That means you need to choose between locking your SCRT for 21 days or missing out on block rewards entirely. Now there is going to be another option - deposit SCRT into a secret contract and receive dxSCRT, which is a secret token. As we've written about before, secret tokens are programmable like ERC20s, but private like zCash. In this case, dxSCRT represents your funds, staked by the secret contract, earning staking rewards over time. In addition, dxSCRT can also be exchanged at any time for SCRT.

How does this work? Let’s start with an example. Alice deposits 100 SCRT into a secret contract and receives 100 dxSCRT. These dxSCRT are fungible tokens she can trade or transfer to anyone else, but let’s say Alice is a serious hodler and keeps them herself. A month later SCRT has mooned and Alice decides to exchange her dxSCRT back to SCRT. For those same 100 dxSCRT she now receives 115 SCRT. This represents her original 100 SCRT, plus another 15 SCRT - the staking rewards for that month. In other words, the dxSCRT/SCRT exchange rate self-regulated itself to include both the underlying value, as well as the accumulated rewards.

See more on secret tokens here:
Secret Tokens: Programmable Privacy for DeFi
How Secret Network can create network effects for privacy, providing the missing piece for DeFi mass adoption.

Down the Rabbit Hole

Sounds pretty simple, right? Well, like most things in life and cryptocurrency, the devil is in the details, so I’m going to dive a little deeper into the design of dxSCRT and talk a little about our approach in general to staking derivatives.

(Warning: from here on this will get a little more technical, and knowledge of PoS concepts is required).

First, let’s map out a list of goals for our staking derivative, in no particular order:

  1. We want to allocate a synthetic, fungible asset, while still accruing staking rewards.
  2. We want to provide liquidity for the synthetic asset to eliminate the “unbonding” or wait period of 21 days when you withdraw your stake.
  3. We want to maximize rewards, and be resistant to slashing.
  4. We want to enhance the privacy and security of our network.

#1 is pretty simple - our network already has support for Secret Tokens - synthetic privacy tokens that we can use for our staking derivative. Secret tokens are also standardized, which means they can used for DeFi applications elsewhere on  Secret Network, and in the future on other chains as well (via bridges, IBC, or other means).

To tackle #2 the common DeFi solution is to introduce a liquidity pool. It will allow holders of our staking derivative to directly exchange their synthetic tokens for native coins (SCRT).

Now that we have a pool and a token, the next question is how to stake our coins. It is easy to see that giving a single validator all the stake may not be the most prudent course of action, and so we’re using a Validator Set. This is basically an index of validators that share the staked fund, thereby reducing risk and decentralizing our stake.  

Lastly, we need to sprinkle a bit of logic on the contract to keep a healthy balance between liquid and staked assets. We call this the Liquidity Ratio. The contract will reshuffle funds to maintain this ratio throughout the lifetime of the contract.

A look at how a user interacts with a "secret" staking contract.

Putting it all together, we arrive at the following model:

1. A user deposits his SCRT into a secret contract. He receives a secret token (dxSCRT), equivalent to his share of assets locked in the contract.

2. Based on the current liquidity ratio, the contract decides:

  • Whether these funds should be staked or kept in the pool
  • Which validator from the validator set to stake with

3. As time passes, the exchange rate between the token and SCRT is updated to reflect earned staking rewards. Those tokens are fungible, privacy preserving tokens which can be sent, traded or withdrawn instantly for SCRT.

4. A user redeems his tokens. Funds are sent from the liquidity pool in exchange for the redeemed tokens.

5. The contract decides if funds should be unbonded from a validator to balance the remaining liquidity pool.

So to recap, with our new derivative we now have:

  1. Immediate liquidity. Liquidity for the staking derivative is guaranteed, and you bypass the 21-day unbonding period. This opens new opportunities for those that hold SCRT but wish to retain the ability to react if the market changes.
  2. Liquidity for Secret DeFi. new DeFi services can be powered by dxSCRT. This makes sure there is no shortage of liquidity due to bonded coins.
  3. Privacy by default. This is unique to Secret Network. Having a privacy token as a staking derivative not only increases financial privacy on the network, but in addition unlocks ways to stake in a completely private manner!

But Wait - There's More!

Okay, so hopefully by now you’re sold on this idea and see how it directly contributes to the growth of liquidity. But you may also be familiar with how Cosmos governance works, so you have a few questions about whether this will end up disenfranchising stakers. Here’s where the real fun begins. (This is future work, but I still want to share because I’m pretty excited about it, and I think it’s a great example how when you choose privacy-by-default you can create amazing things.)

Yes, having a large share of tokens locked in a staking contract would remove the ability to vote on governance proposals. I feel that holding a staking derivative should not mean that you cannot vote on network governance. So, our plan is to add the ability for holders of the staking derivative to be able to vote on proposals. The staking contract will tally the votes, and after a consensus is reached by the holders of the staking contract (using a similar model to on-chain governance voting), the contract will place a vote in the name of all token holders.

The amazing thing? Because of the structure of this staking contract and Secret Network’s capability for programmable privacy, all those votes are completely private. We started out trying to solve a purely financial problem and ended up with a solution for private voting for blockchain governance!

Excitingly, most of what we’ve written above isn’t just a theory - it’s already working in practice. We’ve been running dxSCRT on an internal Secret testnet for the past few weeks. Now we look forward to getting it deployed on mainnet as well later this month.

The Secret is Out: Announcing the Secret Contracts Mainnet!
After years of development and two successful public testnets, we’re ready to bring secret contracts to life, making Secret Network the first privacy-preserving blockchain of its kind.

We see Secret DeFi as a giant privacy-centric sandbox for the next generation of DeFi ideas. We believe that privacy is essential for building a more sustainable and user-centric open financial universe, and we will continue to bridge this exciting work to other ecosystems.

If you’d like to start testing out secret staking derivatives or secret tokens, or if you’d like to start building your own Secret Apps, come join our communities using the links at the end of this blog. We’d love to build alongside you. And if you want to discuss this post, staking derivatives, or other Secret DeFi applications, please join us on the Secret Forum!

In conclusion: Privacy - Fuck yeah.

~ Itzik Grossman, VP of Engineering at Enigma MPC

To discuss Secret Network and Secret Apps, visit our community channels:
Forum | Secret Chat | Twitter | Telegram | Discord