700 Commits

Author SHA1 Message Date
Daniil Polyakov
f721a00bdf fix: proper account authorization propagation 2026-05-15 01:34:07 +03:00
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
Daniil Polyakov
5f207a3f02 feat: move initial accounts data into genesis 2026-05-15 01:33:50 +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
Sergio Chouhy
d648505d89 fmt, clippy 2026-05-08 22:15:57 -03:00
Sergio Chouhy
190054c94d use borsh 2026-05-08 22:13:56 -03:00
Sergio Chouhy
e9c0aa0858 handle comments 2026-05-08 21:41:48 -03:00
Moudy
cf699fde7c refactor: rename private_pda_spender to auth_transfer_proxy 2026-05-08 18:18:40 +02:00
Moudy
4ace6e1570 fix: address review feedback 2026-05-07 22:48:32 +02:00
Sergio Chouhy
a1a7924c85 ignore advisories since there's no available upgrade 2026-05-07 15:07:32 -03:00
Sergio Chouhy
8f6a519f0e clippy 2026-05-07 13:45:51 -03:00
Sergio Chouhy
2d7d50646d add tests 2026-05-07 12:27:51 -03:00
Sergio Chouhy
f722d257a3 fmt 2026-05-07 01:41:35 -03:00
Sergio Chouhy
d4334c4694 move privateaccountkind to program module 2026-05-07 01:38:41 -03:00
Sergio Chouhy
755b49654e minor change to test 2026-05-07 01:32:37 -03:00
Sergio Chouhy
61dd8ec9b3 fix test 2026-05-07 00:16:28 -03:00
Moudy
f73cd6738f refactor: delegate to auth-transfer, add shared account test 2026-05-06 14:22:50 +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
1599fc655c add tests 2026-05-05 21:17:15 -03:00
Moudy
9e207450d6 fix: resolve merge conflicts with main 2026-05-05 12:37:54 +02:00
Sergio Chouhy
11949e9fa1 use privateaccountkind in storage and fix circuit 2026-05-04 21:40:30 -03:00
Sergio Chouhy
95afb2065d use privateaccuontkind in privacy circuit 2026-05-04 18:07:56 -03:00
Moudy
51f718d9fb
Merge pull request #462 from logos-blockchain/moudy/feat-strong-type-circuit-input 2026-05-04 20:10:41 +02:00
Sergio Chouhy
dd4670ab2f encrypt privateaccountkind instead of identifier 2026-05-01 01:21:48 -03:00
Sergio Chouhy
64a8ea5807 add privateaccountkind 2026-05-01 00:49:28 -03:00
Sergio Chouhy
fb48c82717 add identifier to private pda formula 2026-05-01 00:06:23 -03:00
Moudy
8a8bac8b69 ci: address fmt-rs, lint, and unit-tests failures from the merge 2026-04-30 22:16:26 +02:00
jonesmarvin8
f37454ed1e
Refactor signatures (#457)
* fix BIP-340 signatures for fixed sized messages

* fmt

* fix unit test

* Removed privacy keycard calls

* Revert "Removed privacy keycard calls"

This reverts commit d70ef505a1f40b87159099761f5fce5a31e3f17b.

* Add domain separators

* CI fixes

* add hash_message tests

* fix deny

* addressed comments
2026-04-30 14:21:47 -04: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
Moudy
198eac1cf1 refactor: address PR #449 review feedback 2026-04-29 10:11:37 +02:00
Moudy
55a4a1d83b ci: fix fmt-rs, deny advisory, and rebake artifacts 2026-04-29 08:54:19 +02:00
Moudy
f7349656c7 refactor: strong-type PrivacyPreservingCircuitInput with per-account enum 2026-04-29 07:37:30 +02:00
Sergio Chouhy
06681ef39d add KAT 2026-04-28 00:09:28 -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
924b30650c change pda reserved identifier 2026-04-27 18:45:19 -03:00
Moudy
5b9cf95c47 feat: add group PDA test program, unit tests, and integration test 2026-04-27 02:44:16 +02:00
Moudy
f3215606fb feat: add GroupKeyHolder with per-PDA derivation, epoch ratchet, and seal/unseal 2026-04-27 02:43:26 +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
Moudy
22aa5ef70b refactor: simplify PDA API docs and rename compute_authorized_pdas
Addresses the following review comments from @Arjentix:

- "I think there are too many internal implementation information
  exposed here. This structure is used by our users, program devs. And
  they should not care about distinction between private or public pda
  or different masks"
  (on ChainedCall.pda_seeds, same feedback repeated on Claim::Pda)
  I rewrote both docstrings to drop internal details (visibility masks,
  per-form derivation names, npk handling). Program devs see only that
  they emit a seed and the `AccountId` is derived from
  `(program_id, seed)` regardless of whether the account is public or
  private.

- "Let's reflect the new nuance in the name"
  (on compute_authorized_pdas returning public-form derivations only)
  I renamed the function to `compute_public_authorized_pdas`. After
  the PR #446 rework the function only returns public-form
  derivations, the private-form authorization lives in the circuit
  guest. Updated the call site in nssa/src/validated_state_diff.rs
  and the two unit tests.
2026-04-22 15:34:15 +02:00
Sergio Chouhy
670527c2f1 Merge branch 'main' into schouhy/generalize-npk-to-multiple-accounts 2026-04-21 18:53:24 -03:00
Moudy
0183eac5cc refactor: unify PDA AccountId construction via AccountId::for_{public,private}_pda
Addresses the following review comment:

- "I think this should be a constructor `AccountId::for_private_pda`.
  Consider also removing the existing `impl From<(ProgramId, Seed)> for
  AccountId` for public pdas in favor of a `AccountId::for_public_pda`
  to have a unified way of constructing pdas"

I replaced `impl From<(&ProgramId, &PdaSeed)> for AccountId` with
`AccountId::for_public_pda(program_id: &ProgramId, seed: &PdaSeed) ->
Self` and replaced the free function `private_pda_account_id(...)`
with `AccountId::for_private_pda(program_id: &ProgramId, seed:
&PdaSeed, npk: &NullifierPublicKey) -> Self`. Both live in an inherent
`impl AccountId` block in nssa/core/src/program.rs next to the PDA
derivation logic. Migrated all call sites across nssa/core,
nssa/src/state.rs, nssa/src/validated_state_diff.rs,
program_methods/guest/src/bin/privacy_preserving_circuit.rs,
programs/amm/core, programs/associated_token_account/core, the example
tail-call binary, and the ATA tutorial doc. Test function names that
referenced the old free function were also renamed
(private_pda_account_id_* to for_private_pda_*).
2026-04-21 12:35:19 +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