Skip to main content

Voltaire Swift

Native Swift wrappers over Voltaire’s C FFI, enabling iOS and macOS apps to use the same primitives used across Zig and TypeScript.
New to the project? Start with Getting Started.

What’s Included

  • Core primitives: Address, Hash, Hex, Bytes32, U256
  • Cryptography: Keccak-256, secp256k1 (PrivateKey, PublicKey, Signature)
  • Zero-copy C interop for performance and safety

Quick Start

zig build build-ts-native
cd swift
swift build && swift test
import Voltaire

// Address
let addr = try Address(hex: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045")
print(addr.checksumHex)

// Keccak-256
let h = Keccak256.hash("hello")
print(h.hex)

// U256
let v = try U256(hex: "0x01")
print(v.hex)

API Reference