Technical Difficulties and Proposed solutions for rAVAX, a Liquid Staking Solution for Avalanche

Hi Avalanche Community,

This is Blank from the StaFi Team, now are designing the liquid staking solutions for AVAX stakers, and it is called rAVAX.

With rAVAX solution, the AVAX stakers could enjoy the following benefits:

  1. There is no need to worry about the liquidity of staked AVAX. Users can trade rAVAX on the DEXes of Avalanche Eco at any time in the future.

  2. The rAVAX contract integrates a strategy for maximizing staking rewards, which automatically selects a group of Original Validators with the highest rewards on the chain for staking.

  3. rAVAX Solution will help create a more decentralized validator eco by its on-chain automatic diversified delegation strategy.

But when we are digging into the technical designs, we have met the following difficulties in technical. At the same time, we propose the related solutions to this.

Difficulty 1.
P-chain do not support creating a multisig account which has no private key but an address for others to transfer AVAX.

To implement rAVAX, we need to create a multisig account on Avalanche to gather rAVAX users’ AVAX and invoke staking related calls such as bond, unbond, claim etc, as staking related APIs are on the P-Chain, it will be quite easy if the multisig account can be created on P-chain. However, though we’ve got avax-create-multisig.ts, we can’t create a multisig account with no private key but an address on P-chain.

Though C-chain support smart contract and we can create a multisig contract and use it as a multisig account, the AVAX tokens from this contract account can not be staked until they are cross-chain transferred to P-chain on which we still need an account to invoke staking related calls.

Solution: P-chain supports multisig accounts.

Difficulty 2
For avalanche’s three chains, cross-chain transfer(Hereinafter referred to as Swap) can’t specify the dest address. In addition, P-chain and C-chain can not directly swap AVAX token.

As rToken’s frontend needs to use the browser plug-in wallet to sign securely and P-chain has no suitable browser extension wallet while C-chain can be connected with MetaMask,we plan to create a multisig contract on C-chain and use it as a multisig account. The ideal flow of AVAX token will be like this:

However, P-chain and C-chain can not directly swap AVAX token, and the flow could only be like this:

This complex process makes the rToken service extremely vulnerable and hard to implement, what’s worse, Swap can’t specify the dest address between avalanche’s three chains which means the above process simply cannot be implemented.

Proposed Solution:

  1. SWAP supports specifying the dest address.

  2. P-chain and C-chain support directly swap AVAX tokens from and to each other.

References

In oder to help AVAX community to better understand the technical architecture of StaFi’s liquid staking solution, we attach the following links for your information:

  1. StaFi rToken Technical Paper:https://docs.stafi.io/stafi-whitepaper/rtoken-paper/rtoken-technical-paper

  2. StaFi rToken App:https://app.stafi.io/