ZONA PROTOCOL
  • Welcome to Zona
  • What is ZONA?
  • Core Concepts
  • Network Architecture
  • Getting Started
    • ◼️Setting Up Wallets
    • ◼️Connecting to Testnet
    • ◼️Faucet Access
    • ◼️ZONA RPC & Chain Info
  • Smart Contract Development
    • ◻️EVM Compatibility Overview
    • ◻️Writing Contracts (Solidity)
    • ◻️Deploying to ZONA with Hardhat
    • ◻️Using Remix on ZONA
    • Advanced Topics
  • ◼️Gas Optimization on ZONA
  • ◼️Custom Modules with ZONA SDK
  • ◼️Security & Auditing Guidelines
Powered by GitBook
On this page

Custom Modules with ZONA SDK

ZONA Protocol is built on top of the ZONA SDK, a modular and extensible framework inspired by ZONA SDK. This architecture empowers developers to go beyond smart contracts and implement custom native modules directly into the blockchain runtime.

Whether you're building advanced governance mechanics, staking variations, custom mint logic, or protocol-native GameFi rules ZONA SDK gives you full control.


⚙️ What Is a Module?

A module is a pluggable component of the blockchain’s application layer. Each module handles specific functionality (e.g. bank, staking, gov) and interacts with others through a shared message-passing interface.

ZONA ships with built-in modules such as:

  • auth – account and signature validation

  • bank – token balances and transfers

  • staking – validator and delegator management

  • gov – governance proposals

  • ibc – inter-blockchain communication

  • evm – Ethereum compatibility via Ethermint

You can create and plug in your own module alongside these.


🛠️ Why Use Custom Modules?

While smart contracts are powerful, native modules offer:

  • ⚡ Higher performance (executed in Golang, not EVM bytecode)

  • 🔐 Deeper protocol access (access to internal chain state)

  • 🔄 Deterministic upgrades through governance

  • 🧩 Tighter integration with staking, slashing, and IBC

Perfect for core protocol logic, chain-native games, or extensions to staking/governance.


🧱 Basic Module Structure

A ZONA module is typically structured as:

/myapp/x/mymodule/
  ├── keeper/           # Business logic & state access
  ├── types/            # Types, constants, keys
  ├── msg_server.go     # Message routing
  ├── handler.go        # Msg → logic dispatcher
  ├── genesis.go        # Genesis config
  ├── module.go         # Module definition (AppModule interface)

🔧 Registering the Module

In your chain's app.go:

app.MyModuleKeeper = mymodule.NewKeeper(
  appCodec,
  keys[mymodule.StoreKey],
  ...
)

app.mm.SetOrderBeginBlockers(mymodule.ModuleName)
app.mm.SetOrderEndBlockers(mymodule.ModuleName)

app.mm.RegisterServices(
  module.NewConfigurator(...),
)

🔐 Security Note

Because modules operate at the lowest level, improper use can lead to chain-halting bugs or governance failure. Always:

  • Write full unit and integration tests

  • Use parameter guards (ParamStore)

  • Handle panic recovery on critical operations


📚 Resources

  • ZONA SDK Module Basics

  • Ethermint Integration Guide


✅ When to Use Custom Modules vs Smart Contracts

Use Case
Recommended Approach

dApp logic, token launches

Solidity (EVM contract)

Chain-native staking logic

Custom module (ZONA SDK)

IBC relaying & bridging

Module

Governance proposal types

Module

NFTs, DeFi vaults, DEX

Smart contracts


ZONA SDK gives you full control to design, extend, and evolve the blockchain at the protocol level without waiting on EVM limitations.

PreviousGas Optimization on ZONANextSecurity & Auditing Guidelines

Last updated 14 days ago

◼️
ZONA SDK (Coming Soon)