Skip to content

feat: Add SP1 validity proof verifier#842

Open
Kemperino wants to merge 8 commits into
mainfrom
kempy/sp1-proof-verifier
Open

feat: Add SP1 validity proof verifier#842
Kemperino wants to merge 8 commits into
mainfrom
kempy/sp1-proof-verifier

Conversation

@Kemperino

@Kemperino Kemperino commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

closes https://linear.app/worldcoin/issue/PROTO-4725/contracts-add-sp1-iworldchainproofverifier-impl

Note

Medium Risk
New on-chain proof verification on the validity lane is security-sensitive, but behavior is gated by immutables and extensive tests; defender submission encoding is not updated yet.

Overview
Adds an SP1 validity lane for the multi-proof dispute system by wiring in Succinct’s sp1-contracts dependency and a new SP1ValidityVerifier that implements IWorldChainProofVerifier.

The verifier decodes a fixed ABI proof tuple (domain/parent/intermediate roots, L1 origin, AggregationOutputs public values, and SP1 proof bytes), checks rollup config and range vkey commitments against immutables, derives the expected rootId via WorldChainProofLib, then calls the SP1 gateway’s verifyProof. Invalid or malformed inputs return false (try/catch around an internal decode path) so the game predicate is not reverted. Foundry tests cover constructor guards, happy path, decode/SP1 failures, and each binding gate.

The defender’s encode_proof is unchanged (still concatenates SP1 public values + proof); the TODO now documents the on-chain tuple and that real SP1 lane submission needs proposal context before enablement.

Reviewed by Cursor Bugbot for commit 34dcec0. Configure here.

@Kemperino

Copy link
Copy Markdown
Contributor Author

@codex review

Comment thread proofs/defender/src/defender.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34dcec0fe6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkg/contracts/src/proofs/sp1/SP1ValidityVerifier.sol
@agentotto

agentotto Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Done! Created PROTO-4885Defender: encode SP1 proofs to match on-chain SP1ValidityVerifier ABI tuple — in the Protocol team (state: Todo), and replied on the PR comment thread.

Comment thread pkg/contracts/scripts/mainnet/Deploy.s.sol
@agentotto

agentotto Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Done! Created PROTO-4886Multi-proof system: wire SP1ValidityVerifier into production deployment scripts — in the Protocol team (state: Todo), and replied on the PR thread.

@worldcoin worldcoin deleted a comment from agentotto Bot Jul 10, 2026
@worldcoin worldcoin deleted a comment from agentotto Bot Jul 10, 2026
);
if (expectedRootId != rootId) return false;

// TODO: if Nitro becomes a production validity lane, extend this proof

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/otto create protocol multi proof linear ticket for this to investigate double check and potentially implement this on the nitro verifier as well

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created PROTO-4887Multi-proof system: investigate and potentially extend NitroProofVerifier for production validity lane (state: Todo).

@agentotto

agentotto Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

On it — creating the ticket now.

@agentotto

agentotto Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Done! Created PROTO-4887Multi-proof system: investigate and potentially extend NitroProofVerifier for production validity lane — in the Protocol team (state: Todo), and replied on the PR thread.

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