By using this site, you agree to our use of cookies, which we use to analyse our traffic in accordance with our Privacy Policy. We also share information about your use of our site with our analytics partners.

MetaMask

Connect Users To Layer 2 Networks With The MetaMask Custom Networks API

Our new Custom Networks API is our latest step on the way to seamless cross-chain user experiences in MetaMask. It allows developers to recommend a variety of chains to their users, including Layer 2 networks.
by Dan FinlayMarch 3, 2021
metamask ama featured

Today the fundamentals of Ethereum are stronger than ever. 1.3 million transactions settle more than $12 billion daily. 74% of all stablecoins are issued on Ethereum, worth $30 billion. More than 5 million unique NFTs have been bought and sold for over $300 million. Amidst the burgeoning demand to access liquidity and activity on Ethereum, the network is straining under the weight of its own success. Moving more computation to Layer 2 networks is the best immediate solution to Ethereum’s high gas fees, and a number of such networks are already live. What’s missing is a simple user interface for switching between Mainnet and the various Layer 2 networks that an application might require.

Our new Custom Networks API is our latest step on the way to seamless cross-chain user experiences in MetaMask. It allows developers to recommend a variety of chains to their users, including Layer 2 networks like Polygon (formerly Matic), Arbitrum, and Optimism; sidechains like SKALE and xDAI; and indeed any EVM-compatible chain, including enterprise networks and testnets. These networks are then added to the user’s network menu with a simple confirmation, and the user is able to switch between networks using the familiar network switching menu.

We are excited to support the growth of Layer 2 networks, and look forward to seeing what the Ethereum community will build with cheaper and faster transactions. Even so, keep in mind that not all networks are created equally, and they make different trade-offs in order to scale. Be sure to understand the security and reliability tradeoffs of any network you add to MetaMask, and ensure that you trust the site recommending a new network. We encourage all users to read our guide to using custom networks in MetaMask.

Check out our docs to start recommending L2 networks to your users. If you’re a wallet developer interested in implementing this method, you will also want to check out the EIP-3085.