Zarnith Docs
Try Now
  • Welcome
  • Getting Started
    • Quickstart
    • The Tech Behind Zarnith
  • Fee Router SDK
    • Installation
    • Core Concepts
  • Quick Start
  • Examples
    • Revenue Sharing dApp
    • Rollup Sequencer Incentive Manager
Powered by GitBook
On this page
  • Smart Contracts (Solana)
  • Cross-Chain Routing Layer
  • SDK
  • Dashboard UI
  • Use Case Example: DAO Treasury Management
  1. Getting Started

The Tech Behind Zarnith

Zarnith's architecture is modular and extensible, consisting of:

  • Smart Contract Layer (Solana): Core logic to define, initialize, and emit cross-chain routing actions.

  • Wormhole Integrations:

    • NTT API: Enables secure sending of native tokens held in vaults to EVM-based recipients.

    • MCTP API: Powers auction-based settlement to maximize yield or efficiency.

  • Dashboard Interface (React): Walkthrough-based UI where users can define routes, monitor flows, and explore verified transaction links via WormholeScan.

  • SDK (TypeScript): An npm-installable SDK for developers to integrate routing logic into their apps.

  • Deployment Environments: Solana Devnet (source), Arbitrum Goerli (destination), Wormhole Devnet (bridge).

Smart Contracts (Solana)

Zarnith’s smart contracts are deployed on Solana Devnet. The primary instructions include:

  • initializeRouter(): Initializes a new routing configuration.

  • routeFee(): Executes a routing instruction, emitting an event.

  • Event Log: Routing events are used by off-chain agents to call Wormhole NTT or MCTP APIs.

Contracts interact with:

  • DAO Vault: Stores collected protocol fees.

  • LP Pool: Optionally aggregates LP revenue shares.

  • Wallet: Executes transaction instructions.

Cross-Chain Routing Layer

NTT (Native Token Transfers)

Zarnith integrates Wormhole’s NTT API to send native tokens (e.g., SOL, USDC) across chains.

  • Tokens are held in a Wormhole-controlled vault.

  • The API is triggered after routing events.

  • Tokens are released to an Ethereum or Arbitrum-based recipient.

MCTP (Auction-Based Routing)

Zarnith optionally supports auctioning funds for optimal routing.

  • An MCTP API call performs an auction on who receives the funds.

  • Auctions are defined by time, bids, or policy rules.

  • Winning bid routes tokens to an Arbitrum DAO Treasury.

Verification is done via Wormhole VAAs and all steps are auditable on WormholeScan.

SDK

Zarnith offers a TypeScript SDK published to npm. This SDK allows developers to:

  • Instantiate router and interact with routing logic.

  • Trigger cross-chain events.

  • Plug into existing dApps with minimal config.

import { ZarnithRouter } from '@zarnith/sdk';
const router = new ZarnithRouter(connection, wallet);
await router.initializeRouter(config);
await router.routeFee({ destination: 'ArbitrumDAO' });

Dashboard UI

The dashboard is a walkthrough-driven React interface that enables users to:

  • Connect wallet (Phantom, Solflare, etc.)

  • Select fee routing destination

  • Monitor transactions live

  • Explore real-time WormholeScan TX hash links

Use Case Example: DAO Treasury Management

A DAO on Solana collects protocol fees in USDC. Zarnith allows:

  • Configuring a split: 70% to Arbitrum DAO Treasury, 30% to LP Pool.

  • Routing this every week via a cron job or manual trigger.

  • Settlements handled via NTT or auction logic.

PreviousQuickstartNextInstallation

Last updated 1 month ago

How Zarnith Could work