September 11, 2025
2 min read
By Michael Obe

Building a note-taking application on the sui blockchain

Learning how to utilize the sui network ecosystem to build decentralized applications.

SUISealSmart ContractBlockchain
Building a note-taking application on the sui blockchain

Introduction

In this blog, we will be going through building on the note-taking application sui blockchain. This series include:

  • Part One: setup and basic contract.
  • Part Two: multiple data-type of notes.
  • Part Three: encryption on chain (SEAL).
  • Part Four: Storage on-chain (Walrus).
  • Part Five: Sui SDK integration.

Part One: (Basic Contract)

We will be writing the a basic smart contract for on note-taking app.

Steps

  1. Install the Sui SDK and set it to testnet.
  2. Run sui move new <contract-name> to create a new contract.
  3. In the sources folder, navigate to <contract-name>.move.

Breakdown

  • Sui Move contracts are a collection of .move files called a package.
  • Each file can contain modules (a group of structs, objects, and functions).

Creating the Note Struct as an NFT

public struct Note has key, store {
    id: UID,
    title: String,
    content: String,
    timestamp: u64,
}

Let's create functions to interact with the Note struct:

// Creates a Note and returns it to the user
public fun create(title: String, content: String, clock: &Clock, ctx: &mut TxContext): Note {
    let note = Note {
        id: object::new(ctx),
        title,
        content,
        timestamp: clock.timestamp_ms(),
    };
    note
}

// Edits only the content of a Note
public fun edit(note: &mut Note, content: String) {
    note.content = content;
}

// Reads the content of a Note
public fun view(note: &Note): (ID, String, String, u64) {
    (object::id(note), note.title, note.content, note.timestamp)
}

// Deletes a Note
public fun delete(note: Note) {
    let Note { id, .. } = note;
    id.delete();
}

Notice that we need the Note object from the user to edit, read, or delete it. These operations require different permission levels.


Next Up

We will upgrade the contract to accepted a different data types as content.

M

Michael Obe

Backend Developer crafting digital experiences at the intersection of design, technology, and user experience. Currently building developer tools with a focus on modern web technologies.