Why Enigma?

At Enigma, our mission is to ensure mass adoption and global usage of decentralized technologies as more sustainable, human-focused alternatives to centralized systems. Our approach is simple: solve the biggest problems and build groundbreaking systems and products that will allow decentralized technologies to be used by millions or billions of people.

Enigma’s protocol functions as a privacy layer for the decentralized web. First researched at MIT, our network of “secret nodes” can perform computations over encrypted data at scale without ever exposing the raw data itself. By finally enabling decentralized applications to use private and sensitive data, smart contracts built with Enigma become “secret contracts”, allowing developers to create thousands of new, valuable solutions.

Enigma is attacking one of the largest challenges facing our space: the privacy problem. Data on blockchains are public by design. This not only greatly limits any decentralized application requiring sensitive data, but it also limits the usability of these applications by creating attack vectors. While blockchains are a great innovation for correctness, the public nature of the data significantly limits mass adoption.

In addition to privacy, Enigma is committed to solving for scalability and usability — and these challenges are all strongly linked. By moving the heavy lifting of computation off-chain, Enigma provides a scalability solution for decentralized applications. In addition, for many applications that require privacy (such as gaming or trading applications), Enigma is also solving serious usability challenges such as preventing front-running and improving commit / reveal mechanisms.

Read on to learn more about how Enigma works and how you can get started with building your own products and solutions on Enigma!

Enigma’s Network Structure

Enigma is a secure computation network that acts as a layer 2 solution for Ethereum. Enigma introduces the concept of secret contracts, which are identical to Ethereum contracts but can compute on sensitive data.

Secret contracts are written in Rust and compile into Web Assembly (WASM) bytecode. WASM gives Enigma network the versatility to address use cases like regression and machine learning that are not possible with EVM. Rust is an excellent programming language that simultaneously optimizes for both safety and performance.

Secret nodes achieve privacy-preserving computations by using Trusted Execution Environment (TEE) technology. TEE technology is a secure hardware that decrypts sensitive data inside an enclave that is not accessible by the owner of the hardware. Unlike software cryptography methods, TEEs enable high performance and general purpose computation, which are critical concepts to achieve usage and adoption of decentralized technologies.

Finally — the Enigma network, a p2p network where secret contracts are stored, is a libp2p network that’s built from scratch to accommodate the needs of the protocol. Also this network for the first time enables the concept of Secret State, which is a contract state that’s not accessible by network participants. The concept of Secret State distinguishes Enigma from off-chain computation projects that work on one-time static computations, and Secret State offers scalability gains at Layer 1 as computations can be batched.

To see how all these pieces come together, let’s walk through a user story where we introduce the three primary stakeholders of the Enigma network: developers, users, and workers.

1) Developers build blockchain applications using secret contracts in Rust. These contracts are interoperable with Ethereum, which means Ethereum developers can continue to build on Ethereum and use the Enigma network for secret computations. One good example is a Rock Paper Scissors Game, where Ethereum is used to store user balances and bets, while the Enigma network is used to run the game logic based on encrypted user inputs. Once a contract is completed, it is stored in the Enigma network and its bytecode is uploaded to Ethereum.

2) Users interact with secret contracts using the Enigma Client. Enigma Client encrypts user inputs locally and sends them to the Enigma network. In this release of Discovery, we are also storing a TaskRecord on Ethereum for every input into the Enigma network. In our next iteration of the network, this TaskRecord will be removed.

3) Workers (similar to miners / validators in other networks) run nodes to power the Enigma network. Once a user inputs a task into the Enigma network, a randomly-selected node picks up the inputs and propagates the encrypted inputs into a group of workers that will be working on that specific secret contract for that specific epoch, which is an interval of time. These workers are selected based on a stake-weighted lottery. (See our blog posts on secret nodes for more info on Enigma Proof of Stake).

Selected workers can decrypt the inputs inside their enclaves, compute on the data without having access to it, and reach a simple consensus on the result. Once this consensus is reached, the state of the secret contract is updated and Ethereum smart contracts may be called (for example, in Rock Paper Scissors to move funds from the losing account to the winning account). In this release of Discovery, there will be one worker per secret contract per epoch. In the next iteration of our network, a consensus protocol will be implemented.

One other interesting component of the network is the Key Management module. The key management module ensures that a random worker is able to compute on an encrypted input by the user. This is enabled by using the Diffie Hellman scheme, where keys are exchanged between the user client and workers in the network.

Getting Started Guides and Walkthroughs

We are dedicated to assisting developers every step of the way as they develop secret contracts and applications, from inception to deployment. In this section you will find helpful walkthrough guides and examples.

Please also reference our documentation and ask questions of our team and community in our Developers Forum!

What you can build with Enigma

Now that we have an understanding on how different components of the network interact with each other, let’s look into just some of the many applications you can build and deploy with Enigma.

Have your own idea for something you could build with Enigma? Share it on our Developers Forum!

Trading

Given our commitment to increasing adoption of decentralized technologies, trading has been an area Enigma has long been interested in. Enigma can both empower new use-cases and improve on existing decentralized applications.

With Enigma, one can construct “dark pools” or secret decentralized exchanges. The current version of Discovery enables creation of a private order book, similar to how 0x order books are run on relayers. Participants would deposit trading amounts into an Ethereum proxy contract. Once orders are matched on Enigma, atomic swaps can be triggered on Ethereum.

