From f9beaf549a181da5016089d1e1eeac9cf81f55e2 Mon Sep 17 00:00:00 2001
From: Nicolas80 <nicolas.pmail@protonmail.com>
Date: Sun, 23 Mar 2025 20:09:47 +0100
Subject: [PATCH] * Updated version to 0.4.1 * Added Changelog entry for the
 new version * Adapted some of the examples in config.md to take into account
 the new `-c` argument ** Did a simple addition of "-c sr25519" so that
 current examples still make sense and link to the same SS58 addresses

---
 CHANGELOG.md  | 29 +++++++++++++++++++++++++++++
 Cargo.lock    |  2 +-
 Cargo.toml    |  2 +-
 doc/config.md | 32 ++++++++++++++++++++++----------
 4 files changed, 53 insertions(+), 12 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 58f1d00..dced0c3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,35 @@
 
 List of changelogs ordered from latest to oldest
 
+## [0.4.1] - 2025-03-23
+### Added / Changed
+- We now use `ed25519` crypto scheme by default for all commands.  It means that if you import your substrate mnemonic without giving a specific argument to change the crypto scheme, the resulting SS58 address will not be the same as before (it was using `sr25519` for substrate mnemonic previously)
+  - Extra `-c` / `--crypto-scheme` argument allows to specify which crypto scheme to use (`sr25519` or `ed25519`) and having a default value of `ed25519` in most places.
+    - this argument is present in all places where you could provide `-S` / `--secret-format` argument
+  - Due to that change, the display of the vault (`vault list ...` commands) will not display the g1v1 public key of all `ed25519` \<Base\> keys by default anymore; you will have to provide an extra `--show-g1v1` argument for that.
+  - Another impact is that we can now `vault derive` any key; including the ones with `ed25519` crypto-scheme.
+    - It is still highly recommended to **only derive** keys based on a **substrate mnemonic**; as old `g1v1` keys with their _manual_ `id` & `secret` are not as secure as using a generated substrate mnemonic.
+  - There is an exception to the impacted commands: `vault migrate` will still import old key files as `sr25519` crypto-scheme keys; as it would otherwise not correspond to the SS58 Address of those key files.
+- It is now possible to perform `vault import` and `vault derive` commands without interactive prompts if all necessary optional arguments are provided.
+  - Please check for more details with commands:
+    - `vault import --help`
+    - `vault derive --help`
+  - If the command tries to override an existing vault entry, then it will still require manual input from the user!
+
+### Fixed
+- None
+
+### Deprecated
+- Two commands are still deprecated and will be removed in a future release:
+    - `gcli vault list-files`
+    - `gcli vault migrate`
+
+### Removed
+- None
+
+### CI/CD
+- None
+
 ## [0.4.0] - 2025-02-xx
 ### Changed
 - Old key files cannot be used directly anymore, they have to be migrated to the SQLite file database.  You can use the following commands for that:
diff --git a/Cargo.lock b/Cargo.lock
index a9cd348..0264e14 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2338,7 +2338,7 @@ dependencies = [
 
 [[package]]
 name = "gcli"
-version = "0.4.0"
+version = "0.4.1"
 dependencies = [
  "age",
  "anyhow",
diff --git a/Cargo.toml b/Cargo.toml
index ce66a64..8600c6d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,7 +10,7 @@ license = "AGPL-3.0-only"
 name = "gcli"
 repository = "https://git.duniter.org/clients/rust/gcli-v2s"
 description = "A command-line interface for Duniter v2s uses"
-version = "0.4.0"
+version = "0.4.1"
 
 [dependencies]
 # subxt is main dependency
diff --git a/doc/config.md b/doc/config.md
index 3874272..111baea 100644
--- a/doc/config.md
+++ b/doc/config.md
@@ -5,7 +5,7 @@ Some Äžcli commands require to have an address configured (for example to get ac
 
 ```sh
 # save Alice address to config file
-gcli -S predefined -s Alice config save
+gcli -S predefined -s Alice -c sr25519 config save
 
 # show config 
 gcli config show
@@ -46,10 +46,9 @@ Here is an example that:
 * makes a transfer from selected Address
 
 ```sh
-# add a new secret to the vault using substrate uri
-gcli vault import
+# add a new secret to the vault using substrate uri and crypto scheme sr25519
+gcli vault import -c sr25519
 # [stdout]
-# gcli vault import
 # Substrate URI can be a mnemonic or a mini-secret ('0x' prefixed seed) together with optional derivation path
 # > Substrate URI:  ********
 # 
@@ -159,8 +158,9 @@ gcli --help
 # Options:
 #   -i, --indexer <INDEXER>              Overwrite indexer endpoint
 #       --no-indexer                     Do not use indexer
-#   -s, --secret <SECRET>                Secret key or BIP39 mnemonic (only used when secret format is compatible) (eventually followed by derivation path)
 #   -S, --secret-format <SECRET_FORMAT>  Secret key format (seed, substrate, g1v1)
+#   -s, --secret <SECRET>                Secret key or BIP39 mnemonic (only used when secret format is compatible) (eventually followed by derivation path)
+#   -c, --crypto-scheme <CRYPTO_SCHEME>  Crypto scheme to use (sr25519, ed25519) [default: ed25519]
 #   -a <ADDRESS>                         SS58 Address
 #   -v <NAME>                            Name of an SS58 Address in the vault
 #   -u, --url <URL>                      Overwrite duniter websocket RPC endpoint
@@ -203,20 +203,32 @@ gcli vault derive --help
 # [stdout]
 # Add a derivation to an existing SS58 Address.
 # 
-# Only "sr25519" crypto scheme is supported for derivations.
-# 
+# Both "sr25519" and "ed25519" crypto schemes are supported
+# 		
 # Use command `vault list base` to see available <Base> account and their crypto scheme
-# And then use command 'vault list for' to find all accounts linked to that <Base> account.
+# And then use command 'vault list for' to find all accounts linked to that <Base> account
 # 
-# Usage: gcli vault derive <-a <ADDRESS>|-v <NAME>>
+# Usage: gcli vault derive [OPTIONS] <-a <ADDRESS>|-v <VAULT_NAME>>
 # 
 # Options:
 #   -a <ADDRESS>
 #           SS58 Address
 # 
-#   -v <NAME>
+#   -v <VAULT_NAME>
 #           Name of an SS58 Address in the vault
 # 
+#   -d, --derivation-path <DERIVATION_PATH>
+#           Derivation path (non-interactive mode)
+# 
+#   -p, --password <PASSWORD>
+#           Password to decrypt the <Base> account key (non-interactive mode)
+# 
+#       --no-password
+#           Use empty password to decrypt the <Base> account key (non-interactive mode)
+# 
+#   -n, --name <NAME>
+#           Name for the wallet entry (non-interactive mode) - "" empty string will be considered as None
+# 
 #   -h, --help
 #           Print help (see a summary with '-h')
 ```
\ No newline at end of file
-- 
GitLab