fn verify_sprout_shielded_data(
        joinsplit_data: &Option<transaction::JoinSplitData<Groth16Proof>>,
        shielded_sighash: &SigHash,
    ) -> Result<AsyncChecks, TransactionError> {
        let mut checks = AsyncChecks::new();

        if let Some(joinsplit_data) = joinsplit_data {
            for joinsplit in joinsplit_data.joinsplits() {
                // Consensus rule: The proof π_ZKSpend MUST be valid given a
                // primary input formed from the relevant other fields and h_{Sig}
                //
                // Queue the verification of the Groth16 spend proof
                // for each JoinSplit description while adding the
                // resulting future to our collection of async
                // checks that (at a minimum) must pass for the
                // transaction to verify.
                //
                // https://zips.z.cash/protocol/protocol.pdf#joinsplitdesc
                checks.push(primitives::groth16::JOINSPLIT_VERIFIER.oneshot(
                    DescriptionWrapper(&(joinsplit, &joinsplit_data.pub_key)).try_into()?,
                ));
            }

            // Consensus rule: The joinSplitSig MUST represent a
            // valid signature, under joinSplitPubKey, of the
            // sighash.
            //
            // Queue the validation of the JoinSplit signature while
            // adding the resulting future to our collection of
            // async checks that (at a minimum) must pass for the
            // transaction to verify.
            //
            // https://zips.z.cash/protocol/protocol.pdf#sproutnonmalleability
            // https://zips.z.cash/protocol/protocol.pdf#txnencodingandconsensus
            let ed25519_verifier = primitives::ed25519::VERIFIER.clone();
            let ed25519_item =
                (joinsplit_data.pub_key, joinsplit_data.sig, shielded_sighash).into();

            checks.push(ed25519_verifier.oneshot(ed25519_item));
        }

        Ok(checks)
    }
/// Verifies a transaction's Sprout shielded join split data.
Verifies a transaction's Sprout shielded join split data.
Verifies a transaction ' s Sprout shielded join split data .
fn verify_sprout_shielded_data(
        joinsplit_data: &Option<transaction::JoinSplitData<Groth16Proof>>,
        shielded_sighash: &SigHash,
    ) -> Result<AsyncChecks, TransactionError> {
        let mut checks = AsyncChecks::new();
        if let Some(joinsplit_data) = joinsplit_data {
            for joinsplit in joinsplit_data.joinsplits() {
                // Consensus rule: The proof π_ZKSpend MUST be valid given a
                // primary input formed from the relevant other fields and h_{Sig}
                //
                // Queue the verification of the Groth16 spend proof
                // for each JoinSplit description while adding the
                // resulting future to our collection of async
                // checks that (at a minimum) must pass for the
                // transaction to verify.
                //
                // https://zips.z.cash/protocol/protocol.pdf#joinsplitdesc
                checks.push(primitives::groth16::JOINSPLIT_VERIFIER.oneshot(
                    DescriptionWrapper(&(joinsplit, &joinsplit_data.pub_key)).try_into()?,
                ));
            }
            // Consensus rule: The joinSplitSig MUST represent a
            // valid signature, under joinSplitPubKey, of the
            // sighash.
            //
            // Queue the validation of the JoinSplit signature while
            // adding the resulting future to our collection of
            // async checks that (at a minimum) must pass for the
            // transaction to verify.
            //
            // https://zips.z.cash/protocol/protocol.pdf#sproutnonmalleability
            // https://zips.z.cash/protocol/protocol.pdf#txnencodingandconsensus
            let ed25519_verifier = primitives::ed25519::VERIFIER.clone();
            let ed25519_item =
                (joinsplit_data.pub_key, joinsplit_data.sig, shielded_sighash).into();
            checks.push(ed25519_verifier.oneshot(ed25519_item));
        }
        Ok(checks)
    }
fn verify_sprout_shielded_data ( joinsplit_data : & Option < transaction :: JoinSplitData < Groth16Proof > > , shielded_sighash : & SigHash , ) -> Result < AsyncChecks , TransactionError > { let mut checks = AsyncChecks :: new ( ) ; if let Some ( joinsplit_data ) = joinsplit_data { for joinsplit in joinsplit_data . joinsplits ( ) { // Consensus rule: The proof π_ZKSpend MUST be valid given a // primary input formed from the relevant other fields and h_{Sig} // // Queue the verification of the Groth16 spend proof // for each JoinSplit description while adding the // resulting future to our collection of async // checks that (at a minimum) must pass for the // transaction to verify. // // https://zips.z.cash/protocol/protocol.pdf#joinsplitdesc checks . push ( primitives :: groth16 :: JOINSPLIT_VERIFIER . oneshot ( DescriptionWrapper ( & ( joinsplit , & joinsplit_data . pub_key ) ) . try_into ( ) ? , ) ) ; } // Consensus rule: The joinSplitSig MUST represent a // valid signature, under joinSplitPubKey, of the // sighash. // // Queue the validation of the JoinSplit signature while // adding the resulting future to our collection of // async checks that (at a minimum) must pass for the // transaction to verify. // // https://zips.z.cash/protocol/protocol.pdf#sproutnonmalleability // https://zips.z.cash/protocol/protocol.pdf#txnencodingandconsensus let ed25519_verifier = primitives :: ed25519 :: VERIFIER . clone ( ) ; let ed25519_item = ( joinsplit_data . pub_key , joinsplit_data . sig , shielded_sighash ) . into ( ) ; checks . push ( ed25519_verifier . oneshot ( ed25519_item ) ) ; } Ok ( checks ) }
Verifies a transaction's Sprout shielded join split data.
Verifies a transaction ' s Sprout shielded join split data .
joinsplit_data
&Option<transaction::JoinSplitData<Groth16Proof>>
shielded_sighash
&SigHash