Skip to main content
CodeSpeedTest
Languages
Start TypingJump into a test — pick any languageAdaptive TrainingUnlock chars as you master themPractice DrillsFocused sessions targeting weak spotsDaily ChallengesNew coding challenges every dayRace ModeCompete against others in real timeAI OpponentRace against an AI at your WPM levelTournamentsLive coding speed tournamentsArcade GamesZType, Overkill Survival, Glyphica & moreGamificationXP, coins, badges & quests
LeaderboardGlobal rankings for every languageCertificatesEarn verifiable Bronze / Silver / Gold certsActivityDaily streaks & historical analyticsProfileYour stats, badges & achievements
Browse Languages500+ languages with real code examplesBlogTips, guides & deep divesFree ToolsWPM calculator, typing speed report & moreFAQCommon questions answeredGetting StartedNew to CodeSpeedTest?AboutOur story & missionSupportGet help — Pro users get priorityContactGet in touch with the team
Pricing
  1. Home
  2. /
  3. Learn
  4. /
  5. Move

Learn Move - 10 Code Examples & CST Typing Practice Test

Move is a safe, resource-oriented programming language originally developed for the Libra (now Diem) blockchain. It focuses on correctness, security, and formal verification, particularly for digital assets and smart contracts.

View all 10 Move code examples →
Simple Move Counter ModuleMove Bank Account ModuleMove Store Name ModuleMove Owned CounterMove Points Reward ModuleMove Boolean Flag ModuleMove Simple Map ModuleMove Token BalanceMove Access Control ExampleMove Event Emission Example

Learn MOVE with Real Code Examples

Updated Nov 25, 2025

Explain

Move enforces resource types - assets cannot be copied or lost unintentionally.

It has strong static typing and a formal verification model.

Designed to manage digital assets safely on blockchain networks.

Supports modules and scripts for reusable and composable logic.

Used by Diem, Aptos, Sui, and other blockchain ecosystems.

Core Features

Modules and scripts

Structs as first-class resources

Typed references and borrowing

Access control for resources

Compatibility with Move Virtual Machine (MVM)

Basic Concepts Overview

Resources - cannot be copied or discarded

Modules - reusable code units

Scripts - executable transactions

Structs with resource semantics

Functions with strict type safety

Project Structure

sources/ - Move modules

tests/ - unit and prover tests

scripts/ - transaction scripts

build/ - compiled bytecode

Move.toml - project config

Building Workflow

Write Move module (.move) file

Compile to bytecode

Test logic using Move Prover or testnet

Deploy module on chain

Interact via scripts or transactions

Difficulty Use Cases

Beginner: simple coin or token

Intermediate: multi-resource transactions

Advanced: NFT or DeFi module

Expert: formal verification proofs

Auditor: resource safety and module correctness

Comparisons

Move vs Solidity: Move is resource-safe; Solidity is feature-rich

Move vs Vyper: Move has ownership semantics; Vyper emphasizes simplicity

Move vs Rust: Move is resource-focused for blockchain; Rust is general-purpose

Move vs Cairo: Move targets asset-safe chains; Cairo targets STARK proofs

Move vs JavaScript: Move is strongly typed and blockchain-safe

Versioning Timeline

2019 - Move prototype (Libra)

2020 - Move language stabilization

2021 - Aptos adoption

2022 - Sui adoption

2023-2025 - Tooling and ecosystem expansion

Glossary

Move VM: Virtual machine executing Move bytecode

Resource: asset that cannot be copied or destroyed

Module: reusable code unit

Script: executable transaction

Prover: formal verification tool

Installation Setup

Install Rust (for Move CLI and toolchain)

Clone Move repository or install aptos-cli / sui-cli

Verify with `move --version` or `aptos move --version`

Compile modules using `move build`

Deploy using blockchain-specific CLI

Environment Setup

Install Rust

Install Move CLI / Aptos CLI / Sui CLI

Connect to local sandbox or testnet

Build modules

Deploy and test transactions

Config Files

Move.toml

sources/

tests/

scripts/

build/

Cli Commands

move build

move test

move clean

move prove

move publish

Internationalization

Docs available in English

Community translations emerging

Global Aptos/Sui developer support

Unicode-safe syntax

Cross-chain adoption possible

Accessibility

Explicit ownership aids safety

Readable module structure

Simple syntax for resource ops

Clear compiler errors

Good for formal verification beginners

Ui Styling

Not applicable (backend language)

Editor highlighting supported

VSCode / IntelliJ plugins

Move Playground UI

Syntax error highlighting

State Management

Resource storage in accounts

Struct-based storage

Global & local references

Access-controlled modules

Transaction logs

Data Management

Typed resources

Move vectors for arrays

No implicit copying

Event logging optional

Strong static layout

Architecture

Move source -> Move bytecode

Executed on Move Virtual Machine (MVM)

Modules define reusable resources and functions

Scripts execute transactions

Strict type & resource checking at compile-time

Rendering Model

Move source -> bytecode -> Move VM

Static type & resource checking

Module verification layer

Execution sandbox per transaction

Formal proofs optional but supported

Architectural Patterns

Module-based logic

