Skip to content

fix: Align PdfVerifier contract with actual SP1 circuit output and add forge verify-contract docs - #12

Open
Kushmanmb with Copilot wants to merge 3 commits into
mainfrom
copilot/verify-contract
Open

fix: Align PdfVerifier contract with actual SP1 circuit output and add forge verify-contract docs#12
Kushmanmb with Copilot wants to merge 3 commits into
mainfrom
copilot/verify-contract

Conversation

Copilot AI commented Mar 11, 2026

Copy link
Copy Markdown

PdfVerifier.sol was out of sync with the zkPDF circuit's actual public values struct, causing broken tests and an unusable contract. The plonk-fixture.json had been left as a Fibonacci example from a template.

Contract (PdfVerifier.sol)

  • PublicValuesStruct: Replaced stub bool result with the correct fields matching circuits/lib/src/types.rs:
    struct PublicValuesStruct {
        bool substringMatches;
        bytes32 messageDigestHash;
        bytes32 signerKeyHash;
        bytes32 substringHash;
        bytes32 nullifier;
    }
  • verifyPdfProof: Return type changed from bool to PublicValuesStruct memory, returning the full decoded public values instead of a single flag.

Fixtures

  • plonk-fixture.json: Replaced Fibonacci template data with correct zkPDF public values (proper ABI-encoded PublicValuesStruct) and a plonk-specific vkey.

Docs (contracts/README.md)

  • Added Step 4 covering post-deployment verification via forge verify-contract, including cast abi-encode for constructor args encoding.

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…-contract docs

Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Copilot AI changed the title [WIP] Verify contract implementation for correctness fix: Align PdfVerifier contract with actual SP1 circuit output and add forge verify-contract docs Mar 11, 2026
@Kushmanmb
Kushmanmb marked this pull request as ready for review March 11, 2026 15:47
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