412 Commits

Author SHA1 Message Date
Moudy
9e207450d6 fix: resolve merge conflicts with main 2026-05-05 12:37:54 +02:00
Moudy
8517906025 Merge branch 'main' into moudy/feat-strong-type-circuit-input 2026-04-30 20:17:47 +02:00
Moudy
4690ca56cc fix: remove epoch and ratcheting, fix PDA identifier 2026-04-30 16:34:26 +02:00
Moudy
98da9b26cc fix: address PR review feedback
- Rename PrivacyPreservingCircuitInputAccount to InputAccountIdentity (drop the PrivacyPreservingCircuit prefix; add Identity suffix)
- Rename PrivacyPreservingCircuitInput.accounts to account_identities
- Rename AccountManager.accounts() to account_identities() and loop variables to account_identity
- Drop legacy mask-1/2/3 references from variant doc comments and guest comments
- Remove the explanatory comments about deleted parallel-vec tests; moved to the PR description
- Rebake privacy_preserving_circuit and test program artifacts
2026-04-30 15:46:36 +02:00
Moudy
4c28133448 fix: resolve merge conflicts 2026-04-30 15:04:33 +02:00
Moudy
f375a35929 fix: address PR review feedback
- Add SealingPublicKey/SealingSecretKey type aliases for seal_for/unseal
- Generalize PrivateGroupPda to PrivatePda with pre-resolved keys
- Rename group_pda_spender to private_pda_spender
- Rename group_pda_accounts to pda_accounts with serde alias
- Remove unused storage_mut()
- Remove stale group_pda_router.bin artifact
2026-04-30 09:11:08 +02:00
Sergio Chouhy
72756e8622 Merge branch 'main' into schouhy/generalize-npk-to-multiple-accounts 2026-04-29 12:28:05 -03:00
Moudy
198eac1cf1 refactor: address PR #449 review feedback 2026-04-29 10:11:37 +02:00
Moudy
f7349656c7 refactor: strong-type PrivacyPreservingCircuitInput with per-account enum 2026-04-29 07:37:30 +02:00
Sergio Chouhy
a23e44a8df fmt and clippy 2026-04-28 00:18:57 -03:00
Sergio Chouhy
aea397565d add test. Remove private sync skip when no private accounts 2026-04-28 00:04:42 -03:00
Sergio Chouhy
f512a3bf0f refactor wallet config to use identifiers instead of the redundant account_id field 2026-04-27 23:12:30 -03:00
Sergio Chouhy
f0b89f8acb use vec<identifiers> in persistentaccountdataprivate to avoid the hacky workaround with identifier=0 for unused accounts 2026-04-27 21:09:33 -03:00
Sergio Chouhy
c3f47f6685 use option<identifier> for all wallet commands 2026-04-27 19:57:25 -03:00
Sergio Chouhy
eb3d3d8a8d simplify insert account logic 2026-04-27 18:48:28 -03:00
Moudy
48f95b1b7a feat: add GroupKeyHolder storage and PrivateGroupPda wallet variant 2026-04-27 02:43:51 +02:00
Sergio Chouhy
52992a124a fix identifier for pda 2026-04-24 17:04:40 -03:00
Sergio Chouhy
7c45b5af3c Merge branch 'main' into schouhy/generalize-npk-to-multiple-accounts 2026-04-24 01:04:55 -03:00
Sergio Chouhy
584bfb2052 clippy 2026-04-24 00:42:54 -03:00
Sergio Chouhy
6f9c3b2af3 fmt 2026-04-24 00:37:36 -03:00
Sergio Chouhy
e19c9ff20a return impl iterator 2026-04-24 00:04:22 -03:00
Sergio Chouhy
a5565e0875 make identifier random by default for wallet cli send commands 2026-04-23 23:31:21 -03:00
Sergio Chouhy
3ec166ff7c bring back new private account command for simplicity 2026-04-21 02:35:50 -03:00
Sergio Chouhy
7ccd6ae331 wip 2026-04-20 11:27:15 -03:00
Sergio Chouhy
6316f59777 fmt 2026-04-19 23:13:51 -03:00
Sergio Chouhy
a42144cb3c minor refactor. update ffi 2026-04-17 19:45:30 -03:00
Sergio Chouhy
b34e301023 rollback and remove identifier arguments in new private account wallet command 2026-04-17 14:26:50 -03:00
Sergio Chouhy
f28ac0f092 return account id on new private account creation 2026-04-17 12:52:07 -03:00
Sergio Chouhy
a4e8b53817 fix wallet storage bug 2026-04-17 00:09:32 -03:00
Sergio Chouhy
3cf7972425 add identifier to ciphertext and use it on sync mechanism 2026-04-16 23:22:40 -03:00
Moudy
d1fd6fe945 fix: clippy issue 2026-04-16 19:07:27 +02:00
Sergio Chouhy
4c050f35dd refactor private key tree to store a vec<(Identifier, AccountId)> 2026-04-16 03:03:13 -03:00
Sergio Chouhy
0ecec7016e refactor key trees 2026-04-15 23:34:49 -03:00
Sergio Chouhy
0fd2682d2e add identifier arguments to cli commands 2026-04-15 19:01:58 -03:00
Sergio Chouhy
4ab8696d85 update facades to receive identifiers 2026-04-15 17:21:16 -03:00
Sergio Chouhy
8fd25bc4bf add identifier to PrivacyPreservingAccount to allow passing different identifiers 2026-04-15 16:51:20 -03:00
Sergio Chouhy
985f610cea wip 2026-04-15 15:42:04 -03:00
Sergio Chouhy
a4af8da13b replace npk for account id in commitment and init nullifier formulas 2026-04-14 23:45:34 -03:00
Sergio Chouhy
dae617c673 wip: add dummy identifier 2026-04-14 18:02:38 -03: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
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
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