Skip to content

Add confidence-based verification to FRI protocol#12

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-11
Draft

Add confidence-based verification to FRI protocol#12
Copilot wants to merge 2 commits intomainfrom
copilot/fix-11

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 9, 2025

This PR implements a new feature that allows users to specify their desired confidence level for FRI verification instead of manually choosing the number of queries. Users can now say "I want to be sure at 99% that the prover is right" and the system automatically calculates the required parameters.

Key Changes

New FriConfig struct for confidence-based configuration:

// Create configuration for 99% confidence
let config = FriConfig::new(0.99)?;
let num_queries = config.calculate_num_queries(); // Returns 7 queries

// Use in verification
let (decommitments, queries, actual_confidence) = 
    FriCodeLayer::fri_decommitment_phase_with_confidence(
        &config, domain_size, &fri_layers, &mut channel
    );

Smart query calculation based on soundness analysis:

  • 90% confidence → 4 queries (93.75% actual confidence)
  • 95% confidence → 5 queries (96.88% actual confidence)
  • 99% confidence → 7 queries (99.22% actual confidence)
  • 99.9% confidence → 10 queries (99.90% actual confidence)

The system uses the simplified soundness model where each query has approximately 1/2 probability of catching a cheating prover, so the soundness error is roughly (1/2)^k for k queries.

Enhanced examples and documentation:

  • Updated main program demonstrates both traditional fixed-query and new confidence-based approaches
  • New standalone example (cargo run --example confidence_verification) showing the feature
  • Comprehensive test coverage for all new functionality
  • Updated README with usage examples and confidence level mappings

Backward compatibility: All existing code continues to work unchanged. The original fri_decommitment_phase() method is preserved alongside the new fri_decommitment_phase_with_confidence() method.

Fixes #11.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Sep 9, 2025

@SimowTopos 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Co-authored-by: SimowTopos <101154139+SimowTopos@users.noreply.github.com>
Copilot AI changed the title [WIP] Verification under a specific probability Add confidence-based verification to FRI protocol Sep 9, 2025
Copilot AI requested a review from SimowTopos September 9, 2025 21:18
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.

Verification under a specific probability

2 participants