Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fast Recovery #15

Open
bhgomes opened this issue Feb 6, 2022 · 0 comments
Open

Fast Recovery #15

bhgomes opened this issue Feb 6, 2022 · 0 comments
Labels
A-cryptography Area: Issues and PRs related to Cryptography A-performance Area: Performance-related Issues and PRs C-enhancement Category: An issue proposing an enhancement or a PR with one C-experiment Category: Experimental feature or tool P-medium Priority: Medium

Comments

@bhgomes
Copy link
Contributor

bhgomes commented Feb 6, 2022

After reviewing the design offline, we can use something like the following schema:

struct Note {
    ephemeral_public_key: PublicKey,
    ciphertext: Ciphertext,
    tag: u8,
}

fn create_note(ephemeral_secret_key: SecretKey, public_view_key: &PublicKey, asset: Asset) -> Note {
    let ephemeral_public_key = derive(&ephemeral_secret_key);
    Note {
        ciphertext: encrypt(agree(&ephemeral_secret_key, public_view_key), asset),
        tag: HASH(public_view_key, &ephemeral_public_key),
        ephemeral_public_key,
    }
}

fn try_decrypt(note: &Note, secret_view_key: &SecretKey, public_view_key: &PublicKey) -> Option<Asset> {
    if note.tag == HASH(public_view_key, &note.ephemeral_public_key) {
        decrypt(agree(secret_view_key, &note.ephemeral_public_key), &note.ciphertext)
    } else {
        None
    }
}

where HASH : PublicKey -> PublicKey -> u8 is some hash function that is faster than decryption.

Originally posted by @bhgomes in Manta-Network/spec#4 (comment)

@bhgomes bhgomes added this to the v1.1.0 milestone Jun 9, 2022
@bhgomes bhgomes added C-enhancement Category: An issue proposing an enhancement or a PR with one A-performance Area: Performance-related Issues and PRs and removed enhancement labels Jul 6, 2022
@bhgomes bhgomes added C-experiment Category: Experimental feature or tool A-cryptography Area: Issues and PRs related to Cryptography P-medium Priority: Medium and removed C-experiment Category: Experimental feature or tool labels Jul 6, 2022
@bhgomes bhgomes removed this from the v1.1.0 milestone Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cryptography Area: Issues and PRs related to Cryptography A-performance Area: Performance-related Issues and PRs C-enhancement Category: An issue proposing an enhancement or a PR with one C-experiment Category: Experimental feature or tool P-medium Priority: Medium
Projects
None yet
Development

No branches or pull requests

2 participants