39 Commits

Author SHA1 Message Date
r4bbit
f264d159fb
fix(wallet): use cryptographically secure entropy for mnemonic generation
The mnemonic/wallet generation was using a constant zero-byte array for entropy ([0u8; 32]), making all wallets deterministic based
solely on the password. This commit introduces proper random entropy using OsRng and enables users to back up their recovery phrase.

Changes:

- SeedHolder::new_mnemonic() now uses OsRng for 256-bit random entropy and returns the generated mnemonic
- Added SeedHolder::from_mnemonic() to recover a wallet from an existing mnemonic phrase
- WalletChainStore::new_storage() returns the mnemonic for user backup
- Added WalletChainStore::restore_storage() for recovery from a mnemonic
- WalletCore::new_init_storage() now returns the mnemonic
- Renamed reset_storage to restore_storage, which accepts a mnemonic for recovery
- CLI displays the recovery phrase when a new wallet is created
- RestoreKeys command now prompts for the mnemonic phrase via read_mnemonic_from_stdin()

Note: The password parameter is retained for future storage encryption but is no longer used in seed derivation (empty passphrase is used
 instead). This means the mnemonic alone is sufficient to recover accounts.

Usage:

On first wallet initialization, users will see:
IMPORTANT: Write down your recovery phrase and store it securely.
This is the only way to recover your wallet if you lose access.

Recovery phrase:
  word1 word2 word3 ... word24

To restore keys:
wallet restore-keys --depth 5
Input recovery phrase: <24 words>
Input password: <password>
2026-03-25 17:14:57 +01:00
jonesmarvin8
4fdefd3557 fix typo 2026-03-18 16:53:07 -04:00
Daniil Polyakov
252848a145 feat: update rust to 1.94.0 2026-03-17 21:25:30 +03:00
Daniil Polyakov
e3b93b6e9a feat: add restriction clippy lints 2026-03-17 21:25:30 +03:00
Daniil Polyakov
efe8393ba0 feat: add pedantic clippy lints 2026-03-17 21:25:30 +03:00
Pravdyvy
4950c1277c fix: suggestions fix 2026-03-05 17:25:53 +02:00
Pravdyvy
fa406e7a86 fix: removed redundant logging 2026-03-05 15:20:22 +02:00
Pravdyvy
e3764e1911 fix: shared secret receiver fix 2026-03-05 12:35:18 +02:00
jonesmarvin8
752ad89ac7 fixed with unified approach 2026-01-27 16:00:42 -05:00
jonesmarvin8
c6aa0c41b6 update tests 2026-01-21 17:27:23 -05:00
Pravdyvy
6c409b6fb1 Merge branch 'main' into Pravdyvy/deterministic-key-derivation 2025-11-27 13:46:35 +02:00
Pravdyvy
463942df80
Apply suggestions from code review 1
Co-authored-by: Daniil Polyakov <arjentix@gmail.com>
2025-11-26 07:07:58 +02:00
Daniil Polyakov
a714e3c563 feat: enhance rustfmt config 2025-11-26 00:33:09 +03:00
Daniil Polyakov
ea9c659fb1 refactor: rename Address to AccountId 2025-11-25 21:38:07 +03:00
Pravdyvy
20c276e63e fix: continuation of integration 2025-11-10 16:29:33 +02:00
Pravdyvy
af1e129b6b feat: public keys tree 2025-11-05 15:15:29 +02:00
Pravdyvy
9788f189b1 feat: stat of deterministic passwords 2025-11-04 16:09:04 +02:00
Oleksandr Pravdyvyi
4e36ae4679
fix; first refactor 2025-10-23 17:33:25 +03:00
Sergio Chouhy
4bb8bc94ff Merge branch 'main' into schouhy/wallet-minor-improvements 2025-10-06 16:08:06 -03:00
Pravdyvy
468b669c14
Merge branch 'main' into Pravdyvy/serde-json-removal-from-db 2025-10-06 11:43:03 +03:00
Sergio Chouhy
b2e51990c9 remove commented code 2025-10-03 23:05:11 -03:00
Sergio Chouhy
46f899ac95 fmt 2025-10-03 08:11:55 -03:00
Sergio Chouhy
aa8b138945 fmt clippy 2025-10-02 08:58:57 -03:00
Sergio Chouhy
a00773d5aa wip 2025-09-30 17:14:09 -03:00
Sergio Chouhy
f707d3893d remove unused function 2025-09-30 14:15:50 -03:00
Oleksandr Pravdyvyi
c3ae7ab0a2
fix: account id merge fix 2025-09-26 09:50:09 +03:00
Oleksandr Pravdyvyi
c58ef27224
feat: first db update 2025-09-25 11:53:42 +03:00
Oleksandr Pravdyvyi
85a16a2f04
fix: revers of scalar dep 2025-09-17 08:59:14 +03:00
Oleksandr Pravdyvyi
d07b813739
fix: deviations adjustments 2025-09-15 14:04:49 +03:00
Oleksandr Pravdyvyi
93fcbb8f61
Merge branch 'Pravdyvy/sequencer-update' into Pravdyvy/key-protocol-update-private 2025-09-15 10:49:48 +03:00
Oleksandr Pravdyvyi
23e79d3e17
fix: fmt 2025-09-08 15:23:32 +03:00
Oleksandr Pravdyvyi
a5123992c9
Merge branch 'main' into Pravdyvy/key-protocol-update-private 2025-09-08 14:53:22 +03:00
Oleksandr Pravdyvyi
33783e06d8
fix: keys structures updates 2025-09-08 14:48:58 +03:00
Oleksandr Pravdyvyi
324f477b63
fix: keys corect generatin 2025-09-05 14:47:58 +03:00
Oleksandr Pravdyvyi
7052bccfbc
fix: try edition 2024 2025-09-04 14:38:41 +03:00
Oleksandr Pravdyvyi
6967c0c22f
fix: update to pr 104 2025-09-02 09:01:33 +03:00
Oleksandr Pravdyvyi
0c7456d7a0
fix: first batch of wallet methods 2025-08-20 17:16:51 +03:00
Oleksandr Pravdyvyi
e617cac69c
fix: key proctocol crate updated 2025-08-18 16:15:25 +03:00
Oleksandr Pravdyvyi
35b636a27d
fix: clearing and renaming 2025-08-15 14:27:36 +03:00