We did some initial research on the scaling solutions and we want to share it here. Any feedback is welcome.
Below are several things to consider for the scaling solutions:
Time to market
We prioritize time to market over other scaling features. Hopefully, we can have as few code rewrites as possible. We can afford another migration if there is a dominant DeFi chain or L2 solution in the future.
The scaling solution is already launched with real transactions from the block explorers.
Using the same Metamask wallet to access everything without creating a new wallet or updating Metamask settings.
Usability (Smaller withdraw dispute period)
Some L2 solutions like plasma or optimistic rollups need a dispute period, and we want to have a minimum dispute period or no dispute at all.
High throughput and low fees
The higher throughput the better. The lower fees the better.
List of Scaling Solutions
Here is the link to our research on scaling projects. Please let us know if there is anything here that’s not up-to-date.
Our Proposal to the New Perpetual Protocol Design
The pros and cons of this design:
- Gas fee is only needed when depositing. OpenPosition / ClosePosition / AddMargin / RemoveMargin are gas free because of meta transactions.
- Funds on L1 and L2 are all controlled by the same wallet (Metamask or Walletconnect). No extra L2 wallet needed.
- Frequent operations like OpenPosition / ClosePosition can be speeded up by L2.
- Traders can also create a wallet on L2 and trade with AMM on L2 without touching L1.
- Traders need to deposit first. This adds a little bit complexity but should not be a big burden.
- Unable to query AMM from L1. We reduce our composability by moving the AMM to L2.
New Addition to the Design
- Root Bridge Contract/Client Bridge Contract
This is provided by the scaling solution in order to send transactions or ERC-20 tokens between L1 and L2.
- Meta Tx Gateway
This is provided by the scaling solution in order to send meta transactions from L1 to L2.
- Deposit Proxy
A proxy to deposit funds from L1 to L2.
- Order Proxy
A proxy to send meta transactions from L1 to L2.
Features Required from Scaling Solutions
Take Matic for example. Below are the features we need to validate:
- Deposit DAI (or other stable coins) => Matic.
- Withdraw Matic DAI => DAI.
- Calling a view function on Ethereum from Matic.
- Send a transaction to Ethereum from Matic (Who are going to pay the fees?)
- Sign a message (
web3.personal.sign()) in Ethereum and verify it (
web3.personal.ecRecover()) on Matic
- Send a meta transaction from Ethereum to Matic
- Get Oracle data on L2
We will filter out the projects based on these features.
Candidates and Validation Results
Most of the solutions are not fully production-ready yet, so we only have a few choices. We will start by evaluating xDAI and Matic and post the results below in the comments section.
Please let us know if you have any feedback. Thanks.