2446 Commits

Author SHA1 Message Date
Moudy
51f718d9fb
Merge pull request #462 from logos-blockchain/moudy/feat-strong-type-circuit-input 2026-05-04 20:10:41 +02: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
Daniil Polyakov
970696b217
Merge pull request #463 from logos-blockchain/arjentix/indexer-mock-improvements
chore: add new blocks every 30 seconds to mock indexer service
2026-04-30 19:02:42 +03: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
Sergio Chouhy
9894319389
Merge pull request #447 from logos-blockchain/schouhy/generalize-npk-to-multiple-accounts
Generalize Npk to multiple accounts
2026-04-29 21:40:22 -03:00
Daniil Polyakov
f3ab618268 chore: satisfy cargo deny 2026-04-29 23:58:24 +03:00
Daniil Polyakov
b0a48883e1 chore: add new blocks every 30 seconds to mock indexer service
Co-authored-by: Copilot <copilot@github.com>
2026-04-29 23:58:24 +03:00
Sergio Chouhy
8025780e26 fix deny 2026-04-29 16:46:07 -03:00
Sergio Chouhy
18642f9b6c artifacts 2026-04-29 13:31:22 -03:00
Sergio Chouhy
72756e8622 Merge branch 'main' into schouhy/generalize-npk-to-multiple-accounts 2026-04-29 12:28:05 -03: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
ad2b4b66e4 expand docs 2026-04-28 00:28:39 -03:00
Sergio Chouhy
a23e44a8df fmt and clippy 2026-04-28 00:18:57 -03:00
Sergio Chouhy
6738d8ef28 update docs 2026-04-28 00:14:55 -03: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
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
Sergio Chouhy
924b30650c change pda reserved identifier 2026-04-27 18:45:19 -03:00
Daniil Polyakov
cf3639d825
Merge pull request #458 from logos-blockchain/arjentix/fix-clock-tx-in-indexer
Fix clock transaction validation in Indexer
v0.2.0-rc3
2026-04-27 18:48:00 +03:00
Pravdyvy
478ba4c2f2
Merge pull request #427 from logos-blockchain/Pravdyvy/indexer-ffi-spawns-rpc-for-communication
Simple indexer FFI
2026-04-27 17:18:03 +03:00
Pravdyvy
be8f5a6db2 fix: comments 2 2026-04-27 15:44:46 +03:00
Daniil Polyakov
88102d6964 fix: skip check on state for clock transaction in indexer storage 2026-04-27 15:34:21 +03:00
Pravdyvy
02949e961a
Merge branch 'main' into Pravdyvy/indexer-ffi-spawns-rpc-for-communication 2026-04-27 13:58:10 +03:00
Sergio Chouhy
85a6763490 artifacts 2026-04-24 19:31:13 -03:00
Sergio Chouhy
e09cb6284e enforce reserved identifier for private pda 2026-04-24 18:00:54 -03: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
9c90a6d182 remove unused impl 2026-04-24 00:36:25 -03:00
Sergio Chouhy
e19c9ff20a return impl iterator 2026-04-24 00:04:22 -03:00
Sergio Chouhy
4719b1265a replace typedef with struct 2026-04-23 23:44:31 -03:00
Sergio Chouhy
a5565e0875 make identifier random by default for wallet cli send commands 2026-04-23 23:31:21 -03:00
Moudy
00d3140490
Merge pull request #446 from logos-blockchain/moudy/feat-private-pdas
feat: private PDA support in the privacy circuit
2026-04-22 23:07:18 +02:00
Moudy
86ff3670c0 fix: bump rustls-webpki to 0.103.13 for RUSTSEC-2026-0104
Upstream advisory, reachable panic in certificate revocation list
parsing via `BorrowedCertRevocationList::from_der` /
`OwnedCertRevocationList::from_der`. Unrelated to this PR, dropped
into the advisory DB since the last green CI run and broke the `deny`
job. Fix is the recommended version bump.
2026-04-22 16:02:56 +02:00
Moudy
e5b77a27d5 refactor: localize private_pda_npk_by_position and extract authorization helper
Addresses the following review comments from @Arjentix:

- "I think we can move this into `derive_from_outputs()`"
  (on the position → npk map construction in main())
  I moved the construction inside ExecutionState::derive_from_outputs
  and stored the map as a field of ExecutionState. derive_from_outputs
  now takes `private_account_keys` directly and builds the map as part
  of state initialization. main() no longer owns the intermediate
  structure. validate_and_sync_states reads the npk through
  self.private_pda_npk_by_position.

- "Let's move this whole `is_authorized` computation into a separate
  function. This became really bulky"
  I extracted the caller-seeds resolution, family-binding recording,
  and is_authorized computation into a free function
  `resolve_authorization_and_record_bindings`. It takes the three
  field borrows it needs (`&mut pda_family_binding`, `&mut
  private_pda_bound_positions`, `&private_pda_npk_by_position`), same
  shape as `assert_family_binding`. A method would have conflicted
  with the `&mut self.post_states` borrow held by the Occupied match
  arm; the free function lets rustc split-borrow the self fields.
2026-04-22 15:55:35 +02: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
Pravdyvy
ad6a55c55d fix: lint fix 1 2026-04-22 07:42:02 +03:00
Sergio Chouhy
9d2abc76a1 fix tests 2026-04-21 22:39:14 -03:00
Sergio Chouhy
145198a078 fix test 2026-04-21 21:32:47 -03:00
Sergio Chouhy
b4d883e275 fix test 2026-04-21 19:34:08 -03:00
Sergio Chouhy
670527c2f1 Merge branch 'main' into schouhy/generalize-npk-to-multiple-accounts 2026-04-21 18:53:24 -03:00
Pravdyvy
33557b122f fix: comments fix 1 2026-04-21 17:46:16 +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