Coding for blockchain and other computing environments shares many similarities, but much of the focus on blockchain is devoted to building smart contracts. Deployed as compiled code, Smart contracts are essentially apps that automatically execute transactions on the blockchain. The Sui virtual machine, native to the Sui network, processes smart contracts written in the Move programming language.

The term, "smart contract," implies the unique transaction-focused environment of blockchain networks. And given the permissionless, public environment of the blockchain, smart contracts need to enforce rules to govern transactions, building a certain amount of trust into the system.

Move gives smart contracts on Sui an edge over other networks in that it builds in security and makes objects, such as NFTs or any other digital asset, a first class concept. Elevating objects in this manner means developers don't need to manage data at the byte-code level.

Manipulating objects

Similar to an enterprise microservices architecture, the blockchain hosts many smart contracts that execute an action based on particular events. To some extent, the work being done by microservices can be equated to transactions, but a microservices architecture is a trusted environment. On a blockchain, more care needs to be taken in every transaction's approval, including verifying the addresses of the parties engaged in the transaction.

One of the simplest smart contracts enacts a trade of digital assets between two parties. When both parties agree to the terms of the smart contract, it transfers ownership of the traded digital assets between the parties, and records the new ownership on the blockchain. This model ensures that neither party can withhold the asset they agreed to trade, as the smart contract enforces the ownership transfer.

Trading tokens and NFTs, a common current usage of smart contracts, is a niche activity. However, the use cases open up considerably when taking into account how much of ownership has become digitized in some manner. When someone buys a house, they typically don't show up with a suitcase full of cash and receive the house in return. A bank accounts for the money to pay for the house digitally, and a deed confirms ownership of the house. Although many jurisdictions require a paper version of the deed, there's little reason not to make deeds digital.

If all physical items bought through e-commerce could be represented with a digital title, and processed using a smart contract, online services such as eBay would be much more trustworthy.

Beyond the simple transaction model, smart contracts on Sui can be much more complex. Sui offers composability in its object programming, meaning objects can own other objects, allowing for intricate data structures. A set of objects can represent an environment in a game, for example, where some objects may be trees that can be turned into firewood, without affecting the land object underneath them. A player in this type of scenario may trigger a smart contract that lets them cut down the trees and transform them into firewood.

Smarter programming

A smart contract is only as good as its native programming language. The Move language was designed to make smart contract programming easier than other blockchain languages. Move is considered a high-level language, somewhat similar to Javascript, in that it requires less data management. Where general purpose languages such as Rust do not target a specific audience or task, Move on Sui provides a more focused set of primitives designed specifically with safe smart contract programmers in mind.

Developers new to Web3 will need to embrace the concept of smart contracts, but Move will give them the capabilities they expect.

Author

Sam Blackshear

Co-Founder, CTO, Mysten Labs, Creator of Move Language

CTO of Mysten Labs and inventor of Move language. Former Principal Engineer at Meta.

Read more like this

Low Gas Fees Supercharge Oracles On Sui

Oracles serve data to blockchains, and the more frequent the better, but these transactions incur gas fees, making Sui the economical solution.

2min read
Sui Foundation

5 Reasons to Attend Sui’s Vietnam Builder House

The Sui Builder House in Vietnam presents a unique opportunity to meet Sui founders and expert developers.

2min read
Sui Foundation

Move Adds Enums and Macros in 2024 Edition

New features set to launch on Move, Sui's native programming language, in early 2024 include Enums, macro functions, and Method syntax.

4min read
Sam Blackshear

George Danezis on Developing Mysticeti for Sui

Mysten Labs' Chief Scientist explains the development of Mysticeti and what it means to users.

1min read
George Danezis

Tencent Blockchain RPC Service Now Supports Sui

Sui developers will find a variety of plans supporting apps of all sizes.

1min read
Sui Foundation

Eli Roth's The Horror Section Invites Film Fans to Become Investors

Renowned horror director Eli Roth’s new movie studio is engaging with hard-core horror lovers in new ways, while building a media company for the 21st century.

5min read
Sui Foundation