Enigma Protocol Components 📖
The Enigma Protocol is made up of several distinct components, each with their own repository. This section gives an overview of what is contained in each repo, and its purpose in the protocol.
Enigma Smart Contract and Library
This repository also includes the Enigma smart contract written in Solidity, which implements the consensus layer for the Discovery release of the Enigma Protocol. Due to the limitations of EVM (Etherium Virtual Machine) as well as the complexity of the contract itself, several components have been broken down into modular contracts and libraries that come together into what is referred to as the Enigma Contract. One instance of this contract will be first deployed on the Ethereum testnet, and once more later on mainnet release.
The code of this repository, as its name would imply, lies at the core of the Enigma Protocol. Written in Rust, it includes the code that runs both the inside (trusted) of the enclave and the outside (untrusted), and is responsible for interfacing with the rest of the Enigma Network. This repository also includes the Principal Node that runs inside a trusted enclave, 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.
Both the enclaves and the principal node come packaged with support for 'simulation mode'. This mode allows for dApp developers to test secret contracts and interact with the libraries in a non-live environment without Intel SGX enabled hardware, thus allowing for easier cross-platform and legacy support. Please note that 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.
Enigma Peer-to-Peer (P2P)
The Enigma-P2P packages various autonomous runtimes that communicate between each other through a main controller. This communication is facilitated via both bi-directional message-sending tunnels called channels, as well as through actions, which are predefined messages that have a specific function attached to them. This infrastructure is optimized for asynchronous communication that reacts in real-time to notifications sent between the various components.
This repository organizes its code into various cargo crates, providing several different components: the Enigma implementation of the WebAssembly (WASM) interpreter in Rust, the Enigma Runtime, cryptographic (AES, ECDSA, ECDH) and hashing (Keccak256) libraries, as well as the Remote Attestation client.