From b8d63fd24c1f08d2a3560203b235c6058a3ab4d8 Mon Sep 17 00:00:00 2001 From: Auryn Macmillan Date: Mon, 24 Jun 2024 15:54:34 +0100 Subject: [PATCH] add sequence diagram to readme --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a71ca75f..fd2c1cbe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![Github Actions][gha-badge]][gha] [![Hardhat][hardhat-badge]][hardhat] [![License: MIT][license-badge]][license] + # Enclave [gha]: https://github.com/gnosisguild/enclave/actions @@ -10,10 +11,66 @@ This is the monorepo for Enclave, an open-source protocol for Encrypted Execution Environments (E3). +## Architecture + +Enclave employs a modular architecture involving numerous actors and participants. The sequence diagram below offers a high-level overview of the protocol, but necessarily omits most detail. + +```mermaid +sequenceDiagram + actor Token Holders + actor Requester + actor Data Providers + participant Enclave + participant Ciphernode Registry + participant Ciphernodes + participant Computation Module + participant Execution Module + + loop Each token holder that wants to register a ciphernode + Token Holders ->> Ciphernode Registry: Stake tokens to register ciphernodes + end + + loop Each computation request + Requester ->> Enclave: Request computation + activate Enclave + Enclave ->> Ciphernode Registry: Select Committee + activate Ciphernode Registry + Ciphernode Registry -->> Ciphernodes: Key Setup + activate Ciphernodes + Ciphernodes -->> Ciphernode Registry: Publish shared key + deactivate Ciphernodes + Ciphernode Registry -->> Enclave: Publish Committee + deactivate Ciphernode Registry + + loop Each input provider + Data Providers ->> Enclave: Publish inputs + Enclave ->> Computation Module: Validate inputs + activate Computation Module + Computation Module -->> Enclave: 👌 + deactivate Computation Module + end + + Enclave ->> Execution Module: Request execution + activate Execution Module + Execution Module -->> Enclave: Publish ciphertext output + deactivate Execution Module + + Enclave -->> Ciphernodes: Request plaintext output + activate Ciphernodes + Ciphernodes ->> Enclave: Publish plaintext output + deactivate Ciphernodes + + Requester -->> Enclave: Get plaintext + Enclave -->> Requester: Returns plaintext + deactivate Enclave + end + +``` + ## Security and Liability This repo is provided WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ## License -This repo created under the [LGPL-3.0+ license](LICENSE). \ No newline at end of file +This repo created under the [LGPL-3.0+ license](LICENSE).