We’ve recently open-sourced the individual components of the Discovery release.
Note: These individual components are combined in a forthcoming release, which is still under testing. When this is ready, it will be possible to run the network locally.
For now, these independent component repos can provide insight into our current system architecture.
These components are:
The Enigma smart contract written in Solidity provides the consensus layer for the Discovery release of the Enigma Protocol. One instance of this contract will be first deployed on the Ethereum testnet and later on mainnet. Due to the complexity of the contract, and the limitations of the Ethereum Virtual Machine, the contract is broken down into several smaller, more modular contracts and libraries that provide different parts of its functionality. Look at the contract migrations to understand how all these contracts and libraries come together into what we refer to as the Enigma Contract
The code of this repository lies at the core of the Enigma Protocol, hence its name. Written in Rust, it includes the code that runs inside the enclave (trusted) and its counterpart that runs outside the enclave (untrusted) and interfaces with the rest of the network. Following Rust code architecture, this repository organizes its code into several crates that provide several different components: the Enigma implementation of the WebAssembly (WASM) interpreter in Rust, the Enigma Runtime, cryptographic (AES, ECDSA, ECDH) and hashing (Keccak256) libraries, and the Remote Attestation client.
This repository also includes the Key Management Node written in Rust, as well, that runs inside an enclave (trusted) and manages the keys to encrypt the state for all contracts in each epoch. It responds to legitimate requests from all other enclaves in the Enigma network for the encryption keys assigned to any such nodes.
Enigma Core provides support for simulation mode, in which the software can be run on computers without Intel’s SGX support for development purposes (that is, for DApp developers to develop and test their secret contracts before deploying them on the real network). However, once the Enigma network has been deployed on testnet and mainnet, only enclaves running in hardware mode (on hosts with SGX enabled) will be able to join the Enigma network.
The Enigma-P2P packages various autonomous runtimes that communicate between each other through a main controller. The communication is done via channels, which are bi-directional message-sending implementations, and through actions, which are predefined messages that have specific functionality attached to them. This infrastructure is optimized for asynchronous communication that reacts to notifications between the various components.