cardano-foundation / CIPs

Cardano Improvement Proposals (CIPs)
https://cips.cardano.org/
Creative Commons Attribution 4.0 International
489 stars 319 forks source link

Fully homomorphic encryption circuits in Cardano... #415

Open mgajda opened 1 year ago

mgajda commented 1 year ago

It is a great feature for a smart contract to compute without decrypting the inputs and outputs. This allows verifying private data, and knowledge of these.

For this, we would need to enable running zero knowledge proofs, or FHE circuits in Plutus.

Easiest way to do it would be to import an existing HE circuit library, and provide a reasonable cost estimate. Please note that FHE/zkSNARKs are relatively expensive to compute so implementing them directly in Plutus may lead to unfeasibly complex transactions.

matiwinnetou commented 1 year ago

AFAIK there is no desire to put such things on Cardano L1 but have you heard of project midnight? https://midnight.iohk.io/

mgajda commented 1 year ago

I thought about Plutus to ensure smart contract interop.

Otherwise smart contract integration may require lots of separate infrastructure, possibly a sidechain.

L-as commented 1 year ago

@mgajda #283 will allow you to implement it yourself in Plutus

mgajda commented 1 year ago

@L-as Implementing it in Plutus would be definitely progress, but homomorphic encryption is infamously slow, so we will likely hit gas limit.

mgajda commented 1 year ago

@matiwinnetou Unfortunately project Midnight is fuzzy and unclear now. No capability has been released so far.

We want to build the product now and release soon.

L-as commented 1 year ago

@mgajda You split it up over multiple transactions. Depending on what you're doing, you could put the FHE into a SNARK?