Skip to main content
For the complete documentation index, see llms.txt

Ledger

The ledger in Midnight is a public record of contract states and token states, consisting of Zswap’s cryptographic commitments and a mapping of contract addresses to their respective states.

Link to related documentation

To download the component, click the appropriate link under Artifacts.


Release 8.1.3LATEST

2 October 2026

Artifacts

Summary

Security patch for critical advisory GHSA-wr7g-rr4v-jmj8: stricter validity rules for contract call transcripts

  • Before this release, an attacker could get past the one-time checks of a smart contract, for example to claim the same payout more than once.
  • Contract call transcripts must use canonical field values in push, pushs, and idx-style path keys. A Merkle tree in push or pushs must be empty, and transcripts cannot contain noop with a count of 0.
  • A node on 8.1.3 rejects some contract calls that a node on 8.1.2 accepts, so every block producer should run 8.1.3. Node 1.0.400 includes it.
  • For transactions built with the Compact compiler and Midnight.js, nothing changes: the wire format, stored state, and TypeScript declarations match 8.1.2.
  • Ledger 8.1.3 does not rewrite existing contract state. If your smart contract uses a Set or Map as a one-time guard with keys that contain a Field, such as Set<Field> or a struct key with a Field member, read the advisory and check the state of your contract.
  • The proof server image midnightntwrk/proof-server:8.1.3 is on Docker Hub, with a signed build manifest on the proof-server-8.1.3 GitHub release. Docker Hub has no image for ledger 8.1.1 or 8.1.2.
  • Rust API: in onchain-vm, Key::Value holds AlignedValueChecked and Op::Push holds StateValue<D, AlignedValueChecked>. Convert with AlignedValueChecked::try_from or StateValue::try_into_checked.

Component versions by release​

A Ledger release includes the on-chain runtime and ZKIR, the zero-knowledge intermediate representation. Each has its own version number. To choose versions for a DApp, see the compatibility matrix.

LedgerOn-chain runtimeZKIR
8.1.33.1.22.1.1
8.1.23.1.12.1.1
8.1.13.1.02.1.0
8.1.03.1.02.1.0
8.0.33.0.02.1.0
8.0.23.0.02.1.0
7.0.02.0.02.1.0