Skip to content

feat(discovery-core): add secretfelt type and unify key param naming - #458

Merged
m-kus merged 1 commit into
mainfrom
pr-split/04-secretfelt-migration
Feb 11, 2026
Merged

m-kus merged 1 commit into
mainfrom
pr-split/04-secretfelt-migration

Conversation

@m-kus

@m-kus m-kus commented Feb 9, 2026 •

Copy link
Copy Markdown

TL;DR

Implemented secure key handling with SecretFelt to protect private keys from memory exposure.

What changed?

  • Added a new SecretFelt wrapper type that automatically zeroes memory when dropped
  • Updated all functions that handle private keys to use SecretFelt instead of raw Felt
  • Added implementation of decrypt_outgoing_recipient_addr function
  • Added zeroize dependency for secure memory handling
  • Moved serde from dev-dependencies to regular dependencies

This change is Reviewable

m-kus commented Feb 9, 2026 •

Copy link
Copy Markdown
Author

@m-kus
m-kus requested a review from Yoni-Starkware February 9, 2026 19:30
@m-kus
m-kus force-pushed the pr-split/03-iviews-extensions branch from 2a6b820 to 52e1fa9 Compare February 11, 2026 13:05
@m-kus
m-kus force-pushed the pr-split/04-secretfelt-migration branch from 848fff3 to 3ae8597 Compare February 11, 2026 13:05
@m-kus
m-kus changed the base branch from pr-split/03-iviews-extensions to graphite-base/458 February 11, 2026 15:03
@m-kus
m-kus force-pushed the graphite-base/458 branch from 52e1fa9 to 64df6c3 Compare February 11, 2026 15:07
@m-kus
m-kus force-pushed the pr-split/04-secretfelt-migration branch from 3ae8597 to 210b963 Compare February 11, 2026 15:07
@m-kus
m-kus changed the base branch from graphite-base/458 to pr-split/03-iviews-extensions February 11, 2026 15:07
@m-kus
m-kus force-pushed the pr-split/04-secretfelt-migration branch from 210b963 to d666926 Compare February 11, 2026 16:08
@m-kus
m-kus force-pushed the pr-split/03-iviews-extensions branch from 64df6c3 to 4ddeb8f Compare February 11, 2026 16:08

@Yoni-Starkware Yoni-Starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@Yoni-Starkware reviewed 8 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @m-kus).


crates/discovery-core/src/privacy_pool/hashes.rs line 129 at r1 (raw file):

    token: Felt,
    index: u64,
    private_key: &super::types::SecretFelt,

Move the use to the top of the file; avoid using super in non-test context

Suggestion:

 private_key: &SecretFelt,

crates/discovery-core/src/test_fixtures.rs line 144 at r1 (raw file):

    };
    use crate::io_budget::IoBudget;
    use crate::privacy_pool::types::SecretFelt;

Please move up

Code quote:

    use crate::io_budget::IoBudget;
    use crate::privacy_pool::types::SecretFelt;

@m-kus
m-kus changed the base branch from pr-split/03-iviews-extensions to graphite-base/458 February 11, 2026 18:55
@m-kus
m-kus force-pushed the pr-split/04-secretfelt-migration branch from d666926 to 85233d3 Compare February 11, 2026 19:05
@m-kus
m-kus force-pushed the graphite-base/458 branch from 4ddeb8f to 6c1f8aa Compare February 11, 2026 19:05
@m-kus
m-kus changed the base branch from graphite-base/458 to main February 11, 2026 19:05

@m-kus m-kus left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-kus resolved 2 discussions.
Reviewable status: 6 of 9 files reviewed, all discussions resolved (waiting on @Yoni-Starkware).

@m-kus
m-kus force-pushed the pr-split/04-secretfelt-migration branch from 85233d3 to 47ec97f Compare February 11, 2026 19:06
@m-kus
m-kus merged commit 0f0ab25 into main Feb 11, 2026
5 of 6 checks passed
@m-kus
m-kus deleted the pr-split/04-secretfelt-migration branch February 11, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants