proofbug

halo2 proof bug
git clone https://git.parazyd.org/proofbug
Log | Files | Refs

main.rs (1030B)


      1 use darkfi::{
      2     crypto::proof::VerifyingKey,
      3     tx::Transaction,
      4     util::serial::deserialize,
      5     zk::circuit::{BurnContract, MintContract},
      6 };
      7 
      8 fn main() {
      9     let tx_bytes = include_bytes!("transaction.bin");
     10     let tx: Transaction = deserialize(tx_bytes).unwrap();
     11 
     12     // println!("{:?}", tx);
     13 
     14     // https://github.com/darkrenaissance/darkfi/blob/master/src/crypto/proof.rs#L19
     15 
     16     // https://github.com/darkrenaissance/darkfi/blob/master/src/zk/circuit/burn_contract.rs
     17     let burn_vk = VerifyingKey::build(11, &BurnContract::default());
     18     for input in tx.inputs {
     19         let instances = input.revealed.make_outputs();
     20         input.burn_proof.verify(&burn_vk, &instances).unwrap();
     21     }
     22 
     23     // https://github.com/darkrenaissance/darkfi/blob/master/src/zk/circuit/mint_contract.rs
     24     let mint_vk = VerifyingKey::build(11, &MintContract::default());
     25     for output in tx.outputs {
     26         let instances = output.revealed.make_outputs();
     27         output.mint_proof.verify(&mint_vk, &instances).unwrap();
     28     }
     29 }