Skip to content

Ox – Ethereum Standard Library

Overview

Ox (⦻) is the foundation of robust Ethereum software written in TypeScript. It is an Ethereum Standard Library that provides a set of lightweight, performant, and type-safe TypeScript modules for Ethereum.

It offers core utilities & types for primitives such as: ABIs, Addresses, Blocks, Bytes, ECDSA, Hex, JSON-RPC, RLP, Signatures, Transactions, and more.

As an unopinionated Standard Library, it is designed to be used by higher-level consumers (such as Viem, Tevm, etc) to provide their own opinionated interfaces, and/or when reaching for low-level primitives may be needed without buying into a Client Abstraction stack (Viem, Ethers, Web3.js, etc).

Installation

npm
npm i ox

Example Usage

Below is an example of using the Hex and Rlp modules of Ox.

import { Hex, Rlp } from 'ox'
 
const rlp = Rlp.fromHex([Hex.fromString('hello'), Hex.fromString('world')])

How to Read These Docs

The documentation is split into two main sections – Guides and the API Reference – as displayed on the sidebar.

If you are new to Ox, you can start by reading the Guides or you can use the Search Bar (/) to find the Modules you may be looking for.

You can also skim the API Reference to get a quick overview of the available Modules. Each Module has a brief overview of its purpose, as well as some examples (Example) – it can be seen as a "mini-guide" in addition to the formal Guides.

Ox's API is organized by Module (Example), and each Module is further broken down into its individual Function (Example).