115 Commits

Author SHA1 Message Date
Daniil Polyakov
ee5a98fc48 refactor: use faucet program to manage faucet account 2026-05-15 01:34:07 +03:00
Daniil Polyakov
9075f30f19 refactor: use system faucet and vaults to supply accounts from genesis
Co-authored-by: Copilot <copilot@github.com>
2026-05-15 01:34:01 +03:00
Sergio Chouhy
355fe3842d rename program 2026-05-11 19:38:28 -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
a9baf5d3dc rename progam 2026-05-11 17:09:46 -03:00
Moudy
cf699fde7c refactor: rename private_pda_spender to auth_transfer_proxy 2026-05-08 18:18:40 +02:00
Sergio Chouhy
f722d257a3 fmt 2026-05-07 01:41:35 -03:00
Sergio Chouhy
fb4ddb055a Merge branch 'main' into schouhy/diversify-private-pdas-by-identifier 2026-05-06 00:22:58 -03:00
Sergio Chouhy
1599fc655c add tests 2026-05-05 21:17:15 -03: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
Moudy
5b9cf95c47 feat: add group PDA test program, unit tests, and integration test 2026-04-27 02:44:16 +02:00
Moudy
68d43d7f2b test: exercise callee authorization in private-PDA delegation tests
Addresses the following review comments:

- "Shouldn't we use a program that checks authorization in this test as
  callee? If not, I'm not sure if we are fully testing what the test
  docs describe (namely, that the callee got the input account with
  is_authorized=true). Maybe add a variant of the noop that checks the
  input account is authorized."
  I added test_program_methods/guest/src/bin/auth_asserting_noop.rs:
  same shape as noop.rs except it asserts pre.is_authorized == true for
  every pre_state before echoing the post_states. Any unauthorized
  pre_state panics the guest, failing the whole circuit proof. I added
  Program::auth_asserting_noop() as the matching helper. In
  caller_pda_seeds_authorize_private_pda_for_callee and
  caller_pda_seeds_with_wrong_seed_rejects_private_pda_for_callee, I
  swapped Program::noop() for Program::auth_asserting_noop() as the
  callee. The positive test now proves the callee actually sees
  is_authorized=true, not just that the circuit's consistency check did
  not reject. The negative test doubles its evidence, both the
  circuit's authorization reconciliation and the callee guest would now
  reject a wrong-seed delegation.

- "This branching logic is only correct because we are not supporting
  non-authorized private accounts with non-default values. Likely to be
  changed in the future. I'm sure there's use cases for this. For
  example the multisig program if ran completely private it would need
  a private non-default and non-authorized input account."
  Agreed. Supporting this needs wallet-supplied `(seed, owner)` side
  input so the npk-to-account_id binding can be re-verified for an
  existing private PDA without a fresh Claim::Pda or a caller
  pda_seeds match. I handled this in the second PR. I added a
  TODO(private-pdas-pr-2/3) marker on the `else` branch in
  privacy_preserving_circuit.rs:3 => { ... } so the constraint is
  visible to future maintainers, along with a comment noting the
  multisig use case.
