Zig + Solana

Build the Future of AI & Crypto with Zig

High-performance blockchain applications combining Zig's safety and speed with Solana's scalability. Zero-copy networking. SIMD acceleration. Native eBPF support.

Get Started Join Community

Why Ziglana?

Leverage Zig's unique strengths for blockchain development

🚀

Zig + Solana Speed

Unleash Zig's performance on Solana. Compete with C/C++ while maintaining memory safety and readable code.

🤖

AI Inference On-Chain

Run AI inference directly on Solana. Integrate ML models with zero-copy data flow and minimal overhead.

🔐

Optimized Crypto Primitives

Use Zig's comptime for verified crypto. Zero-runtime-overhead cryptographic operations.

📦

eBPF/SBF Programs

Develop and deploy SBF programs with Zig. Type-safe smart contracts with compile-time verification.

Zero-Copy Networking

Build high-performance P2P systems. Leverage Zig's explicit memory model for optimal networking.

🎯

SIMD Acceleration

Accelerate demanding computations. Fine-grained SIMD control with Zig's inline assembly.

Zig Meets Solana

Write type-safe programs for the fastest blockchain

A Simple Language

Focus on debugging your application rather than debugging your programming language knowledge. No hidden control flow. No hidden memory allocations. No preprocessor, no macros.

Comptime

A fresh approach to metaprogramming based on compile-time code execution and lazy evaluation. Call any function at compile-time. Manipulate types as values without runtime overhead.

Maintain it with Zig

Incrementally improve your Rust/Cargo/Cargo project. Use Zig as a zero-dependency, drop-in Solana program compiler that supports cross-compilation out-of-the-box.

index.zig
const std = @import("std");
const base58 = @import("base58");

test "encode pubkey" {
    const pubkey = "CyZuD7c6jEQKkwN5VHQQyG4D4YHiJK4fGFL5JKVCNq2F";
    const encoded = try base58.encode(pubkey);
    try std.testing.expect(encoded.len > 0);
}

pub fn transfer(from: *Wallet, to: *Wallet, amount: u64) !void {
    if (from.balance < amount) return error.InsufficientFunds;
    from.balance -= amount;
    to.balance += amount;
}
Shell
$ zig build
Compiling ziglana-program
Build Summary: 3/3 steps succeeded
Transfer size: 4KB (vs 8KB in Rust)

Getting Started

Begin your journey with Ziglana

1

Install Zig

Download Zig 0.15.0 or later from the official website.

$ zig version 0.15.0
2

Clone Ziglana

Get the Ziglana framework and examples.

$ git clone https://github.com/ziglana/ziglana $ cd ziglana
3

Build Your Program

Compile and deploy your first Solana program.

$ zig build --release-small $ solana program deploy zig-out/program.so

Community

Join the Ziglana community

The Ziglana community is decentralized. Anyone is free to start and maintain their own space for the community to gather. There is no concept of "official" or "unofficial", however, each gathering place has its own moderators and rules.

Main Development

The Ziglana repository can be found at GitHub, where we also host the issue tracker and discuss proposals. Contributors are expected to follow Ziglana's Code of Conduct.