Skip to content

Add public witness serialization#872

Closed
GraDKh wants to merge 1 commit intodgordon/serialize_constraint_systemfrom
dgordon/serialize_public_witness
Closed

Add public witness serialization#872
GraDKh wants to merge 1 commit intodgordon/serialize_constraint_systemfrom
dgordon/serialize_public_witness

Conversation

@GraDKh
Copy link
Copy Markdown
Contributor

@GraDKh GraDKh commented Aug 29, 2025

Add PublicWitness struct for zero-knowledge proof verification

TL;DR

Introduces a new PublicWitness type to represent the public portion of witness data in zero-knowledge proofs.

What changed?

  • Added a new PublicWitness<'a> struct that uses Cow<'a, [Word]> to efficiently store public witness data
  • Implemented serialization/deserialization with version compatibility
  • Added conversion methods from various types (Vec<Word>, &[Word], &ValueVec)
  • Added utility methods for accessing and manipulating the witness data
  • Created a reference binary file public_witness_v1.bin for serialization testing
  • Updated test documentation to include information about the new reference file

How to test?

  • Run the test suite to verify the implementation works correctly:
  • The tests include serialization round-trips, version compatibility checks, and conversion tests

Why make this change?

Public witness data is a critical component in zero-knowledge proof systems, representing the public inputs and constants that both provers and verifiers need to agree on. This implementation provides a standardized way to handle this data with efficient memory usage through Cow, allowing both borrowed and owned variants depending on the use case.

Copy link
Copy Markdown
Contributor Author

GraDKh commented Aug 29, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@GraDKh GraDKh requested review from jadnohra and pepyakin August 29, 2025 16:28
@GraDKh GraDKh marked this pull request as ready for review August 29, 2025 16:28
@GraDKh GraDKh force-pushed the dgordon/serialize_constraint_system branch from 630049f to 722dbbe Compare September 1, 2025 07:04
@GraDKh GraDKh force-pushed the dgordon/serialize_public_witness branch 2 times, most recently from 440c40a to 457165d Compare September 1, 2025 07:11
@GraDKh GraDKh force-pushed the dgordon/serialize_constraint_system branch from 722dbbe to 418523e Compare September 1, 2025 07:11
@jadnohra jadnohra force-pushed the dgordon/serialize_public_witness branch from 457165d to 7830e3d Compare September 1, 2025 22:35
@jadnohra jadnohra force-pushed the dgordon/serialize_constraint_system branch from 418523e to 2674f27 Compare September 1, 2025 22:35
This was referenced Sep 1, 2025
@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Sep 2, 2025

Merge activity

  • Sep 2, 7:12 AM UTC: GraDKh added this pull request to the Graphite merge queue.
  • Sep 2, 7:13 AM UTC: CI is running for this pull request on a draft pull request (#908) due to your merge queue CI optimization settings.
  • Sep 2, 7:20 AM UTC: Merged by the Graphite merge queue via draft PR: #908.

graphite-app bot pushed a commit that referenced this pull request Sep 2, 2025
# Add PublicWitness struct for zero-knowledge proof verification

### TL;DR

Introduces a new `PublicWitness` type to represent the public portion of witness data in zero-knowledge proofs.

### What changed?

- Added a new `PublicWitness<'a>` struct that uses `Cow<'a, [Word]>` to efficiently store public witness data
- Implemented serialization/deserialization with version compatibility
- Added conversion methods from various types (`Vec<Word>`, `&[Word]`, `&ValueVec`)
- Added utility methods for accessing and manipulating the witness data
- Created a reference binary file `public_witness_v1.bin` for serialization testing
- Updated test documentation to include information about the new reference file

### How to test?

- Run the test suite to verify the implementation works correctly:
- The tests include serialization round-trips, version compatibility checks, and conversion tests

### Why make this change?

Public witness data is a critical component in zero-knowledge proof systems, representing the public inputs and constants that both provers and verifiers need to agree on. This implementation provides a standardized way to handle this data with efficient memory usage through `Cow`, allowing both borrowed and owned variants depending on the use case.
@graphite-app graphite-app bot closed this Sep 2, 2025
@graphite-app graphite-app bot deleted the dgordon/serialize_public_witness branch September 2, 2025 07:20
lockedloop pushed a commit that referenced this pull request Sep 8, 2025
# Add PublicWitness struct for zero-knowledge proof verification

### TL;DR

Introduces a new `PublicWitness` type to represent the public portion of witness data in zero-knowledge proofs.

### What changed?

- Added a new `PublicWitness<'a>` struct that uses `Cow<'a, [Word]>` to efficiently store public witness data
- Implemented serialization/deserialization with version compatibility
- Added conversion methods from various types (`Vec<Word>`, `&[Word]`, `&ValueVec`)
- Added utility methods for accessing and manipulating the witness data
- Created a reference binary file `public_witness_v1.bin` for serialization testing
- Updated test documentation to include information about the new reference file

### How to test?

- Run the test suite to verify the implementation works correctly:
- The tests include serialization round-trips, version compatibility checks, and conversion tests

### Why make this change?

Public witness data is a critical component in zero-knowledge proof systems, representing the public inputs and constants that both provers and verifiers need to agree on. This implementation provides a standardized way to handle this data with efficient memory usage through `Cow`, allowing both borrowed and owned variants depending on the use case.
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