Skip to main content
Moving from Solidity to Daml requires a significant mental shift. This page explains the paradigm differences and how to adapt your thinking.

Programming Model Comparison

State Model: Mutable vs. Immutable

Solidity: Mutable State

In Solidity, contracts have mutable storage that you modify directly:
Mental model: The contract is a persistent object with state you modify.

Daml: Immutable Contracts

In Daml, contracts are immutable data. State changes create new contracts or archive existing contracts:
Mental model: Contracts are facts. Exercise archives the fact and creates new facts.

UTXO vs. Account Model

Ethereum: Account Model

  • State is a global mapping of accounts to balances
  • Transfers modify account entries
  • Easy to query total balance
  • Contention on popular accounts

Canton: Extended UTXO Model

  • State is a set of contracts (like unspent outputs)
  • Transfers archive existing contracts, create new ones
  • Balance is sum of owned contracts
  • Better parallelism, explicit data flow

Language Comparison

Type System

Solidity Types

Daml Types

Solidity Control Flow

Daml Control Flow

Authorization Model

Solidity: Runtime Authorization

Issues:
  • Authorization checked at runtime
  • Easy to forget checks
  • Anyone can attempt the call
  • Authorization mixed with logic

Daml: Declarative Authorization

Benefits:
  • Authorization declared, not coded
  • Impossible to forget (compiler enforces)
  • Only authorized parties can attempt
  • Clear separation of concerns

Multi-Party Coordination

Solidity: Manual Multi-Sig

Daml: Native Multi-Party

Common Patterns Translated

What to Unlearn

Next Steps

Network Architecture

Compare network architecture and topology.

Module 3: Daml

Start writing Daml smart contracts.