barretenberg
Loading...
Searching...
No Matches
value_note.hpp
1#pragma once
2#include "barretenberg/join_split_example/types.hpp"
3#include "commit.hpp"
4#include "witness_data.hpp"
5
6namespace join_split_example::proofs::notes::circuit::value {
7
8using namespace proof_system::plonk::stdlib;
9
10struct value_note {
11 group_ct owner;
12 suint_ct value;
13 field_ct secret;
14 suint_ct asset_id;
15 bool_ct account_required;
16 field_ct input_nullifier;
17 field_ct commitment;
18 field_ct creator_pubkey;
19
20 value_note(witness_data const& note)
21 : owner(note.owner)
22 , value(note.value)
23 , secret(note.secret)
24 , asset_id(note.asset_id)
25 , account_required(note.account_required)
26 , input_nullifier(note.input_nullifier)
27 , commitment(value::commit(note))
28 , creator_pubkey(note.creator_pubkey)
29 {}
30
31 operator byte_array_ct() const { return byte_array_ct(commitment); }
32};
33
34} // namespace join_split_example::proofs::notes::circuit::value
Definition: byte_array.hpp:9
Definition: field.hpp:10
Definition: safe_uint.hpp:17