Skip to content

refactor(lee): refactor private kinds - #660

Open
agureev wants to merge 1 commit into
artem/bundle-actionsfrom
artem/private-kinds-refactor
Open

refactor(lee): refactor private kinds#660
agureev wants to merge 1 commit into
artem/bundle-actionsfrom
artem/private-kinds-refactor

Conversation

@agureev

@agureev agureev commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

🎯 Purpose

This refactor is the first step in the environment unification task with the "north star" being #650.

Its goal is twofold:

  1. reduce amount of production code by getting rid of combinatorial enum structure in favor of a united PrivateWitness struct carrying information about init/updates and common info such as nullifier and key information all account carry regardless of kind.

  2. ensure an interface which is easier to update if we introduce more keys (either shared or specific to the account kind) such as the authorization key for the regular private accounts. this way there is a centralized struct to update instead of disjoint enums.

Hence this will make authorization key addition more seemless.

As authorization information is currently determined protocol-wide (e.g. enforcing authorization for all regular private accounts) removing separate authorization-varying enum information does not impact the logic.

⚙️ Approach

The approach is to replace the combinatorial private InputAccountIdentity enum by a Private(WitnessKind) enum variant with WitnessKind struct specifying whether an account is init or updated.

  • Define NullifierWitness struct carrying information about init/update of the account plaintext
  • Define PrivateWitness struct carrying common private account information such as identifier and npk/vpk
  • Replace InputAccountIdentity private enums with one Private(PrivateWitness) enum.

🧪 How to Test

RISC0_DEV_MODE=1 cargo nextest run --workspace --exclude integration_tests --all-features --no-fail-fast

🔗 Dependencies

#604

🔜 Future Work

Further environment unification tasks guiding towards #650.

📋 PR Completion Checklist

  • Complete PR description
  • Implement the core functionality
  • Add/update tests
  • Add/update documentation and inline comments

@agureev agureev added the priority:medium Normal priority label Jul 31, 2026
@agureev agureev self-assigned this Jul 31, 2026
@agureev
agureev marked this pull request as ready for review July 31, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Normal priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants