barretenberg
Loading...
Searching...
No Matches
claim_note.hpp
1#pragma once
2#include "barretenberg/join_split_example/types.hpp"
3
4#include "../bridge_call_data.hpp"
5#include "../value/create_partial_commitment.hpp"
6#include "complete_partial_commitment.hpp"
7#include "create_partial_commitment.hpp"
8#include "witness_data.hpp"
9
10namespace join_split_example {
11namespace proofs {
12namespace notes {
13namespace circuit {
14namespace claim {
15
16using namespace proof_system::plonk::stdlib;
17
19 suint_ct deposit_value;
21 field_ct value_note_partial_commitment;
22 field_ct input_nullifier;
23 field_ct partial_commitment;
24
26 group_ct const& owner,
27 bool_ct const& owner_account_required)
28 {
29 deposit_value = data.deposit_value;
30 bridge_call_data = data.bridge_call_data_local.to_safe_uint();
31 value_note_partial_commitment =
32 value::create_partial_commitment(data.note_secret, owner, owner_account_required, 0);
33 input_nullifier = data.input_nullifier;
34 partial_commitment =
35 create_partial_commitment(deposit_value, bridge_call_data, value_note_partial_commitment, input_nullifier);
36 }
37};
38
39struct claim_note {
40 suint_ct deposit_value;
42 field_ct value_note_partial_commitment;
43 field_ct input_nullifier;
44 suint_ct defi_interaction_nonce;
45 suint_ct fee;
46 field_ct commitment;
47
49 : deposit_value(data.deposit_value)
50 , bridge_call_data(data.bridge_call_data_local.to_safe_uint())
51 , value_note_partial_commitment(data.value_note_partial_commitment)
52 , input_nullifier(data.input_nullifier)
53 , defi_interaction_nonce(data.defi_interaction_nonce)
54 , fee(data.fee)
55 , commitment(complete_partial_commitment(
56 create_partial_commitment(
57 deposit_value, bridge_call_data, value_note_partial_commitment, input_nullifier),
58 defi_interaction_nonce,
59 fee))
60 {}
61
62 operator byte_array_ct() const { return byte_array_ct(commitment); }
63};
64
65} // namespace claim
66} // namespace circuit
67} // namespace notes
68} // namespace proofs
69} // namespace join_split_example
Definition: byte_array.hpp:9
Definition: field.hpp:10
Definition: safe_uint.hpp:17