Skip to content

Comments

feat: use nym hash as probe_id for use on clients#22

Open
DecFox wants to merge 15 commits intomainfrom
mu/nym-digest
Open

feat: use nym hash as probe_id for use on clients#22
DecFox wants to merge 15 commits intomainfrom
mu/nym-digest

Conversation

@DecFox
Copy link
Contributor

@DecFox DecFox commented Feb 19, 2026

This diff allows us to expose the nym hash as the probe_id to be used for stamping ooni measurements. We also cleanup the redundant code we had for exposing stateless functions for client integration.

@DecFox DecFox requested a review from mmaker February 20, 2026 05:12
Copy link
Collaborator

@mmaker mmaker left a comment

Choose a reason for hiding this comment

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

can we rely on the object-oriented function approach?

@DecFox
Copy link
Contributor Author

DecFox commented Feb 20, 2026

can we rely on the object-oriented function approach?

Thanks! I reverted the changes to using object-oriented approach for the UserState as well.

I also added this setter function: https://github.com/ooni/userauth/pull/22/changes#diff-c0b83d506440f65511f38f3ff8e8aeb659d2c7b04e400762950d2eac92f1146aR84, to set the stored credential from the clients before we make the rust function calls. Do you think this is good or a better way is to store the entire UserState as is, with the public params in the clients (for now, we only store the base64-encoded credential)?

@DecFox DecFox requested a review from mmaker February 20, 2026 19:27
@DecFox
Copy link
Contributor Author

DecFox commented Feb 20, 2026

Another question would be, with the digest_point function now here, can we also make it public? This should allow us to extract the probe_id on the clients through the saved credential on the device given a probe_asn and a probe_cc. The probe can then decide to attach it inside the measurement (example implementation in the client attached below):

pub fn get_probe_id(
    credential_b64: String,
    probe_asn: String,
    probe_cc: String
) -> Result<ProbeIDResult, OoniError> {
    let credential = decode_credential(&credential_b64)?;
    let domain_str = format!("ooni.org/{}/{}", probe_cc, probe_asn);
    let DOMAIN = G::hash_from_bytes::<Sha512>(domain_str.as_bytes());
    let NYM = credential.nym_id.unwrap() * DOMAIN;

    let probe_id = ooniauth_core::digest_point(NYM)

    OK(ProbeIDResult {
        probe_id: probe_id
    })
}

Or maybe extract away the entire nym processing and hashing to a dedicated function here and use it off the plate in the client?

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