Secret Contracts

Enigma’s Secret Contracts are written in Rust. See here for links to several sample contracts, and our recommendation for when to use these as starting points.

Millionaire’s Problem

Compare two numbers without revealing the underlying data.

This is a good starting point for: blind auctions or as an alternative to range proofs.

Github

Using Encryption Libraries

Use an encryption library within a secret contract.

Good starting point for: applications which require the use of a relayer (i.e., coin-mixing), where a task is sent to an intermediary before being passed to the network.

Github

Ethereum Calls

Calling a function of an Ethereum Contract from within a Secret Contract

Useful reference for any application where the outcome of a secret contract should result in some action being taken within an Ethereum Smart Contract.

Github

Enigma Randomness Service

Using the Enigma Randomness Service to generate randomness within Secret Contracts.

This is a useful reference for any application incorporating shuffling, lotteries, or other randomness.

Github

Secret Voting

Tally encrypted votes.

This helps prevent vote bribery and is an alternative to commit-reveal patterns, which have poor UX.

Github

All sample contracts:

Can be found here on the Enigma Github

Sample Applications

These sample applications demonstrate different use-cases for Enigma. All come with front-end UIs and demonstrate integration of Enigma JS with secret contracts.

Secret Access Control

This application enables access-control (similar to proxy re-encryption) with Enigma, so that users can encrypt messages or data for specific recipients. In the sample application (described more in-depth in the github repo), the owner of the secret contract is able to encrypt messages specifically for other users from a list of possible recipients.

This is a good starting point for applications that:

Send messages to users based on their membership in a whitelist (i.e., subscriptions)

Send messages on certain conditions (i.e., a dead-mans switch)

Hide messages until users fulfill a task (scavenger hunt)

Secret Data Validation

This sample application enables users to encrypt data and check their encrypted data set against another user’s encrypted data set. Purposefully simple, we hope this application is a flexible starting-point for a range of other projects.

This is a good starting point for applications such as:

Secret auctions

Checking that a verifiable claim lies within a certain range (i.e., user is over 21)

Enabling whistleblowers to ensure that their data matches without revealing it publicly

Games that check one player’s move against another (i.e., rock-paper-scissors)

See also: Millionaire’s problem

Non-Fungible Token Lottery

This application makes use of Enigma’s native random-number-generator to award a secret lottery prize (a non-fungible token) to a winner.

This is a good starting point for applications that:

Require the use of a random number for any reason

Dice games

Use NFTs

Select a single person from a pool of applicants for some reason

See also: Simple example of Enigma Randomness Service

Secret Benchmarking

This application enables users to submit a “baseline” data set, and then check to see whether data points submitted fall within certain percentiles of the existing dataset.

This is a good starting point for applications that:

Check to see if a smaller data subset falls acceptably within the norm of a larger set

Perform secret data analysis of any kind

Use any type of common benchmarking: salary, price quotes from contractors

Coin Join

This application is a coin-mixer, based on the coin join protocol, that uses Enigma to give users transactional privacy. It showcases Ethereum callbacks as well as the enigma randomness service.

Overviews and Updates

Updates to Secret Contracts

Overview of Discovery Architecture and New Features

Walkthroughs

These end-to-end tutorials take you through working with Enigma from start to finish.

An introduction to the Rust language

Writing your first Secret Contract (a millionaire’s problem)

Create the front-end with EnigmaJS for your application.

Product Building Blocks

These high-level articles describe applications that could be built with Enigma technology.

Coin-Mixing

Secret Hedge Funds

Preventing DEX Front-Running

Secret Auctions

Dead-Man’s Switch

Dark DAOs, Secret Voting, and Bribery

Decentralized Credit Scores

Secret Voting and Token-Curated Registries

Verified Claims on Secret Data and Decentralized Identity

Defining Secret Contracts

Secret ICOs and Privacy Tokens

GDPR and Enigma

Blockchain and Facebook: The Need for Privacy