2026-04-21 02:08:02 +02:00
Moudy
d3577f02bc fix: reject multiple family members under same (program, seed) in one tx 2026-04-17 15:36:20 +02:00
Moudy
f9a5a7635e refactor: make programs privacy-agnostic in the privacy circuit 2026-04-17 07:29:40 +02:00
Moudy
526c3cd978 test: add private PDA circuit tests and two guest programs 2026-04-16 18:07:32 +02:00
Sergio Chouhy
99bedb970d Merge branch 'main' into schouhy/fix-slow-tests-because-of-program-id-computation 2026-04-07 17:39:01 -03:00
Sergio Chouhy
ccd8869205 add program id test 2026-04-07 17:33:35 -03:00
Moudy
b22a989fbc merge main into feat-caller-program-id-and-flash-swap 2026-04-07 19:27:27 +02:00
Moudy
7d465dded7 fix: verify caller_program_id in program output 2026-04-07 19:03:06 +02:00
Sergio Chouhy
3c014c721e avoid computing program ids to speed up tests 2026-04-06 15:03:00 -03:00
moudyellaz
1d0c93e9cf test: verify malicious self_program_id is rejected in public execution 2026-04-03 22:13:58 +02:00
Moudy
02e336b240 fix: add missing caller_program_id argument in test 2026-04-03 11:47:34 +02:00
Moudy
74e16db68f fix: apply formatting and rebuild artifacts 2026-04-03 01:17:42 +02:00
moudyellaz
599724b72f feat: register flash_swap programs as test programs 2026-04-03 00:58:11 +02:00
moudyellaz
087baebcca feat: add caller_program_id to ProgramInput 2026-04-03 00:58:11 +02:00
Moudy
59d3d38448 fix: serialize write_inputs fields separately to match guest deserialization 2026-04-02 20:29:12 +02:00
moudyellaz
d5cb3e0454 feat: inject self_program_id in write_inputs and execute 2026-04-02 20:29:10 +02:00
Sergio Chouhy
acf609ecc8 Merge branch 'main' into schouhy/add-block-context 2026-03-26 13:24:46 -03: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
Sergio Chouhy
79d70b3a66 add test for empty intersection in circuit 2026-03-25 17:33:27 -03:00
Sergio Chouhy
7bbd2dd5d7 add public validity window checks 2026-03-19 15:03:45 -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
Sergio Chouhy
fe4a89191c add state to rocksdb 2026-01-27 01:20:17 -03:00
Daniil Polyakov
2b2a52d0b8 feat: error on unclaimed modified accounts 2026-01-19 17:29:59 +03:00
Daniil Polyakov
67d5a3e9f4 fix: check public account authorization in privacy preserving circuit 2026-01-17 02:28:31 +03:00
jonesmarvin8
e73e4b0558
Merge pull request #250 from logos-blockchain/main
merge main into simple amm
2025-12-19 08:36:08 -05:00
jonesmarvin8
a5496eb5d5 various comments addressed 2025-12-18 18:45:57 -05:00
Daniil Polyakov
f729072fae feat: allow private authorized uninitialized accounts 2025-12-18 21:48:37 +03:00
jonesmarvin8
d78d97c815 Reapply "Merge branch 'main' into simple_amm"
This reverts commit 2419d4a1126afa9882b3fefbe518582ae130a817.
2025-12-15 18:13:31 -05:00
jonesmarvin8
2419d4a112 Revert "Merge branch 'main' into simple_amm"
This reverts commit 8dd1c2d84677aa5efe00ca820ec634a19b73de07, reversing
changes made to 2e37e20014fc8ddaa4559cbdf2c13ec8eb356f24.
2025-12-15 17:53:20 -05:00
jonesmarvin8
8dd1c2d846 Merge branch 'main' into simple_amm 2025-12-15 17:41:45 -05:00
Sergio Chouhy
5276cc8f07 Merge branch 'schouhy/move-modified-transfer-to-test-methods' into schouhy/implement-privacy-preserving-tail-calls 2025-12-10 14:51:46 -03:00
Sergio Chouhy
e9c9058827 move modified transfer program to test programs 2025-12-10 14:07:06 -03:00
Sergio Chouhy
f54cdf4a4c Merge branch 'main' into schouhy/implement-privacy-preserving-tail-calls 2025-12-09 23:53:27 -03:00
jonesmarvin8
8506f5948f Merge branch 'main' into simple_amm 2025-12-06 20:07:12 -05:00
jonesmarvin8
1ae10f553b test: add test for malicious program performing balance overflow attack 2025-12-06 21:28:45 +03:00
Sergio Chouhy
7e971a6c4d Merge branch 'main' into schouhy/implement-pda-for-public-accounts 2025-12-05 10:00:23 -03:00