Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
220 changes: 220 additions & 0 deletions docs/build/cadence-or-flow-evm
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
---
title: Cadence vs Flow EVM - Complete Developer Guide and Comparison
sidebar_label: Cadence vs Flow EVM
sidebar_position: 5
description: Complete comparison between Cadence and Flow EVM for Flow blockchain development. Learn when to use each platform, their benefits, limitations, and migration strategies for optimal Web3 development.
keywords:
- Cadence vs Flow EVM
- Flow blockchain development
- Cadence programming
- Flow EVM development
- Solidity on Flow
- blockchain platform comparison
- Web3 development guide
- smart contract development
- Flow development tools
- blockchain migration
- resource-oriented programming
- EVM compatibility
- Flow architecture
- blockchain security
- digital asset development
- MEV resistance
- native randomness
- account abstraction
- cross-VM development
- Flow benefits
- development decision framework
---

# Cadence vs Flow EVM: When to Use Each and Why
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be merged with and live in the same spot as: https://developers.flow.com/build/cadence/differences-vs-evm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My issue with the difference-vs-evm page is that it is way too in depth. Users should have a quick answer for what cadence and flow evm can provide and what should be used when. But not opposed to the idea of merging them


**Cadence** is ideal for projects requiring maximum security, native digital asset handling, and leveraging Flow's unique blockchain features. It's best for long-term projects where learning a new paradigm provides significant benefits.

**Flow EVM** is perfect for rapid deployment of existing Solidity projects, accessing Flow's performance benefits with minimal changes, and gradually adopting Flow's advanced features while maintaining Ethereum compatibility.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good, but I think we want input from @SeanRobb here


## Decision Framework: When to Use Each

### Choose **Cadence** When:

**Digital assets (NFTs/tokens) are core to your application**
**Security is paramount (financial applications, high-value assets)**
**You need native account abstraction and multi-signature support**
**Your app requires native randomness (games, lotteries)**
**You want to leverage Flow's unique features like MEV resistance**
**Building for long-term sustainable architecture**

### Choose **Flow EVM** When:

**Migrating existing Solidity contracts**
**You need immediate deployment with minimal changes**
**Using existing Ethereum tooling and libraries**
**You want Flow's low costs without learning Cadence**
**Integrating with existing EVM-based DeFi protocols**
**Testing Flow's performance with familiar tools**

## Detailed Comparison

| Aspect | Cadence | Flow EVM |
|--------|--------------|----------|
| **Learning Curve** | Low (if starting from zero) | High |
| **Security Model** | Resource-oriented, mathematically provable | Traditional EVM security |
| **Digital Asset Handling** | Native, built-in safety | Requires careful implementation |
| **Development Speed** | Faster development | Simpler migration |
| **Account Features** | Native multi-sig, key rotation | Through COAs or custom contracts |
| **Randomness** | Native VRF built-in | Via Cadence Arch precompiled contract |
| **Transaction Costs** | Ultra-low | Ultra-low |
| **Finality Time** | ~10 seconds | ~10 seconds |
| **Audit Requirements** | Lower (built-in safety) | Higher (manual security) |
| **Asset Safety** | Mathematical guarantees | Manual implementation |
| **Composability** | Native view functions | Standard EVM patterns |
| **Long-term Maintenance** | Lower (built-in features) | Standard (ongoing security) |
| **Unique Features** | VRF, MEV resistance, resources | Cross-VM integration, COAs |

## Cadence Benefits

### 🛡️ **Unparalleled Security**

- **Resource-oriented Programming**: Eliminates entire classes of bugs and security risks
- **No Double-spending**: Mathematical guarantees prevent asset duplication
- **Linear Types**: Resources must be explicitly handled, preventing loss
- **Capability-based Security**: Fine-grained access control with entitlements

### 💰 **Ultra-Low Costs**

- **Sub-penny Transactions**: Average cost far less than $0.01
- **Predictable Fees**: No gas wars or unpredictable spikes
- **Sponsored Transactions**: Built-in gasless transaction support
- **High Efficiency**: Flow's architecture reduces computational costs

### 🏦 **Native Digital Asset Support**

- **Built-in Asset Types**: NFTs and tokens are first-class citizens
- **Automatic Uniqueness**: Resources cannot be copied or duplicated
- **Secure Transfers**: Move semantics ensure safe asset movement
- **UUID Tracking**: Every resource has unique blockchain identifier

### 🎲 **Native Randomness (VRF)**

- **Protocol-level VRF**: No external oracles needed
- **Manipulation-resistant**: Secure against validator manipulation
- **Immediate Access**: Random values available instantly in transactions
- **Cost-effective**: No additional fees for randomness

### ⚖️ **MEV Resistance**

- **Multi-role Architecture**: Separates transaction roles
- **Fair Ordering**: Prevents front-running and sandwich attacks
- **Predictable Fees**: No hidden MEV costs
- **Equitable Access**: Same opportunities for all users

### 🧩 **Composability Features**

- **View Functions**: Access any public data across contracts
- **Complex Transactions**: Multi-contract atomic operations
- **Pre/Post Conditions**: Built-in transaction validation
- **Account Storage**: Direct asset storage in accounts

## Flow EVM Benefits

### 🚀 **Rapid Deployment**

- **Zero Code Changes**: Deploy existing Solidity contracts as-is
- **Familiar Tooling**: Use Hardhat, Remix, Foundry without changes
- **Known Patterns**: Apply existing Solidity knowledge directly
- **Quick Migration**: Move from other EVM chains in minutes

### 💰 **Ultra-Low Costs**