Another way in which Enigma can help DEXs and improve usability is by preventing front-running attacks. Recently there has been amazing work by Cornell Tech and Concordia University & Consensys Diligence detailing the attack surface in decentralized exchanges. Based on conservative estimates, these attacks cost millions of USD for ForkDelta users. Given the inputs into Enigma network are encrypted, miners or other malicious parties cannot front-run honest parties for profit.

These concepts for trading can also be extended to auctions to enable sealed bid auctions and create front-running-resistant auctions, which determined the winner of the first Fomo 3D competition.

Gaming

Gaming is another vertical with high adoption that is an area of focus for Enigma. Enigma can improve decentralized gaming in three primary ways:

Enable multiplayer games like Rock Paper Scissors without commit / reveals to create a better UX.

Create a source of randomness that is resistant to miner attacks. (Randomness is an integral piece of almost all Ethereum games.)

Enable stateful multiplayer gaming where players are competing against each other, such as in decentralized poker. While these first two points are improvements on existing games, this last point shows how Enigma can enable a whole new category of gaming.

Access control

The Enigma network enables access control functionalities similar to proxy re-encryption. With Enigma, one can build applications that reveal a secret to a specified user when there is a triggering event on Ethereum. Potential applications of access control are:

Dead Man Switch: Reveal the secret or the decryption key to a secret that is stored in decentralized storage (note: this secret can also be stored in the Enigma contract) when a triggering event takes place on Ethereum. This improves upon existing implementations of Dead Man Switch on Ethereum as it is censorship resistant and able to share the message with specified parties instead of the entire network.

Digital Content Management: Share decryption key to a music file, unique to User A, when User A pays artist the specified amount in an Ethereum smart contract. As one example, a project like Ujo can significantly benefit from this approach as currently all media content is stored on IPFS and accessible by anyone.

Governance

Given the decentralized nature of our ecosystem, it’s crucial that we develop governance models that are user friendly and attack resistant. As one contribution, Enigma enables secret voting, where votes remain encrypted while being tallied. This approach improves on current commit-reveal schemes that are used to preserve privacy before tally (but then require two separate user transactions) and also ensure votes are never revealed, which helps address issues of contractual bribery attacks. Secret voting can be applied to token-weighted voting used by projects like Aragon and also permissioned systems through whitelisted voting.

Identity

Identity is a very hard problem to solve in the blockchain ecosystem, but also one that can greatly influence adoption of decentralized technologies. Enigma can be used for Zero-Knowledge attestations about identity information or can be used to establish decentralized identities using Web2.0 data. Using Oracles, one can import social data or financial data into Enigma secret contracts and create attestations on-chain. This approach eliminates the need to share sensitive personal data with centralized solutions like Civic. This use case is extremely relevant to preventing sybil attacks (for airdrops, games, etc.) and for decentralized credit companies like Bloom and Colendi.

Private transactions

A good deal of transactional privacy on Ethereum can be achieved through a decentralized coin mixer built on Enigma. (Vitalik Buterin addressed this issue in a recent HackMD post.) As an example: Alice, wanting to send anonymous transactions, would deposit funds to a contract on Ethereum. Alice can then send IOUs for encrypted amounts and encrypted recepients on Enigma network. Settlement on Ethereum through a call back would take place when a large enough anonymity set is achieved.

Secret Messaging

Data on the Ethereum network is public. However, we may want to send private messages to specific Ethereum addresses without knowing any other information about that entity. Secret messages on Enigma enable a message sender to submit an encrypted private message to a secret contract, as well as the address of the intended recipient. When that recipient inquires with the message contract to see if they have any messages, the message is re-encrypted for the recipient only, and sent to them. The contents of these messages can be arbitrary: a note, a password, a request, and so forth. Furthermore, these messages could have more complicated delivery instructions: for example, a list of 10 or 100 addresses that can be recipients.

Secret Benchmarking

We are more willing to share certain data when it’s anonymized or when there are centralized players who promise to keep our data safe. Take Glassdoor as an example, where employees can submit their salaries and employers can use these to benchmark and determine compensation strategies. There are also consultants who solely focus on such benchmarking efforts. Enigma secret contracts could be used to create a “secret database” for compensation. Each participant can add their salary, location, role, company, industry. etc. A user who is searching for compensation data can run an encrypted query to calculate average, median, or mean salaries for software engineers with blockchain companies in San Francisco having 3+ years of experience. This would be a paid query and the payment could go directly to people who fit these criteria. (This idea can also be merged with TCRs or a Web2 driven identity solution to prevent cheating.)

The same idea can be extended to other critical benchmarks, such as rents or third party services (for example, code audits).

What Now?

Inspired to build a new type of privacy-enabled decentralized application? Seeing a use case for Enigma in your own project or for your own organization? You can get started building secret contracts today!

Read our Documentation

https://enigma.co/discovery-documentation/

Visit our Developers Forum

Walkthroughs and Dev Updates

Contact our Team

Got an idea for a cool application? Get in touch with our core team directly!

Join our Communities

Follow us on Twitter: https://twitter.com/enigmampc

Telegram: https://t.me/enigmaproject

Reddit: https://reddit.com/enigmaproject

Discord: https://discord.gg/SJK32GY

Learn more about the Enigma project on our website and blog.