Skip to main content
Voltaire provides runtime safety without third-party validation libraries. Every primitive validates at construction, giving you type-safe, runtime-verified values.

The Problem

Type Confusion

TypeScript’s structural typing means types with the same structure are interchangeable:

Casing Bugs

String-based addresses have casing inconsistencies:

The Solution

Branded types add compile-time tags that prevent mixing incompatible types:
For casing, Voltaire uses Uint8Array internally:

Validation at Construction

Invalid inputs throw immediately:
If you see a branded type, it’s validated. Any AddressType value is guaranteed valid.

Benefits

Type Safety

Can’t mix Address with Hash or Bytecode

Zero Runtime Cost

Brand only exists in TypeScript’s type checker

LLM-Friendly

Compile errors help AI assistants self-correct

No Zod Needed

Validation built into constructors

Learn More

Branded Types Reference

Complete guide to branded types

Address Primitive

Complete Address API reference