-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: tee multi prover, fix edit url (#3)
* Add prover doc (#2) * add prover doc * rename to prover relayer * Update workflow.png * add note for brief overview * fix: edit url * nit: unicode symbols * refactor: move tee page to developers section, collapse pages, docs url --------- Co-authored-by: failfmi <[email protected]> * Add Protocol overview page (#4) * feat: add protocol overview page and redact hello page. * feat: add verified block state information * fix: Block proposal adjustment * fix: clarify wording * feat: add block state diagram * feat: add a message that bridging is paused (#5) * Acquire tokens renaming and "'"unicode symbol (#6) * refactor: rename move-funds to acquire testnet tokens * fix: unicode ' in protocol page * docs(dev): testnet endpoints for explorer & rpc * nit: remove slash --------- Co-authored-by: ChenYe <[email protected]> Co-authored-by: Viktor Todorov <[email protected]>
- Loading branch information
1 parent
22c1cef
commit a7130e0
Showing
15 changed files
with
156 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: TEE Multi Prover | ||
slug: /developers/concepts/tee-multi-prover | ||
--- | ||
|
||
## Background | ||
|
||
The defining characteristic of a rollup is the ability to push L2 state updates to L1. Typically, either fraud proofs or validity proofs are used to ensure the correctness of each state update. | ||
|
||
Fraud and validity proofs rely on the strong assumption that the underlying construction and implementation of the proof system are correct. Unfortunately, proof systems are complex pieces of code prone to bugs and errors, and it is impossible to guarantee they are infallible. For this reason, a diverse set of proof systems is essential to safeguard the overall robustness of the system - an idea that has reverberated in multiple places. Different proof systems act as a counter-check against each other: by comparing their outputs against each other we can identify potential discrepancies - similar to differential testing. | ||
|
||
We propose implementing an additional prover system by leveraging Trusted Execution Environment (TEE) technology because this approach yields performance without the complexities associated with e.g., ZK circuits. | ||
|
||
## Brief Overview | ||
|
||
![Brief Overview](/img/tee-multi-prover/overview.png) | ||
*(Note: This design represents the ideal approach and may differ from the existing implementation.)* | ||
|
||
This diagram illustrates how the TEE Validity Proof interacts with the L1 rollup contract: | ||
1. Whenever the prover relayer needs to update the rollup state on L1, it sends a Proof of Block to the TEE Prover. The Proof of Block contains all the necessary states, enabling the TEE Prover to perform stateless state transitions. | ||
2. The TEE Prover executes the blocks based on the Proof of Block and generates a TEE Validity Proof, which is then returned to the prover relayer. | ||
3. The prover relayer submits the updated state along with the proofs to the L1 Rollup Contract. | ||
|
||
## The Case for Using TEEs | ||
|
||
1. TEEs Have Good Performance: TEEs provide reliable, fast, and cost-effective computation. The computational overhead of TEEs is minimal (and can even be negligible, depending on the specific TEE technology). This allows TEEs to perform state transitions with very low latency and high efficiency. For example, based on our tests, Intel TDX introduces less than 1% performance overhead, and the time required to generate a proof is approximately the same as the time needed to execute a block. | ||
2. TEEs can be Used Despite Not Being Infallible: A major concern surrounding TEEs, especially Intel SGX, is that they are frequently compromised. While it is true that vulnerabilities related to TEEs continue to be discovered, it is worth highlighting that these vulnerabilities are not fatal and can't be exploited indefinitely once they are patched - existing exploits are implementation bugs that do not undermine the architectural design of TEEs. Moreover, these vulnerabilities are often difficult, or even impossible, to exploit unless certain conditions are met, e.g., Aepic Leak allows an attacker to access SGX's most precious secrets, but cannot be exploited unless APIC registers are exposed. TEEs are also improving, and more technologies are emerging such as AMD SEV, Intel TDX, and AWS Nitro Enclaves. Lastly, if the vulnerability of one TEE is particularly concerning, a committee consisting of different TEE technologies (e.g., Intel + AMD + AWS) can be employed to increase the security of the overall system - in this scenario, a potential attacker would need to exploit multiple TEE technologies at the same time, making it increasingly difficult to mount an attack. | ||
|
||
## On-Chain Proof Verification | ||
|
||
During the on-chain proof verification process, the following checks are performed: | ||
1. The software of TEE Prover is verified to ensure it aligns with the expected version and has not been tampered with. | ||
2. The TEE firmware and SDK of the virtual machine hosting the TEE Prover are confirmed to be up-to-date. | ||
3. The initial state of the proof for the state transition matches the current state on-chain. | ||
|
||
The attestation report provides the necessary information for points 1 and 2, and we use the [automata-dcap-attestation](https://github.com/automata-network/automata-dcap-attestation) to verify its validity. | ||
|
||
A attestation report verification costs approximately 3M gas. To reduce this expense, we use a ProverRegistry to separate the attestation and rollup processes, allowing a single attestation to support multiple state rollups during its validity period. | ||
|
||
The process is as follows: | ||
1. A secp256k1 key is randomly generated inside the TEE. | ||
2. When generating the attestation report, the key is embedded into the attestation report's user data. | ||
3. Upon submission of the attestation report to the ProverRegistry, the public key is recorded. | ||
4. When the TEE Prover provides a proof for a state transition, it signs the result using the ephemeral key. | ||
5. During proof verification, the ProverRegistry uses ecrecover to retrieve the public key and validate it against the recorded key. | ||
|
||
With this optimization, the verification cost for a single proof is reduced to no more than 10k gas. | ||
|
||
|
||
![workflow](/img/tee-multi-prover/workflow.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: Overview | ||
slug: /protocol/overview | ||
--- | ||
|
||
:::info | ||
UniFi is an Ethereum Based Rollup with enabled preconfirmations. | ||
::: | ||
|
||
## UniFi Walkthrough | ||
![Based sequencing](/img/rollup/based-sequencing.png) | ||
|
||
### 1️⃣ Transaction Submission | ||
The flow begins with users submitting **rollup transactions** to **UniFi Sequencers**. Sequencers are responsible for transaction aggregation and ordering for the rollup. They play a critical role in offering **preconfirmations** to users when possible. | ||
|
||
**Preconfirmations** are essentially "soft promises" from the sequencers that the transactions will be included in the next L1 block. These preconfirmations come with economic guarantees backed by penalties (slashing conditions) to ensure sequencer reliability. If a sequencer fails to include a transaction it has preconfirmed, it risks being slashed. | ||
|
||
### 2️⃣ Block Proposal | ||
Once the sequencer has aggregated enough transactions, it bundles them into a **block**. This block is then **proposed** to UniFi's **Rollup Contract** on the Ethereum L1. At this stage, no execution is performed. Ethereum validators simply record the block's ordered transactions on the L1, and only transaction validation is performed on a contract level. It's important to note that Ethereum validators are responsible for the order of inclusion of these **proposed block** transactions in the L1 chain, which is where the "based"-ness of UniFi comes into play. | ||
|
||
### 3️⃣ Block Insertion | ||
When a proposed block is successfully included in the Ethereum L1 chain, the **UniFi Client** listens for this event. The client: | ||
1. Extracts the ordered transaction data from the rollup contract. | ||
2. Constructs an **L2 block** using this transaction data. | ||
3. Sends the L2 block to the **L2 Execution Client** (a modified Geth client). | ||
|
||
Once the block is executed by the L2 Execution Client, the **L2 state** is updated, and the block is officially added to the L2 chain. | ||
|
||
### 4️⃣ Block Proving | ||
The last step is to prove to the L1 that the block has been executed correctly on the L2. This is where **UniFi Provers** come into play. They listen for newly inserted L2 blocks (without a proof) and generate cryptographic proofs to validate their correctness. | ||
|
||
To generate a proof, provers create a **Proof of Block (PoB)** statement themselves, which they send over to an **Intel TDX TEE** for attestation. The TEE acts as a trusted computation enclave that uses the PoB to securely re-execute the block's transactions and verify the state transitions. Once the re-execution completes: | ||
|
||
- The TEE generates an **attestation** that ensures the L2 block's integrity. | ||
- The attestation and cryptographic proof are submitted to UniFi's L1 contract on Ethereum. | ||
- The L1 contract verifies the proof, ensuring that the state transitions are valid and match the ordered transactions. | ||
- Once verified, the block is considered **proven**, and the L1 state is updated to reflect this. | ||
|
||
### Verified block state | ||
In the L2 chain, a block is not considered truly final once it is proven; it must also be **verified**. Verification ensures that a block is not only proven but also part of a fully validated sequence of blocks. This requirement arises because blocks can be proposed and proven asynchronously. For instance, if block N has been proven, but its parent block N-1 has not yet been verified, block N cannot achieve the verified status. The verified state is crucial for the protocol as certain operations can only be performed on verified blocks (e.g., mpt verification of state proofs). | ||
|
||
Practically speaking, in order for a block to be considered **verified** it must meet the following conditions: | ||
- The block itself is proven: its cryptographic proof has been submitted and validated by the L1 contract. | ||
- Its parent block is also verified: This guarantees a continuous and valid chain back to the genesis block, which is inherently verified. | ||
|
||
![Block states](/img/rollup/block-states.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.