barretenberg
Loading...
Searching...
No Matches
witness_data.hpp
1#pragma once
2
3#include "../../constants.hpp"
4#include "../../native/claim/claim_note.hpp"
5#include "../../native/claim/claim_note_tx_data.hpp"
6#include "../bridge_call_data.hpp"
7#include "barretenberg/join_split_example/types.hpp"
8
9namespace join_split_example::proofs::notes::circuit::claim {
10
11using namespace proof_system::plonk::stdlib;
12
18 suint_ct deposit_value;
19 bridge_call_data bridge_call_data_local;
20 suint_ct defi_interaction_nonce;
21 suint_ct fee;
22 field_ct value_note_partial_commitment;
23 field_ct input_nullifier;
24
26 {
27 deposit_value =
28 suint_ct(witness_ct(&composer, note_data.deposit_value), DEFI_DEPOSIT_VALUE_BIT_LENGTH, "deposit_value");
29 bridge_call_data_local = bridge_call_data(&composer, note_data.bridge_call_data);
30 defi_interaction_nonce = suint_ct(witness_ct(&composer, note_data.defi_interaction_nonce),
31 DEFI_INTERACTION_NONCE_BIT_LENGTH,
32 "defi_interaction_nonce");
33 fee = suint_ct(witness_ct(&composer, note_data.fee), TX_FEE_BIT_LENGTH, "fee");
34 value_note_partial_commitment = witness_ct(&composer, note_data.value_note_partial_commitment);
35 input_nullifier = witness_ct(&composer, note_data.input_nullifier);
36 }
37};
38
44 suint_ct deposit_value;
45 bridge_call_data bridge_call_data_local;
46 field_ct note_secret;
47 field_ct input_nullifier;
48
51 {
52 deposit_value =
53 suint_ct(witness_ct(&composer, note_data.deposit_value), DEFI_DEPOSIT_VALUE_BIT_LENGTH, "deposit_value");
54 bridge_call_data_local = bridge_call_data(&composer, note_data.bridge_call_data);
55 note_secret = witness_ct(&composer, note_data.note_secret);
56 input_nullifier = witness_ct(&composer, note_data.input_nullifier);
57 }
58};
59
60inline std::ostream& operator<<(std::ostream& os, partial_claim_note_witness_data const& tx)
61{
62 return os << "{ deposit_value: " << tx.deposit_value
63 << ", bridge_call_data: " << tx.bridge_call_data_local.to_safe_uint() << " }";
64}
65} // namespace join_split_example::proofs::notes::circuit::claim
Definition: ultra_circuit_builder.hpp:31
Definition: field.hpp:10
Definition: safe_uint.hpp:17
Definition: witness.hpp:10