Resource-oriented structs

Transaction script execution

Explicit ownership & references

Composable, auditable design

Real World Architectures

Token ecosystems

NFT marketplaces

Payment channels

DeFi lending protocols

Multi-signature wallets

Design Principles

Resource safety

Formal verification first

Explicit ownership

Composable modules

Predictable execution

Scalability Guide

Split logic into multiple modules

Avoid unbounded loops

Optimize resource storage

Use transaction batching

Keep scripts modular

Migration Guide

Rewrite Solidity contracts as Move modules

Convert assets to resources

Define scripts instead of transactions

Test formal properties

Deploy on Move VM-supported chains

Performance Notes

Efficient execution on Move VM

Resource safety prevents runtime errors

Static typing enables compiler optimizations

Transactions are predictable and auditable

Looping constructs are bounded for gas efficiency

Security Notes

Ownership rules prevent double-spending

Resource types enforce correct asset movement

No implicit copies or deletions

Formal verification tools available

Access control at module level

Monitoring Analytics

Track transaction events

Resource movement audit

Gas and execution metrics

Prover outputs

Blockchain monitoring dashboards

Code Quality

Use clear module names

Define strict resource rules

Write reusable scripts

Avoid unnecessary copies

Document access & ownership

Practical Examples

Simple token module

NFT minting and transfer

Payment channels

Multi-signature wallets

Resource-based DeFi primitives

Troubleshooting

Check type mismatches

Verify resource movement rules

Ensure correct module addresses

Fix borrow/reference errors

Test scripts on local sandbox

Testing Guide

Unit tests for modules

Use Move Prover for formal verification

Simulate transactions on local sandbox

Test edge-case resource movements

Validate access control policies

Deployment Options

Aptos CLI deployment

Sui CLI deployment

Testnet sandbox deployment

Integration via blockchain SDKs

Continuous deployment scripts

Tools Ecosystem

Move CLI

Aptos CLI

Sui CLI

Move Prover (formal verification)

Move Playground / IDE plugins

Integrations

Aptos blockchain

Sui blockchain

Testnets for safe experimentation

Move VM-compatible chains

Integration with wallets & SDKs

Productivity Tips

Keep modules small

Use Move Prover frequently

Write composable scripts

Document ownership flows

Leverage testnet sandboxes

Challenges

Limited ecosystem and libraries

Steep learning curve for resources

Formal verification adds complexity

Less documentation than Solidity

Requires blockchain-specific toolchain

Learning Path

Learn Rust basics

Understand blockchain & VM concepts

Learn Move syntax and modules

Write and test resource modules

Practice formal verification and transactions

Skill Improvement Plan

Week 1: Move syntax & types

Week 2: Modules & scripts

Week 3: Resources & references

Week 4: Testing & prover

Week 5: Deploy and integrate on Aptos/Sui

Interview Questions

What is a resource in Move?

How does Move prevent asset duplication?

Explain modules and scripts in Move.

How does Move support formal verification?

Difference between Move and Solidity?

Cheat Sheet

resource struct Coin { ... }

module Token { ... }

public(script) fun transfer(...) { ... }

let r = &mut resource_var;

move_to(account, resource_var)

Books

Programming Move

Move Language Guide

Resource-Oriented Smart Contracts

Aptos Development Handbook

Sui Smart Contract Patterns

Tutorials

Hello Move module

Mint your first token

NFT with Move

Testing with Move Prover

Advanced resource scripts

Official Docs

https://move-lang.dev

https://github.com/move-language/move

Community Links

Move GitHub Discussions

Aptos Discord

Sui Discord

StackOverflow Move tag

YouTube Move tutorials

Community Support

Move GitHub

Aptos Discord

Sui Community

StackOverflow Move tag

Move Forum Discussions

Monetization

Deploy token modules

Build NFT platforms

Offer Move auditing services

Consult on DeFi Move designs

Sell resource-safe smart contracts

Future Roadmap

Better IDE integration

Expanded library ecosystem

Formal verification improvements

Cross-chain Move VM support

Advanced tooling for Aptos/Sui

When Not To Use

General-purpose programming outside blockchain

Projects without resource/asset management

Ecosystems not supporting Move VM

Highly interactive front-end logic

Complex multi-chain systems not using Aptos/Sui

Final Summary

Move is a resource-oriented blockchain language.

Safe, formal-verifiable, and asset-focused.

Modules and scripts encapsulate logic.

Strong static typing and ownership rules.

Ideal for token, NFT, and DeFi applications.

Faq

Is Move safe for digital assets?

Yes - ownership semantics prevent accidental loss.

Can Move be used outside Aptos/Sui?

Limited - requires Move VM-compatible chain.

Does Move support inheritance?

No - uses modules and resource composition.

Is Move faster than Solidity?

Execution is predictable; speed depends on VM.

Can Move interact with Solidity contracts?

Directly no; requires cross-chain bridges or wrappers.

Code Sample Descriptions

1

Simple Move Counter Module

module 0x1::Counter {
    resource struct Counter { value: u64 }

    public fun create(): Counter {
        Counter { value: 0 }
    }

    public fun increment(counter: &mut Counter) {
        counter.value = counter.value + 1
    }

    public fun reset(counter: &mut Counter) {
        counter.value = 0
    }
}

