Cascadia
  • Welcome to Cascadia
    • Brand Guidelines
    • Official Links
  • Artificial Intelligence
    • Incentives
  • Developers
    • Addresses
    • CosmWasm
      • Smart Contracts
      • Install Requirements
      • Set your Environment
      • Optimization
      • Deployment
      • Multi-Chain Contracts
        • The Actor Model
      • CW1 Subkeys Contract
        • Guide
      • CW20 Base Contract
        • Guide
      • C721 Base Contract
        • Guide
      • Upload Contract
        • Create a WASM File
      • Sign and Verify
        • Guide
    • Solidity
      • Deployment
      • Verification
        • Block Explorer
        • Hardhat
  • Directory
    • Address
    • API
    • Applications
    • Explorer
    • Faucet
    • Genesis
    • Governance
    • GRPC
    • Guide
    • Peers
    • RPC
    • Snapshot
    • State Sync
    • Website
    • Websocket
  • Governance
    • Align
      • Cooldown Period
      • Functions
    • Off-Chain
    • On-Chain
      • Voting
    • Proposals
      • On-Chain Voting via CLI
      • Proposal (Example)
    • VeTokenomics
      • Model
      • Voting Power Calculation
    • Analytics
  • Network
    • ChainID & Address Prefix
    • Configuration
    • Consensus
    • Denomination
    • Distribution
      • Block Rewards
      • Gas Fees
    • ESG
    • Faucet
    • Modules
    • Parameters
    • Peers
  • Security
    • Disclosure Policy
    • Multisignature
  • Staking
    • Claim
    • Delegate
    • Manual
    • Redelegate
    • Undelegate
  • Use Cases
    • Business Development and Marketing
    • Consumer Relationship Management
  • Node
    • Cloud Platforms
      • Amazon Web Services
      • Google Cloud Platform
    • Snapshot
    • State-Sync
    • Upgrade
      • Automated
      • Manual
  • Validators
    • System Requirements
    • Installation
    • Reference
      • Customization
  • Community
    • Discord
    • Telegram
    • Twitter
  • Legal
    • Privacy Policy
    • Terms & Conditions
Powered by GitBook
On this page
Edit on GitHub
  1. Developers
  2. CosmWasm
  3. Multi-Chain Contracts

The Actor Model

PreviousMulti-Chain ContractsNextCW1 Subkeys Contract

Last updated 1 year ago

The CosmWasm actor model serves as a foundational design pattern. Each actor has its own isolated internal state and communicates with others solely through messages, avoiding direct calls.

Key insights from this approach include:

Loose Coupling: Actors are coupled mainly by the data format of the messages they exchange, akin to the boundary protocols in REST or RPC. This promotes scalability and interoperability.

Concurrency and Serialization: While the model theoretically supports concurrency, in CosmWasm, execution within each actor is serialized, preventing potential threats such as reentrancy attacks. This serialization ensures that an operation is completed fully before the next begins.

Atomic Execution: Ensuring multiple contract states change atomically can be challenging. CosmWasm employs an "optimistic update" approach. It executes all operations with the assumption they'll succeed and rolls back if any part fails, ensuring data consistency.

Security Enhancements: The model ensures that a contract's internal state remains private, allowing it to dictate valid state transitions. It's a safer paradigm than having unbounded access, which is more susceptible to vulnerabilities.

Locality Principle: Actors communicate only with known counterparts. For two actors to interact, an external message must introduce them, laying the foundation for dynamic communication topologies in a distributed setup.

Cross-chain Communication: The actor model naturally aligns with Inter-Blockchain Communication (IBC) due to its reliance on message-passing. While this is an advantage, it brings challenges when ensuring atomic execution across different chains.

For a more detailed explanation, read CosmWasm docs .

here