Skip to content

Proof of Concept for Zama Functionality#63

Merged
vishakh merged 27 commits into
mainfrom
feature/zama-poc
Sep 12, 2024
Merged

Proof of Concept for Zama Functionality#63
vishakh merged 27 commits into
mainfrom
feature/zama-poc

Conversation

@vishakh

@vishakh vishakh commented Jul 11, 2024

Copy link
Copy Markdown
Contributor

This draft PR builds a PoC for evaluating the suitability of Zama for Monadic DNA.

Done so far:
🧬 Load a 23andMe dataset
🔢 Integer-encode the SNPs and genotypes in the dataset
㊙️ Encrypt genotypes as Zama secrets
🔍 Run lookups for various medical conditions for bechmarking
⏺️ Persist encrypted data to disk and read it back for benchmarking
☎️ Refactor into client / server model to understand client-side encryption and general latency

Left for a future PR:
🔑 Figure out the best way to make key management and usage work

@vishakh vishakh added the enhancement New feature or request label Jul 11, 2024
@vishakh vishakh self-assigned this Jul 11, 2024
Comment thread zama-poc/src/main.rs Outdated
Comment on lines +56 to +57
let genotype_encrypted = FheUint8::try_encrypt(encoded_genotype, client_key)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))?; // Convert tfhe::Error to std::io::Error

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not encrypt the rsid? Can't claim fully encrypted without it.

Comment thread zama-poc/src/main.rs Outdated
@bhaskarkishore

Copy link
Copy Markdown
Contributor

Also trying out in general is compressed keys/secrets: https://docs.zama.ai/tfhe-rs/fundamentals/compress

@bhaskarkishore bhaskarkishore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code so far is good. The use of the client key in server side code needs to be revisited, e.g: L90. Ideally if we can refactor its usage out, it will lead of simpler key management.

@bhaskarkishore bhaskarkishore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks okay for PoC code

Comment thread zama-poc/Cargo.toml
Comment thread zama-poc/scripts/create_bin_file.sh
Comment thread zama-poc/src/client.rs
@vishakh
vishakh marked this pull request as ready for review September 12, 2024 19:34
@vishakh
vishakh merged commit dd8b54b into main Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants