-
Notifications
You must be signed in to change notification settings - Fork 106
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
[WIP] Transaction verifier #1100
Closed
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
62d4d06
Export sighash::HashType
dconnolly 6486c95
Use redjubjub crate exported from zebra-chain in the redjubjub::Verifier
dconnolly 75928e6
Sketch of a TransactionVerifier
dconnolly c6e54d1
Docstrings for signhash consts
dconnolly d08b82e
Add nullifiers(), note_commitments(), and binding_validating_key() to…
dconnolly ab872f9
Check the balance for shielded data in TransactionVerifier
dconnolly 8f242e5
Add docs to binding_validating_key()
dconnolly 07b7c9e
Clean up some things and validate all signatures
dconnolly 86ed9f7
Tidy, correct names
dconnolly 3e14f17
Snake case not camelCase method invocatiosn
dconnolly 0b4cbd1
consensus: WIP from pairing session
hdevalence f942b85
Move balance check that results in binding sig verification key to ch…
dconnolly 92a62a1
Do joinsplit binging sig validation in a check function
dconnolly 219b53f
Add several transaction 'counting' checks
dconnolly b57f9a7
Add shielded_balances_match check
dconnolly 91c8013
Add coinbase shielded descriptions check
dconnolly dc13343
Fix compiler errors in transaction verifier
yaahc 58083de
integrate script::Verifier with transaction::Verifier
yaahc c8a14e4
Remove redundant 'use jubjub;'
dconnolly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
use std::{ | ||
future::Future, | ||
mem, | ||
pin::Pin, | ||
task::{Context, Poll}, | ||
}; | ||
|
||
|
||
use tower::Service; | ||
|
||
use zebra_chain::primitives::Groth16Proof; | ||
|
||
use crate::BoxError; | ||
|
||
/// Provides verification of Groth16 proofs for a specific statement. | ||
/// | ||
/// Groth16 proofs require a proof verification key; the [`Verifier`] type is | ||
/// responsible for ownership of the PVK. | ||
pub struct Verifier { | ||
// XXX this needs to hold on to a verification key | ||
} | ||
|
||
impl Verifier { | ||
/// Create a new Groth16 verifier, supplying the encoding of the | ||
pub fn new(encoded_verification_key: &[u8]) -> Result<Self, BoxError> { | ||
// parse and turn into a bellman type, | ||
// so that users don't have to have the entire bellman api | ||
unimplemented!(); | ||
} | ||
} | ||
|
||
// XXX this is copied from the WIP batch bellman impl, | ||
// in the future, replace with a re export | ||
|
||
pub struct Item { | ||
pub proof: Groth16Proof, | ||
pub public_inputs: Vec<jubjub::Fr>, | ||
} | ||
|
||
// XXX in the future, Verifier will implement | ||
// Service<BatchControl<Item>>> and be wrapped in a Batch | ||
// to get a Service<Item> | ||
// but for now, just implement Service<Item> and do unbatched verif. | ||
//impl Service<BatchControl<Item>> for Verifier { | ||
impl Service<Item> for Verifier { | ||
type Response = (); | ||
type Error = BoxError; | ||
type Future = Pin<Box<dyn Future<Output = Result<(), BoxError>> + Send + 'static>>; | ||
|
||
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { | ||
Poll::Ready(Ok(())) | ||
} | ||
|
||
fn call(&mut self, req: Item) -> Self::Future { | ||
unimplemented!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty doc comments prevent a linter from ever noticing that they're empty, so I think it would be preferable to avoid adding them.