Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ global NON_INTERACTIVE_HANDSHAKE: u8 = 1;
/// [`HandshakeRegistry::validate_handshake`] to check an app-siloed secret against the current stored handshake. The
/// private surfaces silo against `msg_sender()`, so a contract can only obtain or validate secrets siloed to itself.
///
/// Currently only implements the non-interactive flow (see [`HandshakeRegistry::non_interactive_handshake`]).
/// # Privacy
/// The siloing described above means reading handshakes never compromises message secrecy: a reader only ever
/// derives secrets siloed to its own address. Handshake metadata is weaker, though; see
/// [`HandshakeRegistry::non_interactive_handshake`] for privacy details.
///
/// Only non-interactive handshakes are currently implemented.
#[aztec(::aztec::macros::AztecConfig::new().custom_sync_state(crate::handshake_registry_sync))]
pub contract HandshakeRegistry {
use crate::{handshake_note::HandshakeNote, NON_INTERACTIVE_HANDSHAKE, sync::get_all_handshakes};
Expand Down Expand Up @@ -62,6 +67,15 @@ pub contract HandshakeRegistry {
/// 3. Returns the app-siloed shared secret for `msg_sender()`, allowing the caller to fold "handshake + first
/// tag" into one call without a second hop into the registry.
///
/// # Privacy
/// Non-interactive handshakes are announced via a bootstrap log under a tag derived from the recipient address.
/// Their existence, count, and timing are observable by anyone who knows that address. See
/// [`HandshakeRegistry::get_handshakes`] for the discovery read's privacy notes. The raw shared-secret point
/// remains protected: callers only receive secrets siloed to their own address.
///
/// Interactive handshakes can avoid this recipient-keyed bootstrap leakage, but require recipient
/// cooperation before the sender can create the shared secret.
///
/// # Panics
/// If `mode` is not a recognized delivery mode.
///
Expand Down Expand Up @@ -159,6 +173,11 @@ pub contract HandshakeRegistry {
/// Returns a page of discovered handshakes addressed to `recipient`.
///
/// `total_count` is the full list length, so callers can determine whether more pages remain.
///
/// # Privacy
/// Returns the decrypted discovery payload (`eph_pk`, `mode`) to any caller that knows `recipient` and has it in
/// scope. `mode` narrows the category of apps the recipient uses; `eph_pk` does not weaken secrecy. See the
/// contract's privacy notes above for the full model.
#[external("utility")]
unconstrained fn get_handshakes(recipient: AztecAddress, page_offset: u32) -> HandshakePage {
let handshakes = get_all_handshakes(self.context.this_address(), recipient);
Expand Down
Loading