Voltaire (packages/voltaire-swift) provides native Swift 5.9 value types over Voltaire’s Zig C ABI (CVoltaire linking libprimitives_ts_native), targeting macOS 12+ and iOS 15+.
Requirements
- macOS 12+ or iOS 15+
- Swift 5.9+
- Zig 0.15+ (to compile
libprimitives_ts_native)
Build and Test
Build the Zig native library from the repository root first, then build and test the Swift package:Quick Example
Type Surface
Documentation
Getting Started
Build the native Zig dylib and link
Voltaire with SwiftPM.Xcode Integration
Add the package and dynamic library search paths in Xcode.
Address
20-byte addresses and EIP-55 checksum validation.
Keccak256
Keccak-256 hashing over strings, byte arrays, and
Data.Hash & Bytes32
32-byte hashes and fixed-width byte containers.
U256 & Hex
256-bit unsigned integers and hex encoding.
Keys & Signatures
PrivateKey, PublicKey, low-s canonicalization, and ecrecover.Errors & Troubleshooting
VoltaireError cases and dylib rpath diagnostics.
