What's the meaning of a task receipt?

The documentation says a task receipt is

A publicly verifiable proof that a task has been computed by an uncompromised enclave with all intended inputs.

What is the structure of a task receipt?

In Discovery we stored task receipts on Ethereum - a task receipt would contain the hashed inputs to the secret contract. Enigma network would only process a task if the receipt was already mined on Ethereum. This was due to the fact that we didn’t have consensus on Discovery.

Regarding the structure, I’ll let @taariq chime in

Thanks for replying @can

But if a task receipt contains the hashed inputs, what’s the meaning of Task Record?

How to verify a task receipt on Ethereum?

Yes well spotted, actually the verifiable receipt is the TaskRecord, here’s the source in the Enigma contract where it’s verified and committed.

If you want to verify on the client side, check out the integration tests, eg

I have another question:
Does the worker selection happen after the user inputs encryption .
If a user wants to encrypt their inputs using a worker node’s public key(with the help of Enigma-JS), how does the user know which worker node’s public key he/she should use to generate a symmetric key (in ECDH protocol)?
I’m confused about the order of worker selection and user inputs encryption, which happens first?

I have read this before , but I’m still confused about it…

First the worker is selected, in the Discovery version we’ve been talking about so far, the worker is randomly selected every epoch.
So when the user wants to create a task, she uses the worker’s public key and her own private key to derive a key with which to encrypt the input.

This happens under the hood in enigma-js when you createTask

1 Like

@taariq thanks, the code helps me

Hey thanks for asking, also like to read code :slight_smile:

1 Like