OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Oksolc

Oksolc is a Zig implementation of the Solidity compiler for development workflows. It provides a command-line compiler, a libsolc-compatible C ABI and header, and a public Zig module. Its documented supported compilation path is optimized via-IR through the Standard JSON interface.

Independent OpenViST project profile, based on linked sources.

Oksolc — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Oksolc when exploring or integrating an alternative compiler for Solidity development and iteration, especially in workflows that use optimized via-IR compilation. Follow the maintainers’ recommendation to use the original solc for on-chain deployment.

Who it is for

  • Solidity developers evaluating an alternative compiler during development.
  • Teams integrating a Solidity compiler through a C-compatible interface.
  • Zig developers building Solidity-related tooling.

Documented uses

  • Compile Solidity source files from the command line.
  • Submit Standard JSON requests to control compiler settings and requested artifacts.
  • Connect a built compiler to a Foundry project using the documented via-IR configuration.
  • Integrate compiler functionality through the C ABI or public Zig module.
  • Compare compiler behavior with Solidity 0.8.36 while accounting for documented exceptions.
Before you choose

Requirements & limits

The project is published as a public GitHub repository under the GPL-3.0 license. Building requires Zig 0.16.0, libc and a working C toolchain.

  • The documented compatibility target is Solidity 0.8.36, with specified intentional deviations in some compiler output.
  • The compile command enables the optimizer with 200 runs; Standard JSON is the route for exact settings and output selection.
  • Filesystem imports must remain within configured roots and cannot contain symlinks.
  • The optional browser features require additional pinned Bun and TypeScript tools; ordinary builds do not require them.
  • The maintainers recommend original solc rather than oksolc for on-chain deployment.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Build the Oksolc CLI and libraries

Compile the CLI, shared library and C header from the repository.

Before you start

  • Zig 0.16.0
  • libc and a working C toolchain

Steps

  1. From the repository, run zig build -Doptimize=ReleaseFast.

  2. Find the executable at zig-out/bin/oksolc, with the library and header under zig-out/lib and zig-out/include.

  3. Add zig-out/bin to PATH or use the documented --prefix option to choose an installation prefix.

Expected outcome

A locally built oksolc CLI, shared library and C header.

Guide limitations

  • Oksolc is not considered production-ready for on-chain deployment; the maintainers recommend the original solc for deployment.
  • A first Zig build downloads dependencies declared in build.zig.zon.
Source-based practical guide

Configure Oksolc for a Foundry project

Point a Foundry project at a built oksolc executable and enable its supported optimized via-IR pipeline.

Before you start

  • A built oksolc executable
  • A Foundry project with a foundry.toml file

Steps

  1. Set the solc value in [profile.default] to the absolute path of the oksolc executable.

  2. Set via_ir = true, optimizer = true and optimizer_runs = 200.

  3. Run forge build in the project; run forge clean first if rebuilding artifacts produced by a previous compiler.

Expected outcome

Foundry is configured to invoke oksolc with the documented via-IR and optimizer settings.

Guide limitations

  • The maintainers do not consider oksolc production-ready for on-chain deployment and recommend original solc for deployment.
  • The documented supported compilation path is optimized via-IR.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
13 October 2026
Original website title
okcontract/oksolc · Official homepage title · retained in its source language