Nostr
Ajoute les profiles get et set sur un relay Nostr. Génère la clé secp256k1 à partir de la private key du vault. Faites ce que vous voulez de ça.
Merge request reports
Activity
requested review from @Nicolas80
assigned to @pokapow
removed review request for @Nicolas80
34 37 } else { 35 38 "(no address)".to_string() 36 39 }; 40 let relay = if let Some(relay) = &self.relay { 41 relay.clone() 42 } else { 43 "(no relay)".to_string() 44 }; 37 45 writeln!(f, "Ğcli config")?; 38 46 writeln!(f, "duniter endpoint {}", self.duniter_endpoint)?; 39 47 writeln!(f, "indexer endpoint {}", self.indexer_endpoint)?; 40 write!(f, "address {address}") 48 writeln!(f, "address {address}")?; 49 write!(f, "nostr relay {relay}") - Comment on lines +48 to +49
I would keep the "address" last, also because I add the Vault data when that address is in the vault:
gcli config show Ğcli config duniter endpoint wss://archive-rpc.gdev.de.brussels.ovh indexer endpoint https://squid-hasura.gdev.de.brussels.ovh/v1/graphql address 5DFJF7tY4bpbpcKPJcBTQaKuCDEPCpiz8TRjpmLeTtweqmXL (Vault: Base[address:5DFJF7tY4bpbpcKPJcBTQaKuCDEPCpiz8TRjpmLeTtweqmXL, g1v1_pub_key:4XDM51AWupjKLWkVPxxJxrqN8DEhmPuY3S1FEepvHvxN, name:Some("predefined"), crypto_scheme:Some(Ed25519)])
- src/commands/profile.rs 0 → 100644
262 match verify_result { 263 Ok(true) => { 264 Ok(()) 265 }, 266 Ok(false) => { 267 self.try_alternative_signing(keypair) 268 }, 269 Err(_e) => { 270 self.try_alternative_signing(keypair) 271 } 272 } 273 } 274 275 /// Try an alternative signing method if the first one fails 276 fn try_alternative_signing(&mut self, keypair: &KeyPair) -> Result<(), GcliError> { 277 // Use a different approach for key derivation - Comment on lines +266 to +277
I don't know NOSTR but I find odd that the way to make a valid signature would be non-deterministic and require 3 different signing methods ?
After making tests with both sr25519 & ed25519 crypto schemes and checking which method works for what; shouldn't it always work for the same crypto schemes ?
Speaking of test; I think it would be a good idea to add 2 simple tests in this class, where we would use the
SUBSTRATE_MNEMONIC
to get the ed25519 or sr25519 KeyPair, then create and sign a simpleNostrProfile
and show the resulting serialized version (+ test that as an expected_serialized value that we can see in the test code).That way it also protects the code for changes that would impact the signatures.
Edited by Nicolas80