From 4cab82d15ae7bc7c0864273465a0704f79481772 Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Wed, 20 Mar 2024 23:25:44 +0000 Subject: [PATCH] chore: update readme --- README.md | 9 ++------- crates/cashu/src/dhke.rs | 14 +++++++------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e2e05971..b5828b5d 100644 --- a/README.md +++ b/README.md @@ -20,13 +20,8 @@ Experimental for this project can be found in the [cashu-crab-bindings](https:// - :heavy_check_mark: [NUT-07](https://github.com/cashubtc/nuts/blob/main/07.md) - :heavy_check_mark: [NUT-08](https://github.com/cashubtc/nuts/blob/main/08.md) - :heavy_check_mark: [NUT-09](https://github.com/cashubtc/nuts/blob/main/09.md) - - -## Supported token formats: - -- :x: v1 read (deprecated) -- :x: v2 read (deprecated) -- :heavy_check_mark: [v3](https://github.com/cashubtc/nuts/blob/main/00.md#023---v3-tokens) read/write +- :heavy_check_mark: [NUT-09](https://github.com/cashubtc/nuts/blob/main/10.md) +- :heavy_check_mark: [NUT-09](https://github.com/cashubtc/nuts/blob/main/11.md) ## License diff --git a/crates/cashu/src/dhke.rs b/crates/cashu/src/dhke.rs index 41c908fa..9d2c08bd 100644 --- a/crates/cashu/src/dhke.rs +++ b/crates/cashu/src/dhke.rs @@ -93,21 +93,21 @@ mod wallet { keys: &Keys, ) -> Result { let mut proofs = vec![]; - for (i, promise) in promises.into_iter().enumerate() { - let blinded_c = promise.c; + for ((blinded_signature, r), secret) in promises.into_iter().zip(rs).zip(secrets) { + let blinded_c = blinded_signature.c; let a: PublicKey = keys - .amount_key(promise.amount) + .amount_key(blinded_signature.amount) .ok_or(error::wallet::Error::CustomError( "Could not get proofs".to_string(), ))? .to_owned(); - let unblinded_signature = unblind_message(blinded_c, rs[i].clone().into(), a)?; + let unblinded_signature = unblind_message(blinded_c, r.into(), a)?; let proof = Proof::new( - promise.amount, - promise.keyset_id, - secrets[i].clone(), + blinded_signature.amount, + blinded_signature.keyset_id, + secret, unblinded_signature, );