Basic counter resource with increment and reset.

Let’s Try →
2

Move Bank Account Module

module 0x1::Bank {
    resource struct Account { balance: u64 }

    public fun create(): Account {
        Account { balance: 0 }
    }

    public fun deposit(acc: &mut Account, amount: u64) {
        acc.balance = acc.balance + amount
    }

    public fun withdraw(acc: &mut Account, amount: u64) {
        acc.balance = acc.balance - amount
    }
}

A simple bank account resource with deposit and withdraw.

Let’s Try →
3

Move Store Name Module

module 0x1::NameStore {
    resource struct Name { value: vector<u8> }

    public fun set_name(name: vector<u8>): Name {
        Name { value: name }
    }

    public fun update(n: &mut Name, new_name: vector<u8>) {
        n.value = new_name
    }
}

A resource storing a user's name on-chain.

Let’s Try →
4

Move Owned Counter

module 0x1::OwnedCounter {
    resource struct Counter { owner: address, value: u64 }

    public fun create(owner: address): Counter {
        Counter { owner, value: 0 }
    }

    public fun inc(c: &mut Counter, caller: address) {
        assert!(caller == c.owner, 1)
        c.value = c.value + 1
    }
}

Adds ownership to a counter resource.

Let’s Try →
5

Move Points Reward Module

module 0x1::Points {
    resource struct Score { value: u64 }

    public fun new(): Score {
        Score { value: 0 }
    }

    public fun add(score: &mut Score, pts: u64) {
        score.value = score.value + pts
    }
}

Simple reward points module.

Let’s Try →
6

Move Boolean Flag Module

module 0x1::Flag {
    resource struct Flag { enabled: bool }

    public fun new(): Flag {
        Flag { enabled: false }
    }

    public fun toggle(f: &mut Flag) {
        f.enabled = !f.enabled
    }
}

Stores and toggles a boolean value.

Let’s Try →
7

Move Simple Map Module

module 0x1::PairStore {
    resource struct Pair { a: u64, b: u64 }

    public fun create(a: u64, b: u64): Pair {
        Pair { a, b }
    }

    public fun update(p: &mut Pair, a: u64, b: u64) {
        p.a = a
        p.b = b
    }
}

Stores a pair of u64 values.

Let’s Try →
8

Move Token Balance

module 0x1::Token {
    resource struct Balance { amount: u64 }

    public fun mint(): Balance {
        Balance { amount: 100 }
    }

    public fun add(b: &mut Balance, amt: u64) {
        b.amount = b.amount + amt
    }
}

A minimal token balance resource.

Let’s Try →
9

Move Access Control Example

module 0x1::Access {
    resource struct Data { owner: address, value: u64 }

    public fun create(owner: address): Data {
        Data { owner, value: 0 }
    }

    public fun set(d: &mut Data, caller: address, v: u64) {
        assert!(caller == d.owner, 2)
        d.value = v
    }
}

Move module enforcing owner-only updates.

Let’s Try →
10

Move Event Emission Example

module 0x1::Events {
    struct IncrementEvent has drop { amount: u64 }
    resource struct Counter { value: u64, events: event::EventHandle<IncrementEvent> }

    public fun create(): Counter {
        Counter { value: 0, events: event::new_event_handle<IncrementEvent>(0x1) }
    }

    public fun inc(c: &mut Counter) {
        c.value = c.value + 1
        event::emit_event(&mut c.events, IncrementEvent { amount: c.value })
    }
}

Module showing basic event emission.

Let’s Try →

Frequently Asked Questions about Move

What is Move?

Move is a safe, resource-oriented programming language originally developed for the Libra (now Diem) blockchain. It focuses on correctness, security, and formal verification, particularly for digital assets and smart contracts.

What are the primary use cases for Move?

Digital assets and token management. NFT minting and transfers. Safe financial transactions. Blockchain governance modules. Custom resource-oriented logic

What are the strengths of Move?

Safe resource handling. Formal verification friendly. Explicit ownership semantics. Predictable execution. Suitable for asset-heavy applications

What are the limitations of Move?

Smaller developer ecosystem than Solidity. Limited tooling and libraries. Ecosystem mainly centered on Aptos and Sui. Learning curve for resource-oriented programming. Less general-purpose than other languages

How can I practice Move typing speed?

CodeSpeedTest offers 10+ real Move code examples for typing practice. You can measure your WPM, track accuracy, and improve your coding speed with guided exercises.

Learn Other Programming Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypherGremlinPartiqlHaskellElixirFsharpView all languages →
CodeSpeedTest

Improve your coding speed, code accuracy, and programming syntax WPM with practice sessions across 500+ programming languages.

Quick Links

HomeAboutFeaturesGetting StartedLanguages

Legal & Support

Pro ⚡ PricingContactPrivacy PolicyTerms of Service

Connect

CodeSpeedTest on GitHubCodeSpeedTest on TwitterEmail CodeSpeedTest

© 2026 CodeSpeedTest. All rights reserved.