Partial Calculations

Hi, a couple of high level questions about partial calculations:

Firstly, I modified the zama client/server sample (GitHub - zama-ai/concrete-example-client-server) to run with the latest tfhe-rs and configured it across 3 machines:
machine1: client1 and server1
machine2: server2
machine3: server3

Data and calculation path (explained below): client1 => server2 => server3 => server1

The user enters values for a, b and c at client1 where they are encrypted and sent to server2 where result2 = (a+b)*c occurs.
Then the encrypted result2 and encrypted b values are sent to server3 where result3 = result2 + b occurs.
Finally the encrypted result3 is sent to server1 where the value is decrypted and displayed. However the decrypted value is always different to what is expected.

Will the above scenario change with the upcoming (2024) Threshold FHE release or is there another way to decentralise the algorithm you wish to use so that it is not all happening on the one server?

Could it be that something like ORAM or Oblivious Database might help here?

Thanks
Andy

hello @andymc

Can you maybe share your code ?

It’s not expected that the result is always different.

I cannot say about the threshold FHE for now as threshold FHE, as far as I understand, is a way to require several “decryptors” to work together to decrypt a single result under a secret key that has been split between said “decryptors”, it does not mean the computation would be decentralized I think as a single server could be running the computation with a server key matching the secret key that is shared among the “decryptors”.

Note that servers should NEVER be sent the client keys which MUST remain secret (you were saying server 1 but then I guess it’s the client ?)

Cheers

Hi @IceTDrinker

All working now. It was a simple error at my end.

Determined that I was generating new client and server keys in the server program on machine1 in the ./server folder in addition to those already being generated in the .client folder. Instead i needed to point server1 to …/client/client_keys.bin and …/client/server_keys.bin files so that the client and server could use the same keys.

Eventually server1 and client1 may be merged into one program on machine1 and client_keys.bin won’t exist in file form - still getting familar with Rust.

Yes, client keys only exist on one machine.

Cheers

Ok awesome then :slightly_smiling_face:

Glad you can use your multi server approach !