140 Commits

Author SHA1 Message Date
Marvin Jones
3a7b957a6a feat(encryption): derive esk from account state, remove chacha20poly1305 logic
Introduce EphemeralSecretKey as a proper struct with EphemeralSecretKey::new()
that derives esk from SHA256("/LEE/v0.3/esk/" || account_id || os_random || nonce).
Rename witness field from esk to os_random. Simplify encapsulate_deterministic
to accept pre-derived EphemeralSecretKey directly.
2026-06-25 17:58:57 -04:00
agureev
74672266be chore: update artifacts 2026-06-24 21:57:45 +04:00
agureev
a12545b332 chore: update artifacts 2026-06-23 18:31:09 +04:00
agureev
4239b44338 chore: update artifacts 2026-06-23 15:51:58 +04:00
Daniil Polyakov
e5ca40c0f9 feat: add bedrock withdraw events validation 2026-06-16 22:10:11 +03:00
agureev
2eac764421 chore: update ELFs 2026-06-11 16:41:02 +04:00
agureev
b95f071d60 chose: bump artifacts
All artifacts changed either through direct change in the privacy
circuit or through the lee dependency change.
2026-06-10 22:16:51 +04:00
Daniil Polyakov
7f5590907f feat(sequencer): make bridge deposits fault-tolerant 2026-06-04 15:17:56 +03:00
jonesmarvin8
2104f71e39
feat(key-protocol/nssa)!: PQ resistance primitives for vsk/vpk for shared key agreement (#474)
* initialize pq encryption changes

* key agreement update

* add test and other fixes

* ci fixes

* fix unit tests

* updates from main and ci

* added updated specs for pq encryption

* addressing comments

* addressed comments

* fix clippy errors from main merge

* Rebased to main
2026-06-03 14:40:06 -04:00
Sergio Chouhy
4bcffafe27 refactor!: rename nssa crate to lee
BREAKING CHANGE:
- Crate `nssa` renamed to `lee`; update `Cargo.toml` dependencies from `nssa = { workspace = true }` to `lee = { workspace = true }`.
- Crate `nssa_core` renamed to `lee_core`; update similarly.
- Crate `key_protocol` moved under `lee`; update `Cargo.toml` dependencies from `key_protocol = { workspace = true }` to `lee_key_protocol = { workspace = true }`.
- Type `NSSATransaction` (in `common`) renamed to `LeeTransaction`.
- Error type `nssa::error::NssaError` renamed to `lee::error::LeeError`.
- Error type `nssa_core::error::NssaCoreError` renamed to `lee_core::error::LeeCoreError`.
- All `use nssa::` and `use nssa_core::` import paths must be updated to `use lee::` and `use lee_core::` respectively.
- Guest programs must replace `write_nssa_outputs` with `write_lee_outputs`.
- The sequencer RocksDB column family for the chain state was renamed. Existing databases are incompatible and must be wiped before running the new version.
- Domain separators updated: `"NSSA_seed"` → `"LEE_seed"` (key derivation), `"NSSA/v0.2/KDF-SHA256/"` → `"LEE/v0.2/KDF-SHA256/"` (encryption KDF), `"/NSSA/v0.2/AccountId/PDA/"` →
  `"/LEE/v0.2/AccountId/PDA/"` (public PDA address derivation). All previously derived keys, encrypted outputs, and public PDA addresses are invalidated.
2026-06-01 17:11:42 -03:00
Daniil Polyakov
d86e02139f chore(faucet): add genesis prefix to instruction names 2026-05-29 20:05:38 +03:00
Daniil Polyakov
9b8955daf5 feat(sequencer, programs): implement deposit operation for bridge 2026-05-29 20:01:24 +03:00
Sergio Chouhy
48da4b5119 fix!: protocol fixes
BREAKING CHANGE
  - Nonce init (PrivateAuthorizedInit): the initial nonce for PrivateAuthorizedInit accounts was incorrectly computed. Privacy preserving circuit code changed, as well as its id.
  - Authorization bidirectional check: programs must now set is_authorized = true for every authorized account in pre-states, not just avoid marking unauthorized ones as authorized.
  - Authorization in chained calls: authorized-account set is now the union across the call chain instead of being reset at each hop.
2026-05-29 02:08:14 -03:00
Sergio Chouhy
71be6bae32 Merge branch 'main' into schouhy/private-pdas-as-external-input 2026-05-25 16:32:11 -03:00
Daniil Polyakov
fa47d471af fix: disable default features for risc0-zkvm for workspace and enable client feature for nssa 2026-05-22 18:23:47 +03:00
Pravdyvy
5f14ac1cfe revert(490): CI test 2026-05-22 07:28:49 +03:00
Sergio Chouhy
3c6d623c49 feat!: Add new path for externally provided seed to the circuit.
BREAKING CHANGE: add identity variants to the circuit and change semantics for `Claim::Authorized` for private PDAs
2026-05-21 11:22:31 -03:00
ygd58
94096bcdc6
fix(workspace): disable risc0-zkvm default features to avoid ring in guest builds
- Cargo.toml: add default-features = false to risc0-zkvm
- nssa/Cargo.toml: add explicit prove feature for ExecutorEnv/default_prover
- Regenerate artifacts

Fixes #468
2026-05-20 17:23:51 +02:00
Sergio Chouhy
57173cc140 make authorization propagate transitively through chain calls in the circuit like in the public execution 2026-05-15 17:24:24 -03:00
Daniil Polyakov
8c8f5b57af fixup! refactor: use faucet program to manage faucet account 2026-05-15 01:46:39 +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
moudyellaz
ba84ba60ce fix(privacy_preserving_circuit): refresh artifact 2026-05-14 23:45:52 +02:00
moudyellaz
3c8ff78319 merge: resolve conflicts with main 2026-05-14 18:40:49 +02:00
Sergio Chouhy
b3acd46f11 artifacts 2026-05-11 20:00:20 -03:00
Sergio Chouhy
54c039f639 artifacts 2026-05-08 22:31:38 -03:00
moudyellaz
06fd4fc12e fix: artifacts and deny
Refs: #454
2026-05-08 17:32:28 +02:00
moudyellaz
01eb4a58b8 fix(privacy_preserving_circuit): satisfy CI lints and refresh artifact for #454
Refs: #454
2026-05-07 21:23:35 +02:00
Sergio Chouhy
75ab606dcf artifacts 2026-05-07 15:28:00 -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
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
95afb2065d use privateaccuontkind in privacy circuit 2026-05-04 18:07:56 -03:00
Sergio Chouhy
dd4670ab2f encrypt privateaccountkind instead of identifier 2026-05-01 01:21:48 -03:00
Sergio Chouhy
8d9fa1224e remove fixed identifier for pdas 2026-05-01 00:26:38 -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
Moudy
8517906025 Merge branch 'main' into moudy/feat-strong-type-circuit-input 2026-04-30 20:17:47 +02:00
Moudy
b9ceda98cf fix: rebuild artifacts 2026-04-30 16:04:48 +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
Sergio Chouhy
18642f9b6c artifacts 2026-04-29 13:31:22 -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
924b30650c change pda reserved identifier 2026-04-27 18:45:19 -03:00
Sergio Chouhy
85a6763490 artifacts 2026-04-24 19:31:13 -03:00
Sergio Chouhy
52992a124a fix identifier for pda 2026-04-24 17:04:40 -03: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