Skip to main content

๐Ÿง  Blockchain Development Basics

Master the fundamentals of blockchain development and the Move programming language

New to blockchain? This guide assumes programming experience but not blockchain knowledge.

๐ŸŽฏ What Youโ€™ll Learn

Blockchain Basics

Understanding decentralized systems and how they work

Move Language

Introduction to Move programming concepts

Dubhe Integration

How Dubhe simplifies blockchain development

๐Ÿ“š Blockchain Fundamentals

What is a Blockchain?

A blockchain is a distributed ledger that maintains a continuously growing list of records (blocks) that are linked and secured using cryptography. Think of it as a shared database that no single party controls.Key Properties:
  • Decentralized: No central authority
  • Immutable: Records cannot be changed once confirmed
  • Transparent: All transactions are publicly visible
  • Consensus-based: Network participants agree on the state

Key Blockchain Concepts

1

Accounts & Addresses

Every user has a unique address (like a bank account number) that identifies them on the blockchain.
# Example Sui address
0x1234567890abcdef1234567890abcdef12345678
2

Transactions

Actions that modify the blockchain state. Every transaction is:
  • Signed by the sender
  • Verified by the network
  • Recorded permanently
// Example transaction
await client.executeTransaction({
  function: 'move_player',
  arguments: [player_id, new_position]
});
3

Smart Contracts

Programs that run on the blockchain, automatically executing when conditions are met.
// Simple Move function
public fun transfer_item(from: address, to: address, item_id: u64) {
    // Logic executes on-chain
}
4

Gas & Fees

Computing resources cost โ€œgasโ€ - a fee paid to execute transactions and prevent spam.

๐Ÿš€ Introduction to Move Language

Why Move?

Resource Safety

Moveโ€™s unique feature: Resources cannot be copied or lost, only moved

Formal Verification

Mathematical proofs ensure your code works as intended

Move vs. Traditional Languages

// Resources are linear types - can't be copied
struct Coin has key, store {
    value: u64
}

// Functions are explicit about what they do
public fun transfer(from: &mut Coin, to: &mut Coin, amount: u64) {
    assert!(from.value >= amount, EInsufficientBalance);
    from.value = from.value - amount;
    to.value = to.value + amount;
}

Core Move Concepts

// Define data structure
struct Player has key, store {
    name: String,
    level: u8,
    experience: u64,
}

// Create instance
public fun create_player(name: String): Player {
    Player {
        name,
        level: 1,
        experience: 0,
    }
}
// Public functions can be called externally
public entry fun level_up(player: &mut Player) {
    assert!(player.experience >= 100, ENotEnoughExp);
    player.level = player.level + 1;
    player.experience = 0;
}

// Private functions are internal only
fun calculate_damage(level: u8): u64 {
    (level as u64) * 10
}
struct Item has store, drop {  // Can be stored and discarded
    name: String,
    rarity: u8,
}

struct UniqueNFT has key {     // Can be owned (has address)
    id: u64,
    metadata: String,
}

๐Ÿ—๏ธ Understanding Fully On-Chain Applications

Traditional vs. Fully On-Chain

Characteristics:
  • Central server controls logic
  • Database can be modified
  • Single point of failure
  • Users trust the company

Benefits of Going Fully On-Chain

True Ownership

Users truly own their digital assets - no company can take them away

Composability

Applications can interact with each other like building blocks

Transparency

All logic is public and verifiable - no hidden mechanics

Persistence

Applications continue to exist even if the company disappears

๐ŸŽฎ Entity Component System (ECS) in Blockchain

Why ECS for Blockchain?

Game Development Pattern: ECS is used by major game engines because itโ€™s perfect for managing complex, interactive systems - exactly what blockchain applications need.
// Hard to extend and modify
class Player {
  constructor(name, health, mana, inventory) {
    this.name = name;
    this.health = health;
    this.mana = mana;
    this.inventory = inventory;
  }
  
  // What if we want flying players? Swimming players?
  move(direction) { /* complex logic */ }
  attack(target) { /* more complex logic */ }
}

ECS Components in Dubhe

1

Entities

Unique IDs that represent objects in your world
const playerId = await client.createEntity();
const monsterId = await client.createEntity();
2

Components

Data containers attached to entities
await client.setComponent(playerId, 'HealthComponent', {
    current: 100n,
    maximum: 100n
});
3

Systems

Functions that operate on components
public entry fun damage_system(
    target_entity: u64,
    damage_amount: u64
) {
    let health = get_component<HealthComponent>(target_entity);
    health.current = health.current - damage_amount;
    set_component(target_entity, health);
}

๐Ÿ› ๏ธ How Dubhe Simplifies Development

The Problem Dubhe Solves

Without Dubhe: Blockchain development requires deep expertise in multiple areas:
  • Move language intricacies
  • Blockchain deployment and management
  • Frontend integration complexities
  • State synchronization challenges

Dubheโ€™s Solution

Schema-Driven

Define your data once, generate everything else automatically

Type Safety

Full type safety from blockchain to frontend

Real-Time Sync

Automatic state synchronization with WebSocket support

Multi-Chain

Deploy to multiple blockchains with the same code

Development Workflow Comparison

# Manual, error-prone process
1. Write Move contracts manually
2. Deploy contracts to blockchain
3. Extract ABI and generate types
4. Build custom client integration
5. Implement state synchronization
6. Handle blockchain-specific quirks
7. Repeat for each blockchain

๐ŸŽฏ Your Learning Path

1

Complete the Quickstart

Build your first application with our quickstart guide
2

Try the First DApp Tutorial

Follow the step-by-step counter app tutorial
3

Learn Contract Development

4

Build Something Real

Create a game with the Monster Hunter tutorial

๐Ÿ“ Key Takeaways

Remember These Concepts

โœ… Blockchain = Shared, immutable database
โœ… Move = Resource-safe programming language
โœ… Smart Contracts = Programs that run on blockchain
โœ… ECS = Flexible architecture for complex applications
โœ… Dubhe = Framework that simplifies everything above

๐Ÿค Getting Help

Questions about these concepts?

๐Ÿš€ Ready to Build?

Start Building Now

Jump into development with our quickstart guide

Learn by Example

Follow a complete tutorial from start to finish