Gitcoin is GDPR complaint. Learn more in
Gitcoin's Terms & Conditions.
Check out the Issue Explorer
Looking to fund some work? You can submit a new Funded Issue here.
Enigma Secret Contracts enable apps to compute over encrypted data. One simple use-case for this is “access-control”, sharing a certain message only with a qualified user.
An example of how to create a secret contract with Enigma can be found [here.](https://blog.enigma.co/getting-started-with-enigma-an-intro-to-secret-contracts-cdba4fe501c2)
## Solution Description
This solution should enable user A to encrypt a message, and specify a list of authorized recipient addresses. Users on the list of authorized recipients should be able to access and view the message.
This will involve:
- Writing a Secret Contract in Rust and deploying it to the Enigma Discovery network that handles the logic for the access-control application
- Using the Enigma-JS client to encrypt and transmit user A’s messages to the secret contract, as well as 2 or more “whitelisted” recipient addresses.
- Using the Enigma-JS client to encrypt and transmit whitelisted user’s requests for the data to the secret contract, to receive the correct output and successfully decrypt the message.
## Implementation Details & Data Flow
1. Alice enters the Ethereum addresses of her intended recipients (Bob and Charles), and a short message, into fields in a UI.
2. The Enigma-JS client encrypts these inputs, and submits them as a task to the secret contract in the Enigma network.
3. Bob clicks a button in a UI “check for messages”, which uses Enigma-JS to submit a task to the secret contract via the UI.
4. The secret contract receives Bob’s task, and compares Bob’s address to the whitelist of Bob and Charles that Alice submitted.
5. Bob is on the list, so the secret contract encrypts Alice’s message for Bob and returns it to Bob.
6. Enigma-JS receives the message from the secret contract on the Enigma network, and decrypts it locally by calling (enigma.decryptTaskResult(task) and enabling for Bob to read in his UI.
## Elements of Submission:
publisher: address authorized to save the message, can set to contract owner in construct
secretMessage: message data
sendSecretMessage(addresses: H160, str: message)
- sender must be contract owner
- validate 2 or more recipients
- validate message
- if sender address is whitelisted, return message.
Create 2 UI components, 1 for the owner/publisher to save a message and recipients, and another (possibly same) for a user to view the secret message
## Other deliverables:
Migration scripts (if required)
## Bounty Selection
For this first bounty round, the process works as follows:
1. Developer / team submits a **“pre-submission for approval”** for a bounty
2. Enigma reviews submissions, and selects an applicant (we don’t have a firm timeline for this, but hope to work quickly)
3. Applicant completes the task satisfactorily and receives the bounty
If the task is not completed, or applicant is unable to continue work in a timely manner, Enigma will select another applicant.
To complete a pre-submission for approval, comment on this issue within github and indicate your interest. Then, please also complete [this application form. ](https://airtable.com/shrN7Bu95f3R21XKx)
These materials should help you get started:
[Enigma Discovery Documentation
[Developer Quickstart Guide](https://blog.enigma.co/the-developer-quickstart-guide-to-enigma-880c3fc4308)
[Secret Contracts Walkthrough](https://blog.enigma.co/getting-started-with-enigma-an-intro-to-secret-contracts-cdba4fe501c2)