238 Commits

Author SHA1 Message Date
Daniil Polyakov
5f207a3f02 feat: move initial accounts data into genesis 2026-05-15 01:33:50 +03:00
Sergio Chouhy
bc65c877af fix private shared account preparation 2026-05-13 00:03:01 -03:00
Sergio Chouhy
f3389571f8 use identifier in private gms command 2026-05-12 13:29:06 -03:00
Sergio Chouhy
ee0fecee25 add privatepdashared variant 2026-05-11 20:30:23 -03:00
Sergio Chouhy
927c24de68 Merge branch 'main' into schouhy/diversify-private-pdas-by-identifier 2026-05-11 18:57:44 -03:00
Sergio Chouhy
e9c0aa0858 handle comments 2026-05-08 21:41:48 -03:00
Moudy
2b2275ee74 fix: resolve shared accounts in auth-transfer commands 2026-05-08 11:03:13 +02:00
Moudy
4e7963c655 feat: add dedicated sealing key for GMS distribution 2026-05-08 08:19:55 +02:00
Moudy
4ace6e1570 fix: address review feedback 2026-05-07 22:48:32 +02:00
Moudy
69b81ea621 fix: address review feedback, persist group data in wallet storage 2026-05-07 17:35:51 +02:00
Sergio Chouhy
f722d257a3 fmt 2026-05-07 01:41:35 -03:00
Moudy
d0a88e91e1 feat: extend sync to scan shared accounts with GMS-derived keys 2026-05-06 14:22:49 +02:00
Moudy
cd545819e7 feat(wallet)!: add group CLI commands with --for-gms account creation
BREAKING CHANGE: `NewSubcommand::Private` has new required fields (`for_gms`, `pda`, `seed`, `program_id`). Code constructing this variant must include them (use `None`/`false` for defaults). `shared_accounts` value type changed from `Account` to `SharedAccountEntry`.
2026-05-06 14:22:40 +02:00
Sergio Chouhy
fb4ddb055a Merge branch 'main' into schouhy/diversify-private-pdas-by-identifier 2026-05-06 00:22:58 -03:00
Sergio Chouhy
11949e9fa1 use privateaccountkind in storage and fix circuit 2026-05-04 21:40:30 -03:00
Sergio Chouhy
7d5e1492c4 update insert_private_account_data to take account kind instead of identifier 2026-05-04 20:12:54 -03:00
Sergio Chouhy
71ad4e0c85 fix account id computation in wallet to account for pdas 2026-05-04 18:11:38 -03:00
Sergio Chouhy
dd4670ab2f encrypt privateaccountkind instead of identifier 2026-05-01 01:21:48 -03:00
Moudy
8517906025 Merge branch 'main' into moudy/feat-strong-type-circuit-input 2026-04-30 20:17:47 +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
f7349656c7 refactor: strong-type PrivacyPreservingCircuitInput with per-account enum 2026-04-29 07:37:30 +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
e19c9ff20a return impl iterator 2026-04-24 00:04:22 -03:00
Sergio Chouhy
3ec166ff7c bring back new private account command for simplicity 2026-04-21 02:35:50 -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
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
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
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
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