DRAFT - Proposal - Linkswap Deployment to Arbitrum L2

Abstract/Executive Summary:
This is a proposal for the deployment of Linkswap contracts to Offchain Labs’ Arbitrum V3 test network, in preparation for the launch of their mainnet which is currently under audit.

Motivation:
Hey everyone, Rick here!

Whilst I have been busy working on integrations with third-party wallet dashboards, TVL trackers, fee leaderboards and a few other odd dev jobs alongside my degree, such as the allocateSeigniorage() script, it has become abundantly clear that we need to start taking action against ever-increasing gas fees which ultimately inhibit the powerful experience that Linkswap is able to offer new and existing users of DeFi on Ethereum L1.

Following a deep dive into L2 scaling solutions, the beginnings of which you may have seen in our community development channels, I hereby propose that we pursue the benefits of deploying Linkswap to Arbitrum. Don’t know what these benefits are, or why we need them? Why Arbitrum and not Optimism? Allow me to explain.

First let us consider estimates for the amount of gas used in calling a set of common Linkswap functions, totalling almost Ξ300 spent in interacting with the LinkswapRouter contract alone in the three months since launch (which you can verify here by clicking ‘TxnFees’). If we take a handful of the most recent transactions calling swapExactETHForTokens(...) function then we can see that a rough estimate for gas consumption is in the region of 150,000 +/- 15,000 units which amounts to fees anywhere between $30-60 at today’s prices. Now compare that with transactions from the beginning of Linkswap’s existence, when gas fees were already on the rise, and you can easily find instances costing $4-9. As of late, transactions even as simple as approvals are now costing double that! Clearly this unprecedented increase is not sustainable. Given the Arbitrum testnet implementation of Uniswap (Arbiswap) delivering a 55x gain in gas efficiency and future support for BLS signatures, it is not unreasonable to expect similar improvements for Linkswap. You can also check out their full featured block explorer for more in-depth insight.

I had attempted to write a script utilising web3.eth.estimateGas() to estimate the gas used across a range of contract calls, however it is currently estimating gas usage as a constant 53,000 units across each function, which in light of above investigation is clearly not exactly accurate, but maybe somewhat useful still in demonstrating high gas fees in times of network congestion. You can find it here and run it yourself to get the most up to date dollar values for a range of fastest to safe low gas prices. Please do also feel free to submit a PR if you can figure out a way to improve the estimates (if that is even possible) as I would really like to get some accurate benchmarking in place for before and after L2.

Let’s now consider all solutions at our disposal, and hopefully convince you as to why I believe Arbitrum is the best fit for Linkswap. These potential candidates can be categorised into one of six implementations, as follows:

  1. State channels
  2. Side chains
  3. Plasma
  4. Validium
  5. ZK rollups
  6. Optimistic rollups

See Ethereum docs and this evaluation for a more in-depth explanation of the different approaches, including an extremely useful graphic for comparison in the latter.

Taking inspiration from a recent MCDEX article, there are a handful of key offerings we require, including but not limited to: product readiness and adoption; a high degree of security and decentralisation; developer-friendliness and EVM-compatibility; intrinsic support for existing infrastructure (e.g. TheGraph, Truffle, web3.js, Infura, etc.); high throughput, low fee and fast confirmation times.

We can immediately discount state channels and side chains, as a quick scan of the above analyses clearly shows that these are not a viable solution for Linkswap in terms of two or more of the trade-offs in security, EVM-compatibility and lack of wide adoption. The same is true of Validium and most Plasma chains, excluding Matic EVM-based POS sidechains and Polygon Internet of Blockchains, whilst ZK rollups such as those provided by zkSync appear to be stand-out options save for the current lack of EVM-compatibility.

As you may have already guessed, the punchline is that this now leaves us with only optimistic rollups. These differ from ZK rollups in their use of ‘fraud proof’ as the security model, rather than ‘validity proof’, which has the benefit of reducing on-chain computation (hence cost) by assuming transactions are valid by default unless disputed in the event of a challenge. This is source for the main technical difference between Optimism and Arbitrum – OVM utilizes single-round interactive fraud proofs, whereas Arbitrum applies optimised multi-round interactive fraud proofs which give rise to lower cost, greater security and allows for higher throughput on the rollup.

In addition to excellent documentation, developer support and ticking of literally all our other boxes, Arbitrum is closely tied to the Chainlink community, utilising $LINK token staking as collateral in rollup dispute resolution, and so this is another reason I believe it would be a nice addition to our Chainlink-focused ecosystem. As such, Arbitrum is already benefitting from significant network effects, with notable investment from Coinbase Ventures, partnerships with Chainlink, 1Inch Exchange through ETH Denver hackathon and over 1,500 dapps already supported on testnet since launch in October 2020 (e.g. Bancor, Bounce, MCDEX, and Offchain Labs’ implementation of Aave (Aarbe), Uniswap (Arbiswap), Balancer (arBalancer) and MakerDAO (FakerDAO)).

