Skip to content

EVM - #11

Draft
MastaP wants to merge 22 commits into
mainfrom
l1
Draft

EVM#11
MastaP wants to merge 22 commits into
mainfrom
l1

Conversation

@MastaP

@MastaP MastaP commented Jan 19, 2026

Copy link
Copy Markdown
Member

No description provided.

ristik added 7 commits April 5, 2026 14:01
Before verifying an aggregator consistency proof, the Core now derives

    B* = < (sid_i, H(h_tx,i, tau)) >,   tau = CR.IR.t

from the declared request batch and verifies the proof against B* rather
than treating the declared values as leaf values.

The envelope declares transaction hashes; the tree stores values that
bind the round's reference time. Deriving rather than accepting a
supplied leaf value is what makes a wrong tau unrepresentable: a shard
that built its tree under any other reference time produces a root the
Core does not reproduce, so the round is rejected rather than merely
attributable afterwards. Were the batch to carry the leaf value directly,
it would also have to carry the inputs needed to check the derivation.

The Core already holds both operands. The batch arrives with the opcode
stream, and IR.Timestamp is the value it already requires to equal the
previous seal's timestamp, so no new trust is placed in the shard. This
does not extend the Core into semantic validation: it evaluates no
predicate and parses no transaction, and applies one hash to a field
already present in the certification request.

O_L opcodes open a leaf preserved from an earlier round and keep carrying
that leaf's stored value verbatim; only the current batch is derived.

ZKVerifier.VerifyProof takes the reference time. Verifiers that do not
certify aggregator leaves ignore it.

The cross-language fixtures are regenerated from the matching rugregator
commit and now carry the reference time they were built under, and the
Go side asserts that verifying them under any other reference time fails.

The envelope wire format is unchanged.
@ristik

ristik commented Aug 20, 2026

Copy link
Copy Markdown
Member

Added the two service-time consistency-proof commits to this branch.

Refs #23, #24.

64631d23 — derive SMT leaf values from the round reference time

Before verifying an aggregator consistency proof, the Core derives B* = <(sid_i, H(h_tx,i, τ))> with τ = CR.IR.t from the declared request batch, and verifies against B* rather than treating the declared values as leaf values. It already holds both operands: the batch arrives with the opcode stream, and IR.Timestamp is the value it already requires to equal the previous seal's timestamp. O_L opcodes open a leaf preserved from an earlier round and keep carrying that leaf's stored value verbatim; only the current batch is derived. The envelope wire format is unchanged.

12a30c7e — expose the round reference time as a ZK public input

Aggregator ZK public values grow from 64 to 72 bytes (prev_root ‖ new_root ‖ τ, τ big-endian u64), checked against CR.IR.t. The batch is private there, so the circuit derives the leaf values internally and exposes τ. Without it the ZK instantiation would leave τ asserted by the shard while the hash-based one enforces it. The FFI entry point takes τ so the boundary carries it rather than leaving Go to trust an unchecked public value.

The prover side is ristik/rugregator#5 — the verifying key changes with the circuit, so the ZK halves land together. The cross-language envelope fixtures in rsmt/testdata are regenerated from that branch and now carry the reference time they were built under; the Go test also asserts that verifying them under any other reference time fails.

Regenerating those fixtures surfaced a real divergence: rugregator's leaf_value wrote a fixed two-byte CBOR byte-string head, which is shortest-form only above 23 bytes. Production values are 32-byte transaction hashes, where both forms agree, so the shared test vector missed it and only the short-value fixtures caught it. Fixed on the rugregator side.

Test_rootNetworkRunning fails on this branch both with and without these commits.

…cy proof

The aggregator ZK proof's public values grow from 64 to 72 bytes:

    prev_root[32] || new_root[32] || reference_time (big-endian u64)

and the Core checks the committed reference time against CR.IR.t.

The reference time is public input, the content of the batch of leaves
is secret witness. In the hash-based instantiation the Core derives each
leaf value as H(txhash, tau) from the batch it receives; here the circuit
performs the same derivation internally and exposes tau to check.

aggzk_verify_proof takes the reference time through the FFI boundary.

The prover side is rugregator's zk-guest, which commits the same three
values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants