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

# Compact toolchain 0.35.0

* **Date:** 2026-09-28
* **Language version:** 0.27.0
* **Compact runtime version:** 0.20.0
* **Environment:** This release works with a Midnight ledger 9 blockchain. For the full compatibility matrix, see the [release notes overview](https://docs.midnight.network/relnotes/overview)

Ledger 9 runs on Mainnet and Preview only

Toolchain 0.35.0 targets ledger version 9. After the [ledger 9 network upgrade](https://docs.midnight.network/relnotes/ledger-9.md), Mainnet and Preview run ledger 9 and use [toolchain 0.36.0](https://docs.midnight.network/relnotes/compact/toolchain-0.36.0.md). Preprod moved to ledger 9 on 9 November 2026 and uses toolchain 0.36.0 too. Contracts compiled with 0.35.0 require Compact runtime 0.20.x, and npm's `latest` tag for `@midnight-ntwrk/compact-runtime` points to a newer runtime, so pin the runtime version for your network.

## High-level summary[​](#high-level-summary "Direct link to High-level summary")

Version 0.35.0 of the Compact toolchain is a major release. It targets Midnight ledger 9, which runs on Mainnet after the [ledger 9 network upgrade](https://docs.midnight.network/relnotes/ledger-9.md), on Preview, and on Preprod since its upgrade on 9 November 2026.

This release builds on 0.34.0. It adds `sha512` hashing, which requires the flag `--feature-zkir-v3`. It also adds the `kernel.caller()` ledger operation, and changes the Compact runtime's cross-contract API. Several changes are breaking; the entries below mark them.

You can update to version 0.35.0 using the Compact devtools. `compact update` will update to the latest released version, and `compact update 0.35` will specifically update to the latest patch release of toolchain 0.35. You can also switch back to toolchain version 0.31.x (for a Midnight ledger 8 blockchain) with `compact update 0.31`.

## Audience[​](#audience "Direct link to Audience")

These release notes are intended for Compact smart-contract developers and for DApp developers who use the Compact runtime.

## What changed[​](#what-changed "Direct link to What changed")

## New features[​](#new-features "Direct link to New features")

### The caller of a circuit is available to the circuit[​](#the-caller-of-a-circuit-is-available-to-the-circuit "Direct link to The caller of a circuit is available to the circuit")

There is a new ledger operation `kernel.caller()` that returns the caller of a circuit as described below. The return value is `Maybe<PublicAddress>` and `PublicAddress` is a standard library alias for `Either<ContractAddress, UserAddress>`.

The result is `some(left(addr))` when the circuit is called by a contract with address `addr`. It is `some(right(addr))` when it is a top-level circuit call and every unshielded input of the containing intent is owned by the user with address `addr`. It is `none()` otherwise, and always `none()` in a constructor.

The ledger derives the caller value from an intent's unshielded inputs, which a wallet adds when it balances the transaction. This occurs **after** proof construction off chain. Off-chain execution records `none()` for a top-level call from a user, so such a call will fail on-chain due to a ledger read mismatch whenever the balanced intent's unshielded inputs all belong to the same user.

Until the ledger is changed to allow setting the top-level caller, you should read `kernel.caller()` only where you know that the call comes from a contract.

### sha512 hashing[​](#sha512-hashing "Direct link to sha512 hashing")

There is a new generic standard library circuit `sha512<T>` that uses the SHA-512 hashing algorithm. It has the same API as the `persistentHash<T>` (which is SHA-256) and `keccak256<T>` circuits.

**This feature requires the flag `--feature-zkir-v3`.**

### The compiler now generates ZKIR 3.1[​](#the-compiler-now-generates-zkir-31 "Direct link to The compiler now generates ZKIR 3.1")

When the feature flag `--feature-zkir-v3` is passed, the compiler will now generate ZKIR 3.1 instead of ZKIR 3.0. This version of the ZKIR format has new instructions to support the new language features introduced in this Compact release. It requires a proof server that can support the ZKIR 3.1 format.

Note that ZKIR 3.1 is a minor version release and so it contains only non-breaking changes over ZKIR 3.0. A ZKIR 3.1 proof server is intended to be able to also process ZKIR 3.0 files.

## Improvements[​](#improvements "Direct link to Improvements")

### Changes to the cross-contract call runtime API[​](#changes-to-the-cross-contract-call-runtime-api "Direct link to Changes to the cross-contract call runtime API")

This release makes **breaking** changes to the Compact runtime's cross-contract call API. For details, see the Compact [`CHANGELOG.md`](https://github.com/LFDT-Minokawa/compact/blob/main/CHANGELOG.md) entry for toolchain version 0.24.101 where these changes were introduced.

### Improvements to encoding and decoding public state[​](#improvements-to-encoding-and-decoding-public-state "Direct link to Improvements to encoding and decoding public state")

The Compact runtime's decoding of ledger public state values has been improved and hardened.

* Decoding `Opaque<'Uint8Array'>` and `Opaque<'string'>` will now throw a `CompactError` for truncated input. Previously these returned invalid values.
* Decoding a Compact `Bytes` value will return a copy of the value. Previously this aliased the underlying bytes which could cause unintended mutation if the decoded value was mutated.
* Decoding an out of range `enum` type will throw an exception that mentions `Enum`. Previously the exception claimed that it expected an `UnsignedInteger`.
* Decoding a `Secp256k1Point` will reject encoded values where the identity flag is not 0 or 1. Previously, it treated 1 as `true` and any other value as `false`.

### The toolchain version string is improved[​](#the-toolchain-version-string-is-improved "Direct link to The toolchain version string is improved")

Previously, the toolchain version gotten from the devtools via `compact compile --version` or by invoking the compiler binary directly `compactc --version` would report only `MAJOR.MINOR.PATCH` version strings, not including any other designation like `-rc.N` or `-alpha.N`. This meant that there were multiple different binary artifacts that each claimed to be the same version. The version string now includes designations like `-rc.N` or `-alpha.N`, as well as identifying a GitHub commit hash and build date. For instance:

```
% compact compile --version

0.35.0-rc.0 (0e7a4b677 2026-09-28)
```

## Breaking changes[​](#breaking-changes "Direct link to Breaking changes")

### Signature verification rejects the identity point[​](#signature-verification-rejects-the-identity-point "Direct link to Signature verification rejects the identity point")

The signature verification circuits `jubjubSchnorrVerify` and `secp256k1EcdsaVerify` now reject the identity point as a public key. Previously they would allow it, which would allow a user to sign any user to sign a message without knowing a real private key.

### New runtime type checks on foreign curves[​](#new-runtime-type-checks-on-foreign-curves "Direct link to New runtime type checks on foreign curves")

The runtime type checks on curve points now bound the coordinates to be in range and the point to lie on the curve. These type checks are applied to circuit and constructor arguments, and to witness return values. Previously, they only checked the types, not the range. Invalid points would fail to encode if they were written to the ledger or in some cases when a proof was constructed. Now the failure occurs earlier and closer to the site of the problem, and will occur even for values that are not written to the ledger. This is a breaking change.

### Some ledger encodings are more strict[​](#some-ledger-encodings-are-more-strict "Direct link to Some ledger encodings are more strict")

Encoding `Uint`, `enum`, and `Bytes` types will now reject arguments that they cannot faithfully encode. Previously, these did not validate their input but decoding these values would fail for invalid encodings, which meant that it was possible to write a value to the ledger that could not be read back. This is a (minor) breaking change.

### Deserialization of `Boolean` values is more strict[​](#deserialization-of-boolean-values-is-more-strict "Direct link to deserialization-of-boolean-values-is-more-strict")

The built-in `deserialize` circuit for `Booleans` now requires the serialized representation to be either a 0 or 1 byte. It previously allowed other byte values, where 1 was deserialized as `true` and any other value was deserialized as `false`.

## Known issues[​](#known-issues "Direct link to Known issues")

### The ZKIR v3 ledger version is printed incorrectly[​](#the-zkir-v3-ledger-version-is-printed-incorrectly "Direct link to The ZKIR v3 ledger version is printed incorrectly")

Invoking `compact compile --feature-zkir-v3 --ledger-version` will print the ZKIR version 3 version string, not the ledger version string. `compact compile --ledger-version` prints the correct ledger version for both ZKIR version 2 and version 3.

## Links and references[​](#links-and-references "Direct link to Links and references")

## Fixed defect list[​](#fixed-defect-list "Direct link to Fixed defect list")

The following defects are fixed by updating to Compact toolchain 0.35.

* There was a `zkir` crash (key generation failure) when `default<Secp256k1Base>` and `default<Secp256k1Scalar>` was used in a circuit, due to a type error in the generated ZKIR code. This is fixed.
