387 Commits

Author SHA1 Message Date
jonesmarvin8
08bae6fa82 troubleshooting 2026-04-09 18:13:37 -04:00
jonesmarvin8
521cb2312b various fixed tests 2026-04-08 17:41:55 -04:00
jonesmarvin8
730233f128 Merge branch 'marvin/refactor-keys-to-wallet' into marvin/private_transfer_simplified 2026-04-08 10:14:51 -04:00
jonesmarvin8
d67269e666 Merge branch 'main' into marvin/refactor-keys-to-wallet 2026-04-08 10:08:15 -04:00
fryorcraken
0dc8409efc
feat: add --account-label as alternative to --account-id across all wallet subcommands
Allow users to identify accounts by their human-readable label instead of the
full `Privacy/base58` account ID. This makes the CLI much more ergonomic for
users who have labeled their accounts.

- [x] Add `resolve_account_label()` in `helperfunctions.rs` that looks up a label,
  determines account privacy (public/private), and returns the full `Privacy/id` string
- [x] Add `--account-label` (or `--from-label`, `--to-label`, `--definition-label`,
  `--holder-label`, `--user-holding-*-label`) as mutually exclusive alternative to
  every `--account-id`-style flag across all subcommands:
  - `account get`, `account label`
  - `auth-transfer init`, `auth-transfer send`
  - `token new`, `token send`, `token burn`, `token mint`
  - `pinata claim`
  - `amm new`, `amm swap`, `amm add-liquidity`, `amm remove-liquidity`
- [x] Update zsh completion script with `_wallet_account_labels()` helper
- [x] Add bash completion script with `_wallet_get_account_labels()` helper

1. Start a local sequencer
2. Create accounts and label them: `wallet account new public --label alice`
3. Use labels in commands: `wallet account get --account-label alice`
4. Verify mutual exclusivity: `wallet account get --account-id <id> --account-label alice` should error
5. Test shell completions: `wallet account get --account-label <TAB>` should list labels

None

None

- [x] Complete PR description
- [x] Implement the core functionality
- [ ] Add/update tests
- [x] Add/update documentation and inline comments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 14:53:27 +10:00
jonesmarvin8
c54bd0a048 lint fixes 2026-04-07 18:34:22 -04:00
jonesmarvin8
f179d41f08 add identifier logic and fix unit tests 2026-04-07 17:37:38 -04:00
jonesmarvin8
38a64f6587 fix context issue 2026-04-07 17:34:11 -04:00
jonesmarvin8
92ae120ae7 initialize changes 2026-04-06 17:47:01 -04:00
jonesmarvin8
7b0eac6a3f identifiers added to privacy circuit 2026-04-02 19:24:01 -04:00
jonesmarvin8
c3c26b6c23 clean up
Added public account id changes
update tests (public account id and private account id)
nullifier fixes
2026-04-02 17:20:52 -04:00
jonesmarvin8
a4af07bc6d nullifier fixes 2026-04-02 13:36:13 -04:00
jonesmarvin8
de6a9f6c59 Merge branch 'main' into marvin/private_transfer_simplified 2026-04-02 13:11:53 -04:00
jonesmarvin8
15a41375e4 update nullifiers and tags 2026-04-02 13:09:20 -04:00
Andrea Franz
7d75eb2d59 chore(programs/amm): rename Swap to SwapExactInput 2026-04-02 16:10:12 +02:00
Andrea Franz
9a6ec0018b feat(programs/amm): add swap exact output functionality 2026-04-02 16:10:12 +02:00
r4bbit
3e24ae2736 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-04-01 16:04:47 +02:00
jonesmarvin8
73aa3af4db minor fixes 2026-03-27 19:54:47 -04:00
Daniil Polyakov
6780f1c9a4 feat: protect from public pda griefing attacks 2026-03-28 01:23:57 +03:00
Pravdyvy
8a806899e4 Merge branch 'main' into Pravdyvy/hardcoded-initial-state 2026-03-26 17:53:05 +02: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
Pravdyvy
9c90930bd6 Merge branch 'main' into Pravdyvy/hardcoded-initial-state 2026-03-20 14:55:42 +02:00
Daniil Polyakov
3913446cd2 fix: some wallet default config fixes after rebase 2026-03-20 01:21:50 +03:00
Daniil Polyakov
05c2c3a56d fix: encode transactions with borsh in sequencer rpc 2026-03-20 00:48:04 +03:00
Daniil Polyakov
7b20a83379 fix: fixes after rebase & address comments 2026-03-20 00:48:04 +03:00
Daniil Polyakov
325960d696 feat: remove override_rust_log from wallet config 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
Daniil Polyakov
bffc711470 refactor: move sequencer_ directories into sequencer 2026-03-20 00:36:07 +03:00
Pravdyvy
dc3650edd7 Merge branch 'main' into Pravdyvy/hardcoded-initial-state 2026-03-19 19:02:19 +02:00
Pravdyvy
afa0a63c95 fix: suggestions fix 2 2026-03-19 18:01:15 +02: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
5d9980cf63 lint fixes 2026-03-18 13:10:36 -04:00
Pravdyvy
a0ab6ad92d fix: lint fix 2026-03-18 18:32:05 +02:00
Pravdyvy
5ab7d40727 Merge branch 'main' into Pravdyvy/hardcoded-initial-state 2026-03-18 18:18:52 +02: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
b44e066e84 fix constructor 2026-03-17 09:29:00 -04:00
Daniil Polyakov
756f2f4135 feat: add workspace lints to every crate 2026-03-17 15:13:44 +03:00
jonesmarvin8
dd64f0b1f8 Merge branch 'main' into marvin/nonce 2026-03-16 11:22:24 -04:00
Pravdyvy
6e756ac371 Merge branch 'main' into Pravdyvy/hardcoded-initial-state 2026-03-16 15:20:48 +02:00