From Ethereum To Flow – An Introduction To The Flow Blockchain
Tags: web3, flow, blockchain, cadence
Published: 2022-09-16 10:05:21


![Cover Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tx02co02si85vw9aolz6.jpg)

In the fast-paced world of Web3, there is no shortage of innovative new technologies to explore. If you are a Solidity developer looking to build on a blockchain that is **faster, safer, and more scalable than Ethereum**, then Flow is an option you can’t ignore. 

Flow was built from the ground up as an alternative to slower, less user-friendly layer 1 blockchains with its own custom-built smart contract language, one optimized for creating and managing digital assets.

This article will introduce the Flow blockchain in greater detail, unpack its smart contract language Cadence, and look at exactly why an Ethereum developer should consider building on Flow.

## What Is Flow?

In 2017, a new Ethereum collectibles game, CryptoKitties, developed by the Canadian company [Dapper Labs](https://www.dapperlabs.com/), made headlines after it caused the Ethereum network massive congestion while only having 10,000 users. The developers at Dapper Labs quickly realized that the Ethereum network was not optimized to operate and scale a successful game, so they started working on an alternative.  

The end result of Dapper Lab’s efforts is the **Flow Blockchain**—a decentralized and developer-friendly blockchain designed to scale without [sharding](https://ethereum.org/en/upgrades/sharding/). Flow is highly optimized for the creation and management of digital assets such as NFTs.

### The Four Main Pillars of Flow

The Flow blockchain has four key pillars at its foundation:

* Multi-role architecture
* Resource-oriented programming
* Developer ergonomics
* Consumer onboarding

These four pillars set Flow apart and help solve common challenges typically faced by other blockchains. Let’s look at each of these items in detail.

#### Multi-role architecture

Flow’s unique design uses a **multi-role architecture** that allows the network to scale. This is achieved with a validator node that is separated into four different roles: collection, consensus, execution, and verification. Simply put, the collection node **batches**, the consensus node **secures**, the execution node **completes**, and the verification node **checks** the work. Every node still participates in validating transactions, but they each specialize in different stages of the process, effectively increasing the transaction throughput.

![Illustration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/997xu7qqjmiiuekfv4e1.gif)

#### Resource-oriented programming

Flow's second pillar is **resource-oriented programming**. Cadence is a resource-oriented programming language that is used to develop smart contracts on the Flow blockchain. This optimized smart contract language uses a strong, static type system which helps minimize errors. It also allows pre- and post-conditions to be used, so developers can enforce expected behaviors. We'll cover more on Cadence in the next section.

#### Developer ergonomics

Developer ergonomics is the third pillar of Flow. From the beginning, the Flow creators focused on supporting developers and making their lives easier.

* The Cadence smart contract language was built from the ground up to make creating and managing assets efficient and less prone to errors.
*Open-source tooling - such as the [Flow JavaScript SDK](https://github.com/onflow/flow-js-sdk), [Flow Go SDK](https://github.com/onflow/flow-go-sdk), and [Flow Playground GUI](https://github.com/onflow/flow-playground) - makes getting started on Flow a smooth process.
* Upgradeable smart contracts help minimize bugs in code, creating a more secure ecosystem overall (more on contract immutability below).
* Built-in logging support gives developers a means to trace a program's behavior. This is a much sought-after feature that many blockchain ecosystems cannot provide.

#### Consumer onboarding

Creating a consumer-friendly onboarding experience for new users is the fourth pillar of Flow. Human-readable security ensures users make informed decisions when running transactions. For example, instead of signing a transaction of hashes or confusing numbers and letters, Flow's human-readable transactions ensure a level of transparency, clearly stating what permissions a user may be authorizing.

The account model for Flow also keeps users in mind. [Flow wallets](https://developers.flow.com/nodes/flow-port) feature built-in, optional, and modular smart contract functionality which enable more complex authorization controls or automated processes. These features in turn create a better experience by making sure users cannot lose their assets while also providing options for account recovery in case of lost keys. Additionally, multi-signature support equips wallets with added security by allowing users to regularly cycle old keys.

## What Is Cadence?

Along with the faster, more scalable blockchain, Flow's developer team created [a new smart contract language](https://open-cadence.onflow.org/), **Cadence**. Digital assets are one of the most important aspects of blockchain development, and now there is finally a language that optimizes their creation and management.

Cadence's syntax takes inspiration from other modern programming languages such as Swift, Kotlin, and Rust. It is the first high-level, resource-oriented programming language and utilizes a strong static type system. This effectively helps cut down on runtime errors and ensures expected behavior.

What does resource-oriented mean? In Cadence, special data types, called resources, are based on linear data types and represent digital ownership of assets on Flow. These resources, such as NFTs, are stored directly in a user's account, rather than reflected as a record on a public digital ledger, and can only exist in one place at a time. This means the ownership of digital assets on Flow is defined directly in the language itself, effectively removing the risks involved with storing balances on a centralized digital ledger.

Additionally, Cadence improves asset management through the enforcement of strict rules that govern possible operations. Devs must define resource types with an '@' symbol before explicitly moving, storing, or destroying them. This forced management of assets removes the possibility of losing or accidentally deleting an asset because of an error in the code and reduces human error.

Cadence, similar to Flow, is built on pillars - this time, five of them:

* **Safety and security** - Cadence uses a strong static type system, built-in ownership primitives based on linear types, and a foundational focus on asset management to ensure expected behavior of code and minimize attack vectors for hackers.
* **Clarity** - The declarative nature of Cadence ensures developers are explicit with their intentions, making the code easier to read, write, and audit.
* **Approachability** - Cadence's syntax and semantics are inspired by languages such as Swift and Rust, which make it familiar, while thorough documentation and efficient tooling create an approachable environment for developers to [quickly get up to speed](https://github.com/emerald-dao/beginner-cadence-course).
* **Developer experience** - The Flow ecosystem provides [resources](https://developers.flow.com/) to deliver support throughout the entire development lifecycle.
* **Intuiting ownership with resources** - The concept of asset ownership is built into the Cadence language itself through the use of resources, rather than a central ledger. Assets are directly tied to an account's storage and can be freely transferred without a smart contract.

## Why Should Developers Build on Flow?

With all the protocol improvements introduced by Flow, they are clearly ushering in a new era of blockchain technology that focuses on developer acquisition and user experience. The [suite of tools](https://developers.flow.com/tools) available enable a productive development lifecycle, while their extensive [architecture guidelines](https://developers.flow.com/flow/dapp-development/DappArchitectures) ensure devs coming from Ethereum, or new to Web3 in general, have a thorough understanding of the types of solutions Flow is optimized for.

Tools such as the [Flow Client Library (FCL) JS](https://developers.flow.com/tools/fcl-js) and [Flowser](https://docs.flowser.dev/) make getting started easier than ever. The FCL JS package makes wallet integrations extremely easy, while its powerful SDK provides all the tools necessary to create dapps quickly and securely. Flowser (Flow Browser) is one of the most innovative new blockchain development tools, allowing you to not only inspect the states of Flow mainnet, testnets, or emulators, but also manage custom emulators and wallets through its GUI.

Additionally, the Flow blockchain [prioritizes environmental impact](https://flow.com/sustainability) just as much as other aspects of the protocol. And for this reason, it is arguably one of the most eco-friendly blockchains on the planet. Not only do they use less energy than every proof of work blockchain, but most proof of stake blockchains as well. This is thanks to its consensus mechanism and unique multi-role architecture mentioned earlier in this article. To put its energy use into perspective, for the energy cost of performing one Google search, you could create 12 Flow NFTs.

So let's dive a little deeper into why developers should build on Flow by comparing it to Web3's largest contributor, Ethereum.

### Flow and Ethereum: A Closer Look

To get a better idea of how Flow compares to Ethereum, let's take a closer look at a couple of important aspects and differences.

#### Transaction fees and speed

Ethereum is notorious for having extremely expensive transaction costs when network demand is high. The high fees are a mechanism used by the network to keep transaction volume at a manageable level. When blockspace demand is high, the fees go up to discourage people from deploying. Additionally, blocks on Ethereum are confirmed every 12 to 14 seconds, with finalization occurring within 6 blocks, or just over a minute. This leads to a maximum transactional throughput of ~15 transactions per second. In order to serve the needs of millions of users, significant improvements must be made.

Flow, on the other hand, was created with these challenges in mind. The multirole architecture mentioned above enables block finalization to occur roughly **every 2.5 seconds**, which leads to approximately **100 transactions per second**. The fees to deploy and transact on mainnet are also just a fraction of what they would be on Ethereum's mainnet.

#### Contract immutability

Depending how you look at it, the immutability of Ethereum smart contracts once deployed can either be a good thing or a bad thing. On one hand, not being able to edit smart contracts after they've been deployed ensures a certain level of trust. It confirms that the code you are interacting with can't be changed or repurposed once it's live. On the flip side, code is rarely deployed in perfect shape, even with teams of incredibly skilled coders. Any small imperfection can lead to massive breaches, resulting in major losses. In order to fix a flawed smart contract, developers must deploy a whole new contract and ensure their user base uses that one instead.

Flow takes the above scenario into consideration with their approach to smart contract immutability. When contracts are deployed to the Flow blockchain, they are mutable by default. This means that developers can easily make changes should any complications arise with the live contract. Of course, this doesn't imply smart contracts skip the testing phase altogether. Teams developing contracts will typically use software development best practices to test and iterate on contracts in testnet before final deployment to mainnet.

After some time has passed on mainnet, and the smart contract has met any final testing or security checks, developers have the option to revoke the keys to the account holding the smart contract. This process eliminates the ability to make any further changes, effectively making the smart contract immutable. The ability for smart contract developers to enforce immutability on any contract at any time is a clear advantage Flow has over Ethereum and other blockchain networks.

### Growing Ecosystem

Beyond the technical advantages, Flow's community is growing at a rapid pace. A strong developer ecosystem, accessible network participation, and content partners are all helping with awareness and leading to a steady increase of transactions on Flow. June 2022 was a record-breaking month for Flow, reaching close to 34 million transactions.

Most people think of NBA TopShot when they hear Flow blockchain; however, Flow has seen rapid expansion in the DeFi and gaming space. Leading the gaming space, [Chainmonsters](https://chainmonsters.com/) and [Zeedz](https://www.zeedz.io/) have the highest sales according to [Flowverse](https://www.flowverse.co/), a Flow Blockchain aggregator. DeFi projects include decentralized exchanges [BloctoSwap](https://swap.blocto.app/), built by Blocto, and [IncrementFi](https://increment.fi/). You can take a look at some of the other projects that have been built on Flow [here](https://www.flowverse.co/projects).

The Flow ecosystem also received $725 million from the [Flow Ecosystem Fund](https://flow.com/ecosystemsupport) to help developers who are building on Flow. With the added incentive to build, the number of projects deciding to build on Flow will continue to bloom.

With the technical advantages, increasing popularity, and availability of funding on Flow, the need for Flow/Cadence developers has never been higher.

## Conclusion

Following the success of CryptoKitties, the Dapper Labs team quickly realized that Ethereum was not in a state to support a massively successful blockchain game. Their struggles with Ethereum led to the creation of the Flow blockchain and Cadence smart contract language, both optimized for the creation and management of digital assets.

There has never been a better time for Ethereum and Solidity devs to start building on a faster, safer, and more scalable blockchain. If you're interested in learning more about developing on Flow or how to use Cadence, you can visit the new [developer portal](https://developers.flow.com/). There, you'll find more information on how to get started.

Have a really great day!