From 5b90347d46e5eb6fb5936c2bcb67bbc5b1c901b5 Mon Sep 17 00:00:00 2001 From: x Date: Wed, 8 Feb 2023 02:17:34 +0100 Subject: [PATCH] dao-exec: input value blind should be the sum of blinds used for input value commits --- bin/drk/src/rpc_dao.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/drk/src/rpc_dao.rs b/bin/drk/src/rpc_dao.rs index dc71098df..b5b98ea91 100644 --- a/bin/drk/src/rpc_dao.rs +++ b/bin/drk/src/rpc_dao.rs @@ -406,7 +406,6 @@ impl Drk { let user_coin_blind = pallas::Base::random(&mut OsRng); let dao_serial = pallas::Base::random(&mut OsRng); let dao_coin_blind = pallas::Base::random(&mut OsRng); - let input_value_blind = pallas::Scalar::random(&mut OsRng); // TODO: FIXME: Clean this up and create an API let exec_signature_secret = SecretKey::random(&mut OsRng); @@ -414,7 +413,6 @@ impl Drk { let mut xfer_inputs = vec![]; let mut input_coins = vec![]; - let mut input_value_blinds = vec![]; let mut input_amount = 0; for coin in coins { input_amount += coin.note.value; @@ -427,6 +425,7 @@ impl Drk { let money_merkle_tree = self.get_money_tree().await?; let money_merkle_root = money_merkle_tree.root(0).unwrap(); + let mut input_value_blind = pallas::Scalar::from(0); for coin in &input_coins { let value_blind = pallas::Scalar::random(&mut OsRng); let sig_secret = SecretKey::random(&mut OsRng); @@ -444,7 +443,7 @@ impl Drk { signature_secret: sig_secret, }); - input_value_blinds.push(value_blind); + input_value_blind += value_blind; } let input_sum = input_coins.iter().map(|x| x.note.value).sum::();