# Sui Move Lecture #2 Project Architecture

By [Artech.Club](https://paragraph.com/@artechclub) · 2023-05-16

---

Following the introduction of [lecture #1,](https://mirror.xyz/artechclub.eth/DdRxc2eTPSjvgkBtlmrV5DSZg0UqkKqjWUXVnezA2rM) let’s dive into the details of Sui Move language.

Sui Project Architecture
------------------------

### Move VS Solidity

Move is a programming language designed specifically for the Libra blockchain, whereas Solidity is primarily used for developing smart contracts on the Ethereum blockchain. While both languages serve a similar purpose, their underlying blockchain platforms have different architectures and designs, which may impact the way developers use the languages.

Move and Solidity have different approaches to implementing smart contract functionality. Move uses resource types, which are special types of values that can only be owned by one account at a time. Solidity, on the other hand, uses an account-based model where each account has an associated balance and can perform actions on behalf of that account. This fundamental difference impacts the way smart contracts are designed and implemented in each language.

### Sui Modules and Packages

*   A Sui module is a set of **functions** and **types** packed together which the developer publishes under a specific address
    
*   The Sui standard library is published under the `0x2` [address](https://suiexplorer.com/object/0x0000000000000000000000000000000000000000000000000000000000000002), while user-deployed modules are published under a pseudorandom address assigned by the Sui Move VM
    
*   Module starts with the `module` keyword, which is followed by module name and curly braces - inside them module contents are placed:
    
    Example from explorer:
    
    [https://suiexplorer.com/object/0x2eeaab737b37137b94bfa8f841f92e36a153641119da3456dec1926b9960d9be?module=pool\_script](https://suiexplorer.com/object/0x2eeaab737b37137b94bfa8f841f92e36a153641119da3456dec1926b9960d9be?module=pool_script)
    
        module hello_world {
            // module contents
        }
        
    
*   Published modules are immutable objects in Sui; an immutable object is an object that can never be mutated, transferred or deleted. Because of this immutability, the object is not owned by anyone, and hence it can be used by anyone
    
*   A Move package is just a collection of modules with a manifest file called Move.toml. Example:
    

### Initializing a Sui Move Package

Use the following [Sui CLI](https://docs.sui.io/build/cli-client) command to start a skeleton Sui package:

    sui move new <PACKAGE NAME>
    

For our example in this unit, we will start a Hello World project:

    sui move new hello_world
    

This creates:

*   the project root folder `hello_world`
    
*   the `Move.toml` manifest file
    
*   the `sources` subfolder which will contain Sui Move smart contract source files
    

![](https://storage.googleapis.com/papyrus_images/0220e8f90189c3293c89d33786f5e0c78a339dee2bfa5cb6979a6c3eef8c6705.png)

### Move.toml Manifest Structure

`Move.toml` is the manifest file of a package and is automatically generated in the project root folder.

`Move.toml` consists of three sections:

*   `[package]` Defines the name and version number of the package
    
*   `[dependencies]` Defines other packages that this package depends on, such as the Sui standard library; other third-party dependencies should be added here as well
    
*   `[addresses]` Defines aliases for addresses in the package source code
    
    **Sample Move.toml File**
    
    This is the `Move.toml` generated by the Sui CLI with the package name `hello_world`:
    

    [package]
    name = "hello_world"
    version = "0.0.1"
    
    [dependencies]
    Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet" }
    
    [addresses]
    hello_world =  "0x0"
    sui =  "0000000000000000000000000000000000000000000000000000000000000002"
    

We see that the Sui standard library dependency here is defined using a GitHub repo, but it can also point to a local binary using its relative or absolute file path, for example:

    [dependencies]
    Sui = { local = "../sui/crates/sui-framework/packages/sui-framework" }
    

Sui Module and Package Naming

Sui Move module and package naming convention uses [snake casing](https://en.wikipedia.org/wiki/Snake_case), i.e. `this_is_snake_casing`.

A Sui module name uses the Rust path separator `::` to divide the package name and the module name, examples:

`unit_one::hello_world` \- hello\_world module in unit\_one package

`capy::capy` \- capy module in capy package

For more information on Move naming conventions, please check the [style section](https://move-language.github.io/move/coding-conventions.html#naming) of the Move book.

Examples from explorer:

![](https://storage.googleapis.com/papyrus_images/ef260110a12b55fe94e717003395b22c1898d26196a488c88fc0254674950aae.png)

**Reference:**

[https://github.com/sui-foundation/sui-move-intro-course/blob/main/unit-one/lessons/2\_sui\_project\_structure.md](https://github.com/sui-foundation/sui-move-intro-course/blob/main/unit-one/lessons/2_sui_project_structure.md)

---

*Originally published on [Artech.Club](https://paragraph.com/@artechclub/sui-move-lecture-2-project-architecture)*
