Skip to content

ergo-nipopow: validate proof structure and extension-root binding - #917

Open
a-shannon wants to merge 11 commits into
ergoplatform:v0.30.0from
a-shannon:fix/nipopow-interlink-canonicality
Open

ergo-nipopow: validate proof structure and extension-root binding#917
a-shannon wants to merge 11 commits into
ergoplatform:v0.30.0from
a-shannon:fix/nipopow-interlink-canonicality

Conversation

@a-shannon

@a-shannon a-shannon commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • Retain canonical interlink-run validation before proof selection.
  • Authenticate disclosed interlinks against the full header extension root.
  • Reject invalid proof parameters before comparison.
  • Add complete JVM-produced proof fixtures for cross-runtime verification.

Invariant

A disclosed interlink is accepted only when its Merkle proof reconstructs the full extension root committed by the header, and proof comparison is entered only with valid structural parameters.

Public API behavior note

The corrective update restores the historical exhaustive NipopowProofError variant set. Detailed proof-local validation outcomes are exposed separately through the #[non_exhaustive] NipopowValidationError returned by NipopowProof::validate.

  • valid_proof.is_better_than(&invalid_proof) returns Ok(true), preserving the historical base comparison behavior.
  • Comparing two valid proofs with different (m, k) values returns Ok(false).
  • At the stateful boundary, NipopowVerifier::process reports a valid challenger parameter mismatch as the legacy AutolykosPowSchemeError::OutOfBounds before mutation; the incumbent remains unchanged.
  • An invalid mismatched challenger is ignored with Ok(()) and cannot replace the incumbent.

Coordination

Validation

  • ergo-nipopow suite: 43/43.
  • ergo-chain-generation suite: 34/34.
  • Full-root fixture matrix: 8/8.
  • JVM interoperability fixture matrix: 9/9.
  • Affected bindings and WASM checks passed.
  • rustfmt and strict Clippy checks passed for the affected targets.

Independent maintainer review and upstream CI are pending.

Downstream consumer

@a-shannon a-shannon changed the title ergo-nipopow: reject non-canonical interlink runs ergo-nipopow: validate proof structure and extension-root binding Aug 6, 2026
@a-shannon
a-shannon marked this pull request as draft August 6, 2026 12:27
@a-shannon
a-shannon marked this pull request as ready for review August 6, 2026 22:39
@a-shannon

Copy link
Copy Markdown
Author

Review acknowledgement: many thanks to Muadib for the thorough initial security review, the reproducible test cases, and the independent re-audit of this exact head (bb24b1c2). The re-audit reports the prior P0/P1 findings for this surface remediated and gives this revision an APPROVE (residual nit) verdict. Formal maintainer review and applicable CI remain separate gates.

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.

1 participant