Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce TransactionVerifier #180

Merged
merged 1 commit into from
Aug 2, 2023
Merged

Introduce TransactionVerifier #180

merged 1 commit into from
Aug 2, 2023

Conversation

frisitano
Copy link
Contributor

@frisitano frisitano commented Jul 31, 2023

closes: #172

@frisitano frisitano requested a review from bobbinth July 31, 2023 08:19
Base automatically changed from frisitano-miden-tx-prover to main July 31, 2023 09:17
@@ -322,6 +304,65 @@ impl TransactionComplier {
NoteTarget::Procedures(procs) => Ok(procs),
}
}

// HELPERS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already have HELPERS section defined above.

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you! I left a few small comments inline. Once these are addressed, we can merge.

Comment on lines 211 to 217
/// Returns a [ProgramInfo] which contains the hash of the transaction program associated with
/// the provided consumed notes hashes and transaction script hash and the kernel.
pub fn build_program_info(
&self,
notes: Vec<Digest>,
tx_script_hash: Option<Digest>,
) -> ProgramInfo {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: both in the comment and in the parameter name we use notes - but these are actually note script hashes, right? If so, should we call them note_script_hashes?

Comment on lines 237 to 238
let mut note_hashes = Vec::new();
let mut note_roots = Vec::new();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should we rename these into note_script_hashes and note_programs?

Comment on lines 327 to 328
/// Returns a [CodeBlock] which represents the note program tree.
fn build_note_program_tree(&self, note_hashes: Vec<Digest>) -> CodeBlock {
Copy link
Contributor

Choose a reason for hiding this comment

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

same nit as above: should these be called note_script_hashes?

Comment on lines 14 to 19
pub struct TransactionVerifier {
compiler: TransactionComplier,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should add a field to mandate proof security level (e.g., proof_security_level: u32). This way, instead of returning it from the verify() method, we would reject the proofs which don't meet the required security level.

We'll probably make it a bit more sophisticated in the future, once this issue is addressed in Winterfell.

@frisitano frisitano merged commit e2fdd05 into main Aug 2, 2023
6 checks passed
@frisitano frisitano deleted the frisitano-tx-verifier branch August 2, 2023 08:08
daedlock pushed a commit to keomprotocol/miden-base that referenced this pull request Feb 8, 2024
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.

TransactionVerifier design
2 participants