If that’s not enough to start getting you excited, check out this comment by the one and only CLG on a recent Sushiswap proposal to port to Arbitrum:

I think this is a great idea all around with essentially no downside risk. The Sushiswap smart contract suite can be deployed onto the Arbitrum testnet today without any modifications to the code, meaning it would require extremely minimal development effort from the dev team, essentially just deploying the existing contracts and some mock ERC20 tokens.

This would allow both devs and users to test SushiSwap on L2 to see what the gas costs look like ahead of the Arbitrum mainnet and how much transactional bandwidth is provided. You don’t even need to ask the Arbitrum team for permission to deploy on their testnet, it’s entirely permissionless unlike some other Rollups.

Layer 2 is inevitable for DeFi so I’m curious about what others think regarding this proposal.

You heard him! Absolutely no downside risk, trivial (permissionless) deployment and the opportunity to get some benchmark data for Linkswap on L2 before Arbitrum mainnet is launched. Another point in favour of Arbitrum over Optimism along the vein of what CLG said is that, unlike Arbitrum, OVM does require developers to revise code when dealing with timing-related operations and team approval at an early stage. I have also used Arbitrum locally with some example projects provided by the Offchain Labs team and the entire experience is seamless, I must say.

But yet, the innovation doesn’t stop there! An excerpt from the MCDEX article linked above indicates that the Arbitrum team are planning to deliver further improvements to the efficiency of Optimistic rollups alongside development of their own channel and sidechain implementations with ZK proofs in future:

The Sequencer Model is an upcoming new feature of Arbitrum. It allows Arbitrum users to quickly confirm their transaction status directly on L2 without having to wait for the transaction to transfer onto L1. Although this feature makes the product slightly less decentralized, it speeds up the confirmation process a lot. In addition, the Arbitrum team is working on solutions that will decentralize the sequencer model even more over time. With the Sequencer model, both the trading speed and liquidation efficiency will be drastically increased.

Additionally, in the future, as the ZK-Rollup technology develops, the Offchain Labs team is planning to add ZK proofs to Arbitrum, thus incorporating the benefits of zero-knowledge technology into their rollup solution.

And finally, to acknowledge some conversation we have seen recently, I completely understand the desire for a multi-chain deployment strategy in order to better serve more communities over various ecosystems. It is, however, also important to realise that Ethereum is clearly still the central focus for DeFi and as such should remain the case for Linkswap. I am by no means against suggestions of deploying to Binance SmartChain – we simply need to think sensibly about where best to focus our funds, time and energies in the short term to maximise benefit whilst minimising cost (in its various forms). I have also done extensive research into the Gas Station Network (GSN) as an interim solution for exorbitant gas fees, however with increasing adoption of other layer 2 solutions I believe it is now far more beneficial to first focus our efforts here and then integrate features like this at a later date if it still makes sense to do so.

So, to conclude, I propose we deploy to Arbitrum testnet, acknowledging that it is looking extremely promising and signalling our intention whilst still giving the ability to further explore Matic/Polygon as an alternative solution, should we need one. This is an excellent opportunity to further demonstrate our commitment to the Chainlink ecosystem whilst simultaneously adding significant value to users of our platform and paving the way for myriad other exciting use cases in future. A gasless social recovery wallet with built-in interest-earning strategies and private transactions initially comes to mind…

This proposal is a request for dev funds to help facilitate the deployment to L2. I will be asking for 5 YFL personally as compensation for the time put into integrations and research for this solution, with another potentially put forward to request further compensation on successful completion.

Specification:
I am requesting that 5 YFL be sent from the treasury to my donation address: 0xFC57EEfec07c15c60b2be3DfA810af3E78D6fD42;

Voting Options
For
Approve the pursuit of Arbitrum as a L2 scaling solution, transfer 5 YFL to Rick Sazarov – OK;LG.
Against
No changes.

5 Likes

ok, L2 need to be a urgent issue.

1 Like

Hi Guys,

All in and supportive for this initiative.

Thanks for the hard work.

1 Like

It has been some time since I posted this prop originally and obviously the community is going through some changes currently, but for completeness and anyone interested in reading back through old proposals: we decided against putting this to vote in light of arguments largely pertaining to liquidity fragmentation and the impact that would have on our ability to drive sustainable volume through Linkswap.