- **Sub-penny Transactions**: Average cost far less than $0.01
- **Predictable Fees**: No gas wars or unpredictable spikes
- **Sponsored Transactions**: Built-in gasless transaction support
- **High Efficiency**: Flow's architecture reduces computational costs

### ⚡ **Enhanced Performance**

- **True Finality**: Under 10 seconds vs minutes/hours on other chains
- **High Throughput**: Multi-node architecture supports scaling
- **Consistent Performance**: No network congestion issues

### 🌉 **Cross-VM Integration**

- **Atomic Operations**: Combine EVM and Cadence in single transactions
- **Native Bridge**: Seamless asset movement between VMs
- **COA Features**: Access Cadence features from Solidity
- **Enhanced Wallets**: Account abstraction through COAs

## Limitations

### Cadence Limitations

- **New Paradigm**: Resource-oriented programming requires mindset shift
- **Smaller Community**: Fewer developers and resources ( allows opportunities for first-movers)
- **Storage Model**: Account-based storage requires different planning

### Flow EVM Limitations

- **Traditional Vulnerabilities**: Susceptible to typical Solidity bugs
- **No Resource Safety**: Manual implementation of asset protection
- **Reentrancy Risks**: Standard EVM attack vectors remain
- **Access Control**: Requires manual permission systems
- **Gateway Configuration**: Advanced features need custom setup

## Ideal for Cadence

### 🎮 **Gaming & NFT Projects**

Flow's resource-oriented architecture provides true digital ownership through mathematical ownership guarantees, ensuring secure in-game assets that prevent duplication and maintain uniqueness. The platform offers fair randomness through native VRF for gameplay mechanics and supports complex asset systems with composable resources for sophisticated economies. Notable examples include NBA Top Shot, Disney Pinnacle, and NFL All Day.

### 💎 **High-Value Digital Assets**

Cadence excels with high-value digital assets where security and authenticity are paramount. Art NFTs benefit from resource safety that prevents accidental loss, while collectibles leverage built-in uniqueness and authenticity features. The platform also supports digital identity applications with secure identity tokens and credentials, as well as real estate tokens that provide secure ownership representation for physical and digital property.

### 🏦 **DeFi with Security Focus**

For DeFi applications prioritizing security, Cadence offers robust solutions across various protocols. Decentralized exchanges benefit from MEV-resistant trading mechanisms, while lending platforms leverage resource-based collateral safety to protect user funds. Yield farming strategies can be implemented with enhanced security through automated protocols, and insurance protocols utilize mathematical asset guarantees to provide reliable coverage and risk management.

### 🎲 **Randomness-Dependent Applications**

Applications requiring reliable randomness find Cadence particularly well-suited due to its native VRF capabilities. Lotteries can implement fair and transparent random selection processes, while gaming applications benefit from unpredictable outcomes that cannot be manipulated. The platform also supports fair distribution mechanisms for random allocation of limited resources, all backed by cryptographically secure and verifiable randomness that ensures trust and transparency across all use cases.

## Ideal for Flow EVM

### 🔄 **Existing Project Migration**

Flow EVM is ideal for existing project migration, allowing teams to leverage their current codebase and expertise. DeFi protocols can seamlessly move existing DEXes and lending platforms, while NFT marketplaces can deploy proven marketplace contracts with minimal modifications. DAO tooling including governance and voting systems can be migrated efficiently, and cross-chain protocols can extend their reach to the Flow network, taking advantage of Flow's unique features while maintaining familiar development patterns.

### 🌐 **Multi-chain Applications**

Multi-chain applications benefit significantly from Flow EVM's compatibility with existing EVM infrastructure. Cross-chain DeFi protocols can maintain consistent interfaces across multiple networks, while bridge applications seamlessly connect Flow with other EVM chains. The platform enables liquidity aggregation to access multiple network liquidity pools, and arbitrage bots can leverage Flow's low transaction costs for more profitable trading strategies across different networks.

### 📈 **Performance-Critical Applications**

Performance-critical applications thrive on Flow EVM due to its optimized infrastructure and cost efficiency. High-frequency trading systems benefit from fast finality times, while micro-transaction models become viable through ultra-low costs that enable entirely new business models. Gaming infrastructure leverages fast and cheap transactions to create seamless player experiences, and social applications can support frequent user interactions without the cost barriers typically associated with blockchain transactions.

## Cost-Benefit Analysis

### Cadence

- **Higher Initial Costs**: Learning curve and development time
- **Lower Long-term Costs**: Built-in features reduce future development
- **Security Benefits**: Fewer bugs and vulnerabilities over time
- **Maintenance**: Less ongoing security maintenance needed

### Flow EVM

- **Lower Initial Costs**: Immediate deployment with existing code
- **Standard Long-term Costs**: Similar to other EVM platforms
- **Migration Flexibility**: Option to upgrade to Cadence later
- **Tool Compatibility**: Leverages existing tooling investments

## ROI Considerations

### When Cadence Provides Higher ROI

Cadence provides higher ROI for projects with high-security requirements by reducing audit costs and preventing security incidents, while asset-heavy applications benefit from built-in asset safety that prevents costly bugs. Long-term projects see the investment pay off over extended development cycles, and teams gain access to unique features and capabilities that are simply unavailable on other platforms, providing competitive advantages that justify the initial learning investment.

### When Flow EVM Provides Higher ROI

Flow EVM provides higher ROI when time-to-market is critical, enabling faster deployment that captures market opportunities before competitors. Projects with existing codebases can leverage prior development investment rather than starting from scratch, while teams with Solidity expertise can utilize their existing knowledge without additional training. This approach is particularly valuable for market testing, allowing quick deployment of concepts for validation before committing to more extensive development efforts.