Skip to main content
Version: Next (unstable)

Kernel ROM chiplet

The kernel ROM enables executing predefined kernel procedures. These procedures are always executed in the root context and can only be accessed by a SYSCALL operation. The chiplet tracks and enforces correctness of all kernel procedure calls as well as maintaining a list of all the procedures defined for the kernel, whether they are executed or not. More background about Miden VM execution contexts can be found here.

Kernel ROM trace​

The kernel ROM table consists of five columns, with exactly one row per declared kernel procedure. The following example table shows the execution trace for three procedures with digests a,b,ca, b, c, called 1, 2, and 0 times respectively.

mmr0r_0r1r_1r2r_2r3r_3
1a0a_0a1a_1a2a_2a3a_3
2b0b_0b1b_1b2b_2b3b_3
0c0c_0c1c_1c2c_2c3c_3

Column meanings:

  • mm is the KernelRomCall multiplicity — the number of times the procedure was invoked by a SYSCALL. It may be zero for procedures declared in the kernel but never called.
  • r0,…,r3r_0, \ldots, r_3 contain the digest of the kernel procedure.

Chiplets bus constraints​

Each active kernel ROM row participates in two typed LogUp relations. Their denominators are

dinit=bus_prefix⁡[KernelRomInit]+∑i=03βiri,dcall=bus_prefix⁡[KernelRomCall]+∑i=03βiri.\begin{aligned} d_{init} &= \operatorname{bus\_prefix}[\mathsf{KernelRomInit}] + \sum_{i=0}^{3} \beta^i r_i, \\ d_{call} &= \operatorname{bus\_prefix}[\mathsf{KernelRomCall}] + \sum_{i=0}^{3} \beta^i r_i. \end{aligned}

The row contributes

−1dinit+mdcall.-\frac{1}{d_{init}} + \frac{m}{d_{call}}.
  • The KernelRomInit term consumes one copy of the row digest. The verifier provides one matching boundary contribution for every kernel procedure digest in the public inputs, so an unauthenticated row leaves the relation unbalanced.
  • The KernelRomCall term provides mm copies of the row digest. Each SYSCALL consumes one matching message, which binds mm to the call count for that procedure.

The chiplets bus constraints describe how these contributions are closed with the public-input boundary terms.

By using the bus this way, the verifier only learns which procedures can be invoked, not how often they were called — the multiplicity mm is a private witness that only reaches the verifier through the bus balance.