> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

# Compact.js

Compact.js provides a TypeScript-based execution environment for smart contracts compiled with the Compact compiler. When a Compact smart contract is compiled, the output includes a JavaScript file and a TypeScript declaration file.

Compact.js uses these files at runtime to execute the circuits. The circuit execution results are then used by higher-level tools and frameworks (such as Midnight.js) to create and submit transactions to the Midnight blockchain.

For more information, see the [Compact language documentation](https://docs.midnight.network/compact.md).

***

<!-- -->

Version3.0.0

StatusAll

### [Release <!-- -->3.0.0](https://docs.midnight.network/relnotes/compact-js/compact-js-3-0-0.md)LATEST

2026-11-05

#### Artifacts

* [NPM Package](https://www.npmjs.com/package/@midnight-ntwrk/compact-js/v/3.0.0)
* [GitHub release](https://github.com/midnightntwrk/compact-js/releases/tag/compact-js-v3.0.0)

#### Summary

Major release for the ledger 9 network upgrade on Mainnet, used by Midnight.js 5.

* Runs contracts on Mainnet after the ledger 9 network upgrade, and on Preview.
* Built against compact-runtime 0.21.0 and on-chain runtime 4.0.0.
* Requires Compact toolchain 0.36.0 for ledger 9 contracts; recompiling changes a deployed contract's verifier keys (breaking).
* Adds `/v8` and `/v9` entry points so you pick the ledger era at import.
* Publishes as ESM only (breaking).
* Type surfaces are aware of the ledger era; select the era explicitly (breaking).
* Preprod moved to ledger 9 on 9 November 2026 and uses 3.0.0 too.
