diff --git a/taiga_halo2/benches/action_proof.rs b/taiga_halo2/benches/action_proof.rs index 4ee6e274..d1df7443 100644 --- a/taiga_halo2/benches/action_proof.rs +++ b/taiga_halo2/benches/action_proof.rs @@ -15,7 +15,7 @@ use taiga_halo2::{ }, merkle_tree::MerklePath, nullifier::{Nullifier, NullifierKeyContainer}, - resource::{NoteType, RandomSeed, Resource}, + resource::{RandomSeed, Resource, ResourceKind}, }; fn bench_action_proof(name: &str, c: &mut Criterion) { @@ -24,16 +24,16 @@ fn bench_action_proof(name: &str, c: &mut Criterion) { let input_resource = { let rho = Nullifier::from(pallas::Base::random(&mut rng)); let nk = NullifierKeyContainer::from_key(pallas::Base::random(&mut rng)); - let note_type = { + let kind = { let app_vk = pallas::Base::random(&mut rng); let app_data_static = pallas::Base::random(&mut rng); - NoteType::new(app_vk, app_data_static) + ResourceKind::new(app_vk, app_data_static) }; let app_data_dynamic = pallas::Base::random(&mut rng); let value: u64 = rng.gen(); let rseed = RandomSeed::random(&mut rng); Resource { - note_type, + kind, app_data_dynamic, value, nk_container: nk, @@ -46,16 +46,16 @@ fn bench_action_proof(name: &str, c: &mut Criterion) { let mut output_resource = { let rho = input_resource.get_nf().unwrap(); let nk_com = NullifierKeyContainer::from_commitment(pallas::Base::random(&mut rng)); - let note_type = { + let kind = { let app_vk = pallas::Base::random(&mut rng); let app_data_static = pallas::Base::random(&mut rng); - NoteType::new(app_vk, app_data_static) + ResourceKind::new(app_vk, app_data_static) }; let app_data_dynamic = pallas::Base::random(&mut rng); let value: u64 = rng.gen(); let rseed = RandomSeed::random(&mut rng); Resource { - note_type, + kind, app_data_dynamic, value, nk_container: nk_com, diff --git a/taiga_halo2/benches/vp_proof.rs b/taiga_halo2/benches/vp_proof.rs index 06c49c87..1363d144 100644 --- a/taiga_halo2/benches/vp_proof.rs +++ b/taiga_halo2/benches/vp_proof.rs @@ -10,7 +10,7 @@ use taiga_halo2::{ constant::{NUM_RESOURCE, SETUP_PARAMS_MAP, VP_CIRCUIT_PARAMS_SIZE}, nullifier::{Nullifier, NullifierKeyContainer}, proof::Proof, - resource::{NoteType, RandomSeed, Resource}, + resource::{RandomSeed, Resource, ResourceKind}, }; fn bench_vp_proof(name: &str, c: &mut Criterion) { @@ -20,16 +20,16 @@ fn bench_vp_proof(name: &str, c: &mut Criterion) { let input_resources = [(); NUM_RESOURCE].map(|_| { let rho = Nullifier::from(pallas::Base::random(&mut rng)); let nk = NullifierKeyContainer::from_key(pallas::Base::random(&mut rng)); - let note_type = { + let kind = { let app_vk = pallas::Base::random(&mut rng); let app_data_static = pallas::Base::random(&mut rng); - NoteType::new(app_vk, app_data_static) + ResourceKind::new(app_vk, app_data_static) }; let app_data_dynamic = pallas::Base::random(&mut rng); let value: u64 = rng.gen(); let rseed = RandomSeed::random(&mut rng); Resource { - note_type, + kind, app_data_dynamic, value, nk_container: nk, @@ -44,16 +44,16 @@ fn bench_vp_proof(name: &str, c: &mut Criterion) { .map(|input| { let rho = input.get_nf().unwrap(); let nk_com = NullifierKeyContainer::from_commitment(pallas::Base::random(&mut rng)); - let note_type = { + let kind = { let app_vk = pallas::Base::random(&mut rng); let app_data_static = pallas::Base::random(&mut rng); - NoteType::new(app_vk, app_data_static) + ResourceKind::new(app_vk, app_data_static) }; let app_data_dynamic = pallas::Base::random(&mut rng); let value: u64 = rng.gen(); let rseed = RandomSeed::random(&mut rng); Resource { - note_type, + kind, app_data_dynamic, value, nk_container: nk_com, diff --git a/taiga_halo2/deprecated/taiga_sudoku/app_vp.rs b/taiga_halo2/deprecated/taiga_sudoku/app_vp.rs index 4bd89c1b..e2324d3d 100644 --- a/taiga_halo2/deprecated/taiga_sudoku/app_vp.rs +++ b/taiga_halo2/deprecated/taiga_sudoku/app_vp.rs @@ -597,23 +597,23 @@ pub mod tests { use pasta_curves::pallas; use rand::{Rng, RngCore}; use taiga_halo2::{ - resource::{Resource, NoteType, RandomSeed}, + resource::{Resource, ResourceKind, RandomSeed}, nullifier::{Nullifier, NullifierKeyContainer}, }; pub fn random_input_resource(mut rng: R) -> Resource { let rho = Nullifier::from(pallas::Base::random(&mut rng)); let nk = NullifierKeyContainer::from_key(pallas::Base::random(&mut rng)); - let note_type = { + let kind = { let app_vk = pallas::Base::random(&mut rng); let app_data_static = pallas::Base::random(&mut rng); - NoteType::new(app_vk, app_data_static) + ResourceKind::new(app_vk, app_data_static) }; let app_data_dynamic = pallas::Base::random(&mut rng); let value: u64 = rng.gen(); let rseed = RandomSeed::random(&mut rng); Resource { - note_type, + kind, app_data_dynamic, value, nk_container: nk, @@ -626,16 +626,16 @@ pub mod tests { pub fn random_output_resource(mut rng: R, rho: Nullifier) -> Resource { let nk_com = NullifierKeyContainer::from_commitment(pallas::Base::random(&mut rng)); - let note_type = { + let kind = { let app_vk = pallas::Base::random(&mut rng); let app_data_static = pallas::Base::random(&mut rng); - NoteType::new(app_vk, app_data_static) + ResourceKind::new(app_vk, app_data_static) }; let app_data_dynamic = pallas::Base::random(&mut rng); let value: u64 = rng.gen(); let rseed = RandomSeed::random(&mut rng); Resource { - note_type, + kind, app_data_dynamic, value, nk_container: nk_com, @@ -663,7 +663,7 @@ fn test_halo2_sudoku_app_vp_circuit_init() { let encoded_init_state = SudokuState::default().encode(); let previous_state = SudokuState::default(); let current_state = SudokuState::default(); - output_resources[0].note_type.app_data_static = + output_resources[0].kind.app_data_static = poseidon_hash(encoded_init_state, current_state.encode()); output_resources[0].value = 1u64; let owned_resource_id = output_resources[0].commitment().inner(); @@ -737,13 +737,13 @@ fn test_halo2_sudoku_app_vp_circuit_update() { [6, 0, 7, 4, 3, 5, 1, 9, 8], ], }; - input_resources[0].note_type.app_data_static = + input_resources[0].kind.app_data_static = poseidon_hash(encoded_init_state, previous_state.encode()); input_resources[0].value = 1u64; - output_resources[0].note_type.app_data_static = + output_resources[0].kind.app_data_static = poseidon_hash(encoded_init_state, current_state.encode()); output_resources[0].value = 1u64; - output_resources[0].note_type.app_vk = input_resources[0].note_type.app_vk; + output_resources[0].kind.app_vk = input_resources[0].kind.app_vk; SudokuAppValidityPredicateCircuit { owned_resource_id: input_resources[0].get_nf().unwrap().inner(), input_resources, @@ -813,13 +813,13 @@ fn halo2_sudoku_app_vp_circuit_final() { [6, 2, 7, 4, 3, 5, 1, 9, 8], ], }; - input_resources[0].note_type.app_data_static = + input_resources[0].kind.app_data_static = poseidon_hash(encoded_init_state, previous_state.encode()); input_resources[0].value = 1u64; - output_resources[0].note_type.app_data_static = + output_resources[0].kind.app_data_static = poseidon_hash(encoded_init_state, current_state.encode()); output_resources[0].value = 0u64; - output_resources[0].note_type.app_vk = input_resources[0].note_type.app_vk; + output_resources[0].kind.app_vk = input_resources[0].kind.app_vk; SudokuAppValidityPredicateCircuit { owned_resource_id: input_resources[0].get_nf().unwrap().inner(), input_resources, diff --git a/taiga_halo2/deprecated/taiga_sudoku/dealer_intent_app_vp.rs b/taiga_halo2/deprecated/taiga_sudoku/dealer_intent_app_vp.rs index 219dc6b8..02a14e6e 100644 --- a/taiga_halo2/deprecated/taiga_sudoku/dealer_intent_app_vp.rs +++ b/taiga_halo2/deprecated/taiga_sudoku/dealer_intent_app_vp.rs @@ -366,7 +366,7 @@ fn test_halo2_dealer_intent_vp_circuit() { .collect::>(); let encoded_puzzle = pallas::Base::random(&mut rng); let sudoku_app_vk = pallas::Base::random(&mut rng); - output_resources[0].note_type.app_data_static = + output_resources[0].kind.app_data_static = DealerIntentValidityPredicateCircuit::compute_app_data_static( encoded_puzzle, sudoku_app_vk, diff --git a/taiga_halo2/src/circuit/integrity.rs b/taiga_halo2/src/circuit/integrity.rs index e144f7a3..6e43741f 100644 --- a/taiga_halo2/src/circuit/integrity.rs +++ b/taiga_halo2/src/circuit/integrity.rs @@ -276,7 +276,7 @@ pub fn check_output_resource( }) } -pub fn derive_note_type( +pub fn derive_kind( mut layouter: impl Layouter, hash_to_curve_config: HashToCurveConfig, ecc_chip: EccChip, @@ -291,7 +291,7 @@ pub fn derive_note_type( )?; // Assign a new `NonIdentityPoint` and constran equal to hash_to_curve point since `Point` doesn't have mul operation - // IndentityPoint is an invalid resource type and it returns an error. + // IndentityPoint is an invalid resource kind and it returns an error. let non_identity_point = app_vk .value() .zip(app_data_static.value()) @@ -300,11 +300,11 @@ pub fn derive_note_type( }); let non_identity_point_var = NonIdentityPoint::new( ecc_chip, - layouter.namespace(|| "non-identity resource type"), + layouter.namespace(|| "non-identity resource kind"), non_identity_point, )?; point.constrain_equal( - layouter.namespace(|| "non-identity resource type"), + layouter.namespace(|| "non-identity resource kind"), &non_identity_point_var, )?; Ok(non_identity_point_var) @@ -323,9 +323,9 @@ pub fn compute_value_commitment( v_output: AssignedCell, rcv: pallas::Scalar, ) -> Result>, Error> { - // input value point - let note_type_input = derive_note_type( - layouter.namespace(|| "derive input resource type"), + // input value base point + let input_kind = derive_kind( + layouter.namespace(|| "derive input resource kind"), hash_to_curve_config.clone(), ecc_chip.clone(), app_address_input, @@ -337,11 +337,11 @@ pub fn compute_value_commitment( &v_input, )?; let (value_point_input, _) = - note_type_input.mul(layouter.namespace(|| "input value point"), v_input_scalar)?; + input_kind.mul(layouter.namespace(|| "input value point"), v_input_scalar)?; - // output value point - let note_type_output = derive_note_type( - layouter.namespace(|| "derive output resource type"), + // output value base point + let output_kind = derive_kind( + layouter.namespace(|| "derive output resource kind"), hash_to_curve_config, ecc_chip.clone(), app_address_output, @@ -353,7 +353,7 @@ pub fn compute_value_commitment( &v_output, )?; let (value_point_output, _) = - note_type_output.mul(layouter.namespace(|| "output value point"), v_output_scalar)?; + output_kind.mul(layouter.namespace(|| "output value point"), v_output_scalar)?; // Get and constrain the negative output value point let neg_v_point_output = Point::new( diff --git a/taiga_halo2/src/circuit/vp_examples/or_relation_intent.rs b/taiga_halo2/src/circuit/vp_examples/or_relation_intent.rs index d031d92b..ea5eb9cf 100644 --- a/taiga_halo2/src/circuit/vp_examples/or_relation_intent.rs +++ b/taiga_halo2/src/circuit/vp_examples/or_relation_intent.rs @@ -318,8 +318,8 @@ fn test_halo2_or_relation_intent_vp_circuit() { let mut output_resources = [(); NUM_RESOURCE].map(|_| random_resource(&mut rng)); let token_1 = Token::new("token1".to_string(), 1u64); let token_2 = Token::new("token2".to_string(), 2u64); - output_resources[0].note_type.app_vk = *COMPRESSED_TOKEN_VK; - output_resources[0].note_type.app_data_static = token_1.encode_name(); + output_resources[0].kind.app_vk = *COMPRESSED_TOKEN_VK; + output_resources[0].kind.app_data_static = token_1.encode_name(); output_resources[0].value = token_1.value(); let nk = pallas::Base::random(&mut rng); diff --git a/taiga_halo2/src/circuit/vp_examples/receiver_vp.rs b/taiga_halo2/src/circuit/vp_examples/receiver_vp.rs index ebaef97a..e7e72d85 100644 --- a/taiga_halo2/src/circuit/vp_examples/receiver_vp.rs +++ b/taiga_halo2/src/circuit/vp_examples/receiver_vp.rs @@ -254,8 +254,8 @@ impl ValidityPredicateCircuit for ReceiverValidityPredicateCircuit { self.get_output_resources()[1] }; let message = vec![ - target_resource.note_type.app_vk, - target_resource.note_type.app_data_static, + target_resource.kind.app_vk, + target_resource.kind.app_data_static, target_resource.app_data_dynamic, pallas::Base::from(target_resource.value), target_resource.rho.inner(), diff --git a/taiga_halo2/src/circuit/vp_examples/token.rs b/taiga_halo2/src/circuit/vp_examples/token.rs index b0b5d064..510c9efe 100644 --- a/taiga_halo2/src/circuit/vp_examples/token.rs +++ b/taiga_halo2/src/circuit/vp_examples/token.rs @@ -550,7 +550,7 @@ fn test_halo2_token_vp_circuit() { let output_resources = [(); NUM_RESOURCE].map(|_| random_resource(&mut rng)); let token_name = TokenName("Token_name".to_string()); let auth = TokenAuthorization::random(&mut rng); - input_resources[0].note_type.app_data_static = token_name.encode(); + input_resources[0].kind.app_data_static = token_name.encode(); input_resources[0].app_data_dynamic = auth.to_app_data_dynamic(); TokenValidityPredicateCircuit { owned_resource_id: input_resources[0].get_nf().unwrap().inner(), diff --git a/taiga_halo2/src/constant.rs b/taiga_halo2/src/constant.rs index eaf5b589..06d662d2 100644 --- a/taiga_halo2/src/constant.rs +++ b/taiga_halo2/src/constant.rs @@ -56,7 +56,7 @@ pub const ACTION_OUTPUT_VP_CM_2_ROW_IDX: usize = 8; pub const POSEIDON_TO_CURVE_INPUT_LEN: usize = 3; pub const CURVE_ID: &str = "pallas"; -pub const VALUE_BASE_DOMAIN_POSTFIX: &str = "Taiga-NoteType"; +pub const VALUE_BASE_DOMAIN_POSTFIX: &str = "Taiga-ResourceKind"; pub const VP_CIRCUIT_PUBLIC_INPUT_NUM: usize = VP_CIRCUIT_MANDATORY_PUBLIC_INPUT_NUM + VP_CIRCUIT_CUSTOM_PUBLIC_INPUT_NUM diff --git a/taiga_halo2/src/resource.rs b/taiga_halo2/src/resource.rs index bc52268b..03af9a8b 100644 --- a/taiga_halo2/src/resource.rs +++ b/taiga_halo2/src/resource.rs @@ -90,8 +90,8 @@ impl Hash for ResourceCommitment { #[cfg_attr(feature = "nif", module = "Taiga.Resource")] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Resource { - pub note_type: NoteType, - /// app_data_dynamic is the data defined in application vp and will NOT be used to derive type + pub kind: ResourceKind, + /// app_data_dynamic is the data defined in application vp and will NOT be used to derive kind /// sub-vps and any other data can be encoded to the app_data_dynamic pub app_data_dynamic: pallas::Base, /// value denotes the amount of the resource. @@ -108,12 +108,12 @@ pub struct Resource { pub is_merkle_checked: bool, } -/// The parameters in the NoteType are used to derive resource type. +/// The parameters in the ResourceKind are used to derive resource kind. #[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] #[cfg_attr(feature = "nif", derive(NifStruct))] -#[cfg_attr(feature = "nif", module = "Taiga.NoteType")] +#[cfg_attr(feature = "nif", module = "Taiga.ResourceKind")] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct NoteType { +pub struct ResourceKind { /// app_vk is the compressed verifying key of VP pub app_vk: pallas::Base, /// app_data_static is the encoded data that is defined in application vp @@ -144,9 +144,9 @@ impl Resource { is_merkle_checked: bool, rseed: RandomSeed, ) -> Self { - let note_type = NoteType::new(app_vk, app_data_static); + let kind = ResourceKind::new(app_vk, app_data_static); Self { - note_type, + kind, app_data_dynamic, value, nk_container: NullifierKeyContainer::Key(nk), @@ -167,9 +167,9 @@ impl Resource { nk_com: pallas::Base, is_merkle_checked: bool, ) -> Self { - let note_type = NoteType::new(app_vk, app_data_static); + let kind = ResourceKind::new(app_vk, app_data_static); Self { - note_type, + kind, app_data_dynamic, value, nk_container: NullifierKeyContainer::Commitment(nk_com), @@ -192,9 +192,9 @@ impl Resource { psi: pallas::Base, rcm: pallas::Base, ) -> Self { - let note_type = NoteType::new(app_vk, app_data_static); + let kind = ResourceKind::new(app_vk, app_data_static); Self { - note_type, + kind, app_data_dynamic, value, nk_container, @@ -208,13 +208,13 @@ impl Resource { pub fn random_padding_resource(mut rng: R) -> Self { let app_vk = *COMPRESSED_TRIVIAL_VP_VK; let app_data_static = pallas::Base::random(&mut rng); - let note_type = NoteType::new(app_vk, app_data_static); + let kind = ResourceKind::new(app_vk, app_data_static); let app_data_dynamic = pallas::Base::random(&mut rng); let rho = Nullifier::from(pallas::Base::random(&mut rng)); let nk = NullifierKeyContainer::from_key(pallas::Base::random(&mut rng)); let rseed = RandomSeed::random(&mut rng); Resource { - note_type, + kind, app_data_dynamic, value: 0, nk_container: nk, @@ -262,16 +262,16 @@ impl Resource { self.nk_container.get_commitment() } - pub fn get_note_type(&self) -> pallas::Point { - self.note_type.derive_note_type() + pub fn get_kind(&self) -> pallas::Point { + self.kind.derive_kind() } pub fn get_app_vk(&self) -> pallas::Base { - self.note_type.app_vk + self.kind.app_vk } pub fn get_app_data_static(&self) -> pallas::Base { - self.note_type.app_data_static + self.kind.app_data_static } pub fn get_psi(&self) -> pallas::Base { @@ -301,9 +301,9 @@ impl BorshSerialize for Resource { fn serialize(&self, writer: &mut W) -> std::io::Result<()> { use byteorder::{LittleEndian, WriteBytesExt}; // Write app_vk - writer.write_all(&self.note_type.app_vk.to_repr())?; + writer.write_all(&self.kind.app_vk.to_repr())?; // Write app_data_static - writer.write_all(&self.note_type.app_data_static.to_repr())?; + writer.write_all(&self.kind.app_data_static.to_repr())?; // Write app_data_dynamic writer.write_all(&self.app_data_dynamic.to_repr())?; // Write resource value @@ -406,7 +406,7 @@ impl BorshDeserialize for Resource { } } -impl NoteType { +impl ResourceKind { pub fn new(vk: pallas::Base, data: pallas::Base) -> Self { Self { app_vk: vk, @@ -414,13 +414,13 @@ impl NoteType { } } - pub fn derive_note_type(&self) -> pallas::Point { + pub fn derive_kind(&self) -> pallas::Point { let inputs = [self.app_vk, self.app_data_static]; poseidon_to_curve::(&inputs) } } -impl Hash for NoteType { +impl Hash for ResourceKind { fn hash(&self, state: &mut H) { self.app_vk.to_repr().as_ref().hash(state); self.app_data_static.to_repr().as_ref().hash(state); @@ -563,23 +563,23 @@ impl ResourceValidityPredicates { #[cfg(test)] pub mod tests { - use super::{NoteType, RandomSeed, Resource}; + use super::{RandomSeed, Resource, ResourceKind}; use crate::nullifier::tests::*; use halo2_proofs::arithmetic::Field; use pasta_curves::pallas; use rand::{Rng, RngCore}; - pub fn random_note_type(mut rng: R) -> NoteType { + pub fn random_kind(mut rng: R) -> ResourceKind { let app_vk = pallas::Base::random(&mut rng); let app_data_static = pallas::Base::random(&mut rng); - NoteType::new(app_vk, app_data_static) + ResourceKind::new(app_vk, app_data_static) } pub fn random_resource(mut rng: R) -> Resource { let rho = random_nullifier(&mut rng); let rseed = RandomSeed::random(&mut rng); Resource { - note_type: random_note_type(&mut rng), + kind: random_kind(&mut rng), app_data_dynamic: pallas::Base::random(&mut rng), value: rng.gen(), nk_container: random_nullifier_key(&mut rng), @@ -592,7 +592,7 @@ pub mod tests { #[cfg(feature = "borsh")] #[test] - fn note_borsh_serialization_test() { + fn resource_borsh_serialization_test() { use borsh::BorshDeserialize; use rand::rngs::OsRng; @@ -604,8 +604,8 @@ pub mod tests { // BorshSerialize let borsh = borsh::to_vec(&input_resource).unwrap(); // BorshDeserialize - let de_note: Resource = BorshDeserialize::deserialize(&mut borsh.as_ref()).unwrap(); - assert_eq!(input_resource, de_note); + let de_resource: Resource = BorshDeserialize::deserialize(&mut borsh.as_ref()).unwrap(); + assert_eq!(input_resource, de_resource); } let mut output_resource = input_resource; @@ -614,8 +614,8 @@ pub mod tests { // BorshSerialize let borsh = borsh::to_vec(&output_resource).unwrap(); // BorshDeserialize - let de_note: Resource = BorshDeserialize::deserialize(&mut borsh.as_ref()).unwrap(); - assert_eq!(output_resource, de_note); + let de_resource: Resource = BorshDeserialize::deserialize(&mut borsh.as_ref()).unwrap(); + assert_eq!(output_resource, de_resource); } let icm = input_resource.commitment(); diff --git a/taiga_halo2/src/taiga_api.rs b/taiga_halo2/src/taiga_api.rs index 0796291d..ccb53bae 100644 --- a/taiga_halo2/src/taiga_api.rs +++ b/taiga_halo2/src/taiga_api.rs @@ -20,7 +20,7 @@ use borsh::{BorshDeserialize, BorshSerialize}; /// Create a resource /// app_vk is the compressed verifying key of application(static) VP /// app_data_static is the encoded data that is defined in application vp -/// app_data_dynamic is the data defined in application vp and will NOT be used to derive type +/// app_data_dynamic is the data defined in application vp and will NOT be used to derive kind /// value is the quantity of resources /// nk is the nullifier key /// rho is the old nullifier diff --git a/taiga_halo2/src/transparent_ptx.rs b/taiga_halo2/src/transparent_ptx.rs index 667f3189..ee2749b6 100644 --- a/taiga_halo2/src/transparent_ptx.rs +++ b/taiga_halo2/src/transparent_ptx.rs @@ -114,7 +114,7 @@ pub mod testing { let input_resource_1 = random_resource(&mut rng); let mut output_resource_1 = { let mut resource = random_resource(&mut rng); - resource.note_type = input_resource_1.note_type; + resource.kind = input_resource_1.kind; resource.value = input_resource_1.value; resource }; @@ -130,7 +130,7 @@ pub mod testing { let input_resource_2 = random_resource(&mut rng); let mut output_resource_2 = { let mut resource = random_resource(&mut rng); - resource.note_type = input_resource_2.note_type; + resource.kind = input_resource_2.kind; resource.value = input_resource_2.value; resource }; diff --git a/taiga_halo2/src/value_commitment.rs b/taiga_halo2/src/value_commitment.rs index 558916e3..5bc74c7a 100644 --- a/taiga_halo2/src/value_commitment.rs +++ b/taiga_halo2/src/value_commitment.rs @@ -22,8 +22,8 @@ impl ValueCommitment { output_resource: &Resource, blind_r: &pallas::Scalar, ) -> Self { - let base_input = input_resource.get_note_type(); - let base_output = output_resource.get_note_type(); + let base_input = input_resource.get_kind(); + let base_output = output_resource.get_kind(); ValueCommitment( base_input * pallas::Scalar::from(input_resource.value) - base_output * pallas::Scalar::from(output_resource.value)