203 Commits

Author SHA1 Message Date
r4bbit
808d4f30bc
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-27 11:28:05 +01:00
r4bbit
0ed91e869e feat(programs): add Associated Token Account program with wallet CLI and tutorial
Introduce the ATA program, which derives deterministic per-token holding
accounts from (owner, token_definition) via SHA256, eliminating the need
to manually create and track holding account IDs.

Program (programs/associated_token_account/):
- Create, Transfer, and Burn instructions with PDA-based authorization
- Deterministic address derivation: SHA256(owner || definition) → seed → AccountId
- Idempotent Create (no-op if ATA already exists)

Wallet CLI (`wallet ata`):
- `address` — derive ATA address locally (no network call)
- `create`  — initialize an ATA on-chain
- `send`    — transfer tokens from owner's ATA to a recipient
- `burn`    — burn tokens from owner's ATA
- `list`    — query ATAs across multiple token definitions

Usage:
  wallet deploy-program artifacts/program_methods/associated_token_account.bin
  wallet ata address --owner <ID> --token-definition <DEF_ID>
  wallet ata create --owner Public/<ID> --token-definition <DEF_ID>
  wallet ata send --from Public/<ID> --token-definition <DEF_ID> --to <RECIPIENT> --amount 100
  wallet ata burn --holder Public/<ID> --token-definition <DEF_ID> --amount 50
  wallet ata list --owner <ID> --token-definition <DEF1> <DEF2>

Includes tutorial: docs/LEZ testnet v0.1 tutorials/associated-token-accounts.md
2026-03-26 13:19:29 +01:00
Daniil Polyakov
7b20a83379 fix: fixes after rebase & address comments 2026-03-20 00:48:04 +03:00
Daniil Polyakov
b631ef02c6 fix: final fixes & polishing 2026-03-20 00:47:37 +03:00
Daniil Polyakov
9d87e3b046 fix: fix lints 2026-03-20 00:41:05 +03:00
Daniil Polyakov
b254ebb185 feat: refactor sequencer RPC client-side 2026-03-20 00:41:05 +03:00
Daniil Polyakov
be94e133fa feat: refactor sequencer RPC server-side 2026-03-20 00:41:05 +03:00
jonesmarvin8
4fdefd3557 fix typo 2026-03-18 16:53:07 -04:00
jonesmarvin8
ce729f112d Merge branch 'main' into marvin/bip-32-comp 2026-03-18 16:47:39 -04:00
jonesmarvin8
0bcb626adc lint fixes 2026-03-18 10:28:52 -04:00
jonesmarvin8
ba8fdf4f29 fix conflicts from merging main 2026-03-17 19:16:09 -04:00
jonesmarvin8
8dd5037e28 Merge branch 'main' into marvin/nonce 2026-03-17 16:45:08 -04:00
Daniil Polyakov
d79ac3f9a8 fix: formatting 2026-03-17 21:25:30 +03:00
Daniil Polyakov
252848a145 feat: update rust to 1.94.0 2026-03-17 21:25:30 +03:00
Daniil Polyakov
aa462b66eb feat: add nursery clippy lints 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
jonesmarvin8
dd64f0b1f8 Merge branch 'main' into marvin/nonce 2026-03-16 11:22:24 -04:00
jonesmarvin8
b1747548b2 fix nullifer typo 2026-03-09 12:23:57 -04:00
Pravdyvy
fa406e7a86 fix: removed redundant logging 2026-03-05 15:20:22 +02:00
Pravdyvy
cb57baaa36 fix: integartion test on claiming path for token updated 2026-03-05 14:13:13 +02:00
Pravdyvy
e3764e1911 fix: shared secret receiver fix 2026-03-05 12:35:18 +02:00
jonesmarvin8
d863b763d1 Merge branch 'main' into marvin/nonce 2026-03-02 10:49:07 -05:00
Daniil Polyakov
529dfce413 fix: ensure wallet data is fully synced with fs 2026-02-26 16:25:24 +03:00
jonesmarvin8
fa6a99192e Merge branch 'main' into marvin/nonce 2026-02-17 18:26:48 -05:00
jonesmarvin8
a821f04fb8 Merge branch 'main' into marvin/nonce 2026-02-16 19:56:44 -05:00
jonesmarvin8
f8dfcac17a Merge branch 'main' into marvin/private_keys 2026-02-16 19:55:09 -05:00
jonesmarvin8
889326d2ad clean up and fixed tests 2026-02-16 19:53:32 -05:00
Sergio Chouhy
32c36af126 fmt, clippy 2026-02-16 15:56:28 -03:00
jonesmarvin8
77f2fb6994 update nonce mechanism 2026-02-12 19:22:03 -05:00
jonesmarvin8
943efd1433 Merge branch 'main' into marvin/private_keys 2026-02-12 10:33:00 -05:00
Daniil Polyakov
975cfb9ec6 feat: fully integrate Sequencer, Indexer and Explorer with Bedrock 2026-02-12 16:31:13 +03:00
jonesmarvin8
6a399ac36c Merge branch 'main' into marvin/private_keys 2026-02-11 11:49:57 -05:00
Daniil Polyakov
9909f02803 refactor: split token program into crates 2026-02-06 00:08:43 +03:00
Sergio Chouhy
2fc1ec0fdc Merge branch 'main' into schouhy/add-wallet-ffi-tests 2026-02-04 20:48:36 -03:00
Sergio Chouhy
5ac9953488 add ffi get account test 2026-02-04 11:36:10 -03:00
Sergio Chouhy
50b253fa00 move ffi tests to integration tests 2026-02-03 19:07:13 -03:00
fryorcraken
a5240925fc
Merge pull request #292 from logos-blockchain/fryorcraken/labels
add `wallet account label` feature
2026-02-02 14:30:33 +11:00
fryorcraken
636a3daedc
add wallet account label feature
- can add a label to own account via `wallet` CLI
- labels are displayed with `wallet account get` command
- labels are displayed with `wallet account list` command
- labels are persisted.
2026-01-28 15:19:09 +11:00
Pravdyvy
c0e879edae fix: suggestions fix 1 2026-01-27 09:46:31 +02:00
jonesmarvin8
c6aa0c41b6 update tests 2026-01-21 17:27:23 -05:00
Daniil Polyakov
4e46dbbdf4 feat: implement private multi chain calls in wallet (nssa) 2026-01-17 02:28:31 +03:00
Daniil Polyakov
7296088005 feat: introduce parallel integration tests, wallet without global vars and etc 2025-12-31 04:30:22 +03:00
Daniil Polyakov
2d1ee4b279 Merge branch 'main' into Pravdyvy/amm-wallet-integration 2025-12-26 23:07:48 +03:00
Pravdyvy
22f6d92ca6 Merge branch 'main' into Pravdyvy/amm-wallet-integration 2025-12-22 05:00:50 +02:00
Pravdyvy
4f15237446 fix: suggestions fix 2025-12-22 04:42:32 +02:00
Pravdyvy
c95c4b2f16 Merge branch 'main' into Pravdyvy/token-burn-mint-wallet-update 2025-12-22 04:04:09 +02:00
Sergio Chouhy
44f6f44fa2 Merge branch 'main' into schouhy/add-program-deployment-example-pda 2025-12-19 10:45:48 -03:00
Pravdyvy
144c037114 Merge branch 'main' into Pravdyvy/token-burn-mint-wallet-update 2025-12-19 12:13:43 +02:00
Sergio Chouhy
ef97fade99 feat: unzip init proofs from nsk 2025-12-18 17:57:13 +03:00