TLDR: Over the past year, Coinbase has invested in tooling to eliminate static content across our web frontend. This is the story of how we did it and why it’s important.
Coinbase Learn(ed)
The Coinbase educational portal, Coinbase Learn, launched in late 2020. Learn contains hundreds of beginner guides, practical tutorials, and market updates and is maintained by a dedicated team of content editors.
Our engineers explored various options for powering Learn. Ideally, we wanted a solution that would allow us to seamlessly integrate content into the Coinbase logged out experience.
Hosted options for blog-like content such as Medium provided too little flexibility.
The WordPress framework was too opinionated and directly tied to the UI.
We ended up opting for a headless CMS, specifically Contentful. Contentful is a content platform that delivers a headless approach to content as well as backend extensibility to integrate with our preferred tools and ways of working. Being “headless” means the CMS is UI agnostic — it separates the content from the experience, simply providing structured JSON to the frontend, which allows for us to totally control the frontend experience.
Integrating with Contentful was simply a matter of creating data structures representing different types of content (via the Contentful UI) and then mapping those data structures to React components (which handled actually rendering the data)
Our initial CMS architecture
Donning the Flightsuit
With Coinbase Learn under our belt and the Coinbase Direct Public Offering (DPO) on the horizon, a cohesion initiative kicked off (deemed Project Flightsuit). Project Flightsuit sought to bring a cohesive look and feel across Coinbase logged out properties as well as enforcing design standards across newly created landing pages.
While investigating the state of the Coinbase product landing pages, we uncovered 40 product surfaces spread across 15 different repositories / frontend applications. The various frontends were built using a variety of technologies — everything from React with Typescript (our current standard) to legacy Ruby on Rails templates, to static HTML.
A peek of our “Page Architecture” overview document
Leveraging the Contentful integration initially set up for Coinbase Learn, we began to create a set of “blocks” which could be used to standardize landing page layouts (while aligning around our new brand guidelines).
“Blocks,” also known as content types, are high-level components which combine to create landing pages. For example, a “Hero” block might contain a “Title”, “Subtitle” and “CTA Button” in the CMS, which corresponds to a React component on the frontend.
A “Hero Block” data structure (left) and the corresponding React component (right)
By creating a thoughtful “Block-based system” (and reworking our existing landing pages to use this system), we were able to efficiently migrate nearly all landing pages to a single frontend application, powered by React, and integrated with Contentful.
Once the block system was in place, migrating pages was a relatively simple task of dragging / dropping various blocks via the Contentful UI, and redirecting the old page routes to the new, CMS-driven alternative.
1, 2, Automate
Post-Project Flightsuit, our team focused on improving the usability and resiliency of the CMS. A few lessons learned:
Making the CMS easy-to-use for non-technical team members is extremely important. With our first pass at CMS landing pages, we had created some data structures with advanced features (such as generic layout creation) which were mostly only understood and serviceable by Engineers (thus defeating the main value prop of the CMS). We countered this by favoring editor experience above all else. By automating advanced features within Contentful wherever possible (such as automatically determining which layout would best suit a set of content), we could allow editors to focus on editing rather than building.
By integrating with Contentful (a third party), our frontends became dependent upon Contentful’s uptime. Contentful has a very consistent track record of nearly 100% uptime, but this reliance was challenged when Contentful experienced two outages due to some widespread DNS issues. (To be fair to Contentful, these outages were also experienced by some of the world’s largest websites and were the only instances we’ve seen where Contentful was unavailable). To ensure availability of our higher visibility pages (such as our homepage), we determined the best path forward was to introduce a reverse API proxy which leverages the stale-if-error header, in order for our CDN to serve cached content if the upstream call happens to fail. This allows us to stay up even if the CMS goes down (for X number of days).
Above: Our CMS architecture before and after adding the cached reverse proxy
3. Training new engineering teams on working with and extending the CMS was a primary focus. My team had become the sole source of knowledge of an increasingly-used system and were often sourced to onboard new engineers to the system on a one-off basis. To better spread the knowledge of the framework, we developed the CMS Ambassador Program, which aimed to train and bring together subject matter experts for the CMS throughout the company. The program begins with a 1.5 hour structured workshop where attendees learn the ins and outs of integrating with the CMS. While this program is currently driven in real-time and onboarding sessions are held as-needed, we are currently in the process of converting this to a self-service course via an internal training tool.
A snapshot of our internal CMS Ambassador workshop
Key Results
As 2021 comes to a close, we’re proud to look back at how far we’ve come over the past year. Here is the progress we’ve seen after successfully implementing our company-wide CMS:
Landing page creation time reduced from an average of 2 weeks to less than one day.
Content change turnaround time reduced from an hour-long process of code change/review/merge/deploy to under 10 mins, and without engineering involvement.
By the end of year, 90% of all top level surfaces will be covered. This means that nearly all top-level, logged out product surfaces on Coinbase will be powered via Contentful by end of year.
These efficiency gains have been achieved thanks largely to our leadership’s investment in infra and developer tooling. Coinbase truly cares about engineering excellence, developer experience, and automating routine processes.
We also couldn’t have achieved this without the hard work of some astoundingly thoughtful, talented individuals (each of whom I’m incredibly proud to work with):
Leon Haggarty, Askat Bakyev, João Melo, Stephen Lee, Wilhelm Willie, Bryant Gallardo, Guiherme Luersen, Raymond Sohn, Leonardo Zizzamia, Christopher Nascone (Eng)
Bobby Rasmusson, Russ Ballard (Product)
Ananth Chandrasekharan, Goutham Buchi, Manish Gupta (EVP of Eng)
We’re all excited to enter 2022 with a shiny, unified frontend and minimal one-off content change requests on the horizon. If you’re interested in joining Coinbase, check out our Careers page here. Here’s to a happy new year!
Scaling Content at Coinbase was originally published in The Coinbase Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.
A guide to the multi-chain future, sidechains, and layer-2 solutions
Around the Block from Coinbase Ventures sheds light on key trends in crypto. Written by Justin Mart & Connor Dempsey.
As of late 2021, Ethereum has grown to support thousands of applications from decentralized finance, NFTs, gaming and more. The entire network settles trillions of dollars in transactions annually, with over $170 billion locked on the platform.
But as the saying goes, more money, more problems. Ethereum’s decentralized design ends up limiting the amount of transactions it can process to just 15 per second. Since Ethereum’s popularity far exceeds 15 transactions per second, the result is long waits and fees as high as $200 per transaction. Ultimately, thisprices out many users and limits the types of applications Ethereum can handle today.
If smart-contract based blockchains are to ever grow to support finance and Web 3 applications for billions of users, scaling solutions are needed. Thankfully, the cavalry is beginning to arrive, with many proposed solutions coming online recently.
In this edition of Around The Block, we explore the crypto world’s collective quest to scale.*
To compete or to complement?
The goal is to increase the number of transactions that openly accessible smart contract platforms can handle, while retaining sufficient decentralization. Remember, it would be trivial to scale smart contract platforms through a centralized solution managed by a single entity (Visa can handle 45,000 transactions per second), but then we’d be right back to where we started: a world owned by a handful of powerful centralized actors.
The approaches being taken to fix this problem come twofold: (1) build brand new networks competitive to Ethereum that can handle more activity, or (2) build complementary networks that can handle Ethereum’s excess capacity.
Broadly, they break out across a few categories:
Layer 1 blockchains (competitive to Ethereum)
Sidechains (somewhat complementary to Ethereum)
Layer 2 networks (complementary to Ethereum)
While each differs in architecture and approach, the goal is the same: let users actually use the networks (eg, interact with DeFi, NFTs, etc) without paying exorbitant fees or experiencing long wait times.
Layer 1s
Ethereum is considered a layer 1 blockchain — an independent network that secures user funds and executes transactions all in one place. Want to swap 100 USDC for DAI using a DeFi application like Uniswap? Ethereum is where it all happens.
Competing layer 1s do everything Ethereum does, but in a brand new network, soup to nuts. They’re differentiated by new system designs that enable higher throughput, leading to lower transaction fees, but usually at the cost of increased centralization.
New layer 1s have come online in droves over the last 10 months, with the aggregate value on these networks rocketing from $0 to ~$75B over the same time period. This field is currently led by Solana, Avalanche, Terra, and Binance Smart Chain, each with growing ecosystems that have reached over $10 billion in value.
Leading non-ETH L1s by TVL
All layer 1s are in competition to attract both developers and users. Doing so without any of Ethereum’s tooling and infrastructure that make it easy to build and use applications, is difficult. To bridge this gap, many layer 1s employ a tactic called EVM compatibility.
EVM stands for the Ethereum Virtual Machine, and it’s essentially the brain that performs computation to make transactions happen. By making their networks compatible with the EVM, Ethereum developers can easily deploy their existing Ethereum applications to a new layer 1 by essentially copying and pasting their code. Users can also easily access EVM compatible layer 1s with their existing wallets, making it simple for them to migrate.
Take Binance Smart Chain (BSC) as an example. By launching an EVM compatible network and tweaking the consensus design to enable higher throughput and cheaper transactions, BSC saw usage explode last summer across dozens of DeFi applications all resembling popular Ethereum apps like Uniswap and Curve. Avalanche, Fantom, Tron, and Celo have also taken the same approach.
Conversely, Terra and Solana do not currently support EVM compatibility.
TVL of EVM compatible vs non-EVM compatible L1s
Interoperable Chains
In a slightly different layer 1 bucket are blockchain ecosystems like Cosmos and Polkadot. Rather than build new stand-alone blockchains, these projects built standards that let developers create application specific blockchains capable of talking to each other. This can allow, for example, tokens from a gaming blockchain to be used within applications built on a separate blockchain for social networking.
There is currently over $100B+ sitting on chains built using Cosmos’ standard that can eventually interoperate. Meanwhile, Polkadot recently reached a milestone that will similarly unite its ecosystem of blockchains.
In short, there’s now a diverse landscape of direct Ethereum competitors, with more on the way.
Sidechains
The distinction between sidechains and new layer 1s is admittedly a fuzzy one. Sidechains are very similar to EVM-compatible layer 1s, except that they’ve been purpose built to handle Ethereum’s excess capacity, rather than compete with Ethereum as a whole. These ecosystems are closely aligned with the Ethereum community and host Ethereum apps in a complementary fashion.
Axie Infinity’s Ronin sidechain is a prime example. Axie Infinity is an NFT game originally built on Ethereum. Since Ethereum fees made playing the game prohibitively expensive, the Ronin sidechain was built to allow users to move their NFTs and tokens from Ethereum to a low fee environment. This made the game affordable to more users, and preceded an explosion in the game’s popularity.
As of this writing, users have moved over $7.5B from Ethereum to Ronin to play Axie Infinity.
Polygon POS
Where sidechains like Ronin are application specific, others are suited for more general purpose applications. Right now, Polygon’s proof-of-stake (POS) sidechain is the industry leader with nearly $5B in value deployed over 100 DeFi and gaming applications including familiar names like Aave and Sushiswap, as well as a Uniswap clone called Quickswap.
Again, Polygon POS really doesn’t look that different from an EVM compatible layer-1. However, it’s been built as part of a framework to scale Ethereum rather than compete with it. The Polygon team sees a future where Ethereum remains the dominant blockchain for high value transactions and value storage, while everyday transactions move to Polygon’s lower-cost blockchains. (Polygon POS also maintains a special relationship with Ethereum through a process known as checkpointing).
With transaction fees of less than a penny, Polygon’s vision of the future looks plausible. And with the help of incentive programs, users have flocked to Polygon POS with daily transactions surpassing Ethereum (though spam transactions inflate this number).
Layer 2s (Rollups)
Layer 1s and sidechains both have a distinct challenge: securing their blockchains. To do so, they must pay a new cohort of miners or proof of stake validators to verify and secure transactions, usually in the form of inflation from a base token (e.g. Polygon’s $MATIC, Avalanche’s $AVAX).
However, this brings notable downsides:
Having a base token naturally makes your ecosystem more competitive rather than complementary to Ethereum
Validating and securing transactions is a complex and challenging task that your network is responsible for indefinitely
Wouldn’t it be nice if we could create scalable ecosystems that borrowed from Ethereum’s security? Enter layer 2 networks, and “rollups” in particular. In a nutshell, layer 2s are independent ecosystems that sit on top of Ethereum in such a way that relies on Ethereum for security.
Critically, this means that layer 2s do not need to have a native token — so not only are they more complementary to Ethereum, they are essentially part of Ethereum. The Ethereum roadmap even pays homage to this idea by signaling that Ethereum 2.0 will be “rollup centric.”
How rollups work
Layer 2s are commonly called rollups because they “rollup” or bundle transactions together and execute them in a new environment, before sending the updated transaction data back to Ethereum. Rather than have the Ethereum network process 1,000 Uniswap transactions individually (expensive!), the computation is offloaded on a layer 2 rollup before submitting the results back to Ethereum (cheap!).
However, when results are posted back to Ethereum, how does Ethereum know that the data is correct and valid? And how can Ethereum prevent anyone from posting incorrect information? These are critical questions that differentiate the two types of rollups: Optimistic rollups, and Zero Knowledge rollups (ZK rollups).
Optimistic Rollups
When submitting results back to Ethereum, optimistic rollups “optimistically” assume that they’re valid. In other words, they let the operators of the rollup post any data they want (including potentially incorrect / fraudulent data), and just assume it’s correct — an optimistic outlook no doubt! But there are ways to fight fraud. As a check and balance, there is a window of time after any withdrawal where anyone watching can call out fraud (remember blockchains are transparent, anyone can watch what’s happening). In the event that one of these watchers can mathematically prove that fraud occurred (by submitting a fraud proof), the rollup reverts any fraudulent transactions and penalizes the bad actor and rewards the watcher (a clever incentive system!).
The drawback is a brief delay when you move funds between the rollup and Ethereum, waiting to see if any watchers catch any fraud. In some cases this can be up to a week, but we expect these delays to come down over time.
The key point is that optimistic rollups are intrinsically tied to Ethereum and ready to help Ethereum scale today. Accordingly, we’ve seen strong nascent growth with many leading DeFi projects moving to the leading optimistic rollups — Arbitrum and Optimistic Ethereum.
Arbitrum & Optimistic Ethereum
Arbitrum (by Off-chain Labs) and Optimistic Ethereum (by Optimism) are the two main projects implementing optimistic rollups today. Notably, both are still in their early stages, with both companies maintaining levels of centralized control but with plans to decentralize over time.
It’s estimated that once mature, optimistic roll ups can offer anywhere from a 10–100x improvement in scalability. Even in their early days, DeFi applications on Arbitrum and Optimism have already accrued billions in network value.
Optimism is earlier in its adoption curve with over $300M in TVL deployed across 7 DeFi applications, most notably Uniswap, Synthetix, and 1inch.
Arbitrum is further along, with around $2.5B in TVL across 60+ applications including familiar DeFi protocols like Curve, Sushiswap, and Balancer.
Aribtrum has also been selected as Reddit’s scaling solution of choice for their long awaited efforts to tokenize community points for the social media platform’s 500 million monthly active users.
ZK Rollups
Where optimistic rollups assume the transactions are valid and leave room for others to prove fraud, ZK rollups do the work of actually proving to the Ethereum network that transactions are valid.
Along with the results of the bundled transactions, they submit what’s called a validity proof to an Ethereum smart contract. As the name suggests, validity proofs let the Ethereum network verify that the transactions are valid, making it impossible for the relayer to cheat the system. This eliminates the need for a fraud proof window, so moving funds between Ethereum and ZK-rollups is effectively instant.
While instant settlement and no withdrawal times sound great, ZK rollups are not without tradeoffs. First, generating validity proofs is computationally intensive, so you need high powered machines to make them work. Second, the complexity surrounding validity proofs makes it more difficult to support EVM compatibility, limiting the types of smart contracts that can be deployed to ZK-rollups. As such, optimistic rollups have been first to market and are more capable of addressing Ethereum’s scaling woes today, but ZK-rollups may become a better technical solution in the long run.
ZK Rollup Adoption
The ZK rollup landscape runs deep, with multiple teams and implementations in the works and in production. Some prominent players include Starkware, Matter Labs, Hermez, and Aztec. Today, ZK-rollups mainly support relatively simple applications such as payments or exchanges (owing to limitations on what types of applications ZK-rollups can support today). For example, derivatives exchange dYdX employs a ZK rollup solution from Starkware (StarkEx) to support nearly 5 million weekly transactions and $1B+ in TVL.
The real prize however, is ZK rollup solutions that are fully EVM compatible and thus capable of supporting popular general applications (like the full suite of DeFi apps) without the withdrawal delays of optimistic rollups. The main players in this realm are MatterLab’s zkSync 2.0, Starkware’s Starknet, Polygon Hermez’s zkEVM, and Polygon Miden, which are all currently working towards mainnet launch. (Aztec, meanwhile, is focused on applying zk proofs to privacy).
Many in the industry (Vitalik included) are looking at ZK rollups in conjunction with Ethereum 2.0 as the long term solution to scaling Ethereum, mainly stemming from their ability to fundamentally handle hundreds of thousands of transactions per second without compromising on security or decentralization.The upcoming rollouts of fully EVM compatible ZK rollups will be one of the key things to watch as the quest to scale Ethereum progresses.
A fragmenting world
In the long run, these scaling solutions are necessary if smart contract platforms are to scale to billions of users. In the near term, these solutions, however, may present significant challenges for users and crypto operators alike. Navigating from Ethereum to these networks requires using cross-chain bridges, which is complex for users and carries latent risk. For example, several cross-chain bridges have already been the target of $100+ million dollar exploits.
More importantly, the multi-chain world fragments composability and liquidity. Consider that Sushiswap is currently implemented on Ethereum, Binance Smart Chain, Avalanche, Polygon, and Arbitrum. Where Sushiswap’s liquidity was once concentrated on one network (Ethereum), it’s now spread across five different networks.
Ethereum applications have long benefited from composability — i.e. Sushiswap on Ethereum is plug-and-play with other Ethereum apps like Aave or Compound. As applications spread out to new networks, an application implemented on one layer 1/sidechain/layer 2 is no longer composable with apps implemented on another, limiting usability and creating challenges for users and developers.
An uncertain future
Will new layer 1s like Avalanche or Solana continue to grow to compete with Ethereum? Will blockchain ecosystems like Cosmos or Polkadot proliferate? Will sidechains continue to run in harmony with Ethereum, taking on its excess capacity? Or will rollups in conjunction with Ethereum 2.0 win out? No one can say for sure.
While the future is uncertain, everyone can take solace in the knowledge that there are so many smart teams dedicated to tackling the most challenging problems that open, permissionless networks face. Just as broadband ultimately helped the internet support a host of revolutionary applications like YouTube and Uber, we believe that we’ll eventually look at the winning scaling solutions in the same light.
* This post focuses on scaling smart-contract based blockchains. Bitcoin scaling is best saved for a future post.
Scaling Ethereum & crypto for a billion users was originally published in The Coinbase Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.
The long-awaited layer two scaling solutions upgrade for Uniswap has finally been spotted in the wild with the launch of version 3 on Optimistic Ethereum.
In a post on July 13, the world’s most popular decentralized exchange stated that it was pleased to finally announce the alpha launch of Uniswap v3 on the Optimistic Ethereum (OΞ) mainnet.
The alpha launch is a limited version of the full system which helps developers deploy the system gradually and address any issues that may arise. The blog post elaborated:
“Please treat this as an early alpha product. Optimistic Ethereum is a complex Layer 2 scaling solution still in need of rigorous battle testing.”
The DEX warned of potential downtime, and stated that withdrawals from OΞ to layer one will take seven days. It also stated that there are limited assets at launch, namely ETH, USDT, WBTC, DAI, and SNX, but more will be added in the coming days and weeks.
During the alpha period, the platform will support an initial throughput of 0.6 transactions per second. It added that this should equate to a transaction capacity roughly in line with layer one, but transactions on OΞ confirm instantly meaning there are no more pending or stuck swaps.
Uniswap explained that assuming v3 has equal usage to layer one, OΞ should offer transaction cost savings of up to ten times, however increased demand will drive gas costs higher. The transaction speeds will be increased over the coming weeks and months as the infrastructure is tested and optimized at scale.
Protocol founder Hayden Adams commented on the launch and high-speed transaction capabilities, adding:
“Building general purpose Optimistic Rollups is an extraordinary undertaking and a critical step for decentralized finance to gain mass adoption.”
1/
It’s happening
Instant transactions and a steady increase in scaling w/ the end goal of fully meeting demand for low cost, high speed DEX trading
All built on Ethereum and preserving decentralization https://t.co/SyVtUsswYW
Related:Will the launch of Uniswap v3 spark a new DeFi boom?
Initial users have been impressed, with Bankless founder David Hoffman exclaiming “It’s instantaneous and insanely cheap. 5 swaps in 30 seconds, and I wasn’t even trying to be fast.”
Uniswap said that the scaling solution is complementary to Ethereum 2.0:
“Scaling Ethereum will be an iterative process, but this is a major step forward. Optimistic Rollups and ETH 2.0 are complementary scaling solutions and together will propel DeFi to mainstream adoption.”
OΞ uses an optimistic rollup which changes the zero-knowledge consensus principle by assuming that all transaction verifications are correct. Users only intervene only if they see an incorrect transaction whereby they can submit a “fraud-proof” to signal that the data is incorrect.
DeFi platform Synthetix has also announced the launch of Optimistic Ethereum for its layer two exchange for the week beginning July 26. In late May, the Ethereum layer two scaling solutions provider announced a collaboration with blockchain analytics platform Etherscan.