Skip to content

flashbots/flashtestations

Repository files navigation

Flashtestations

A protocol for allowing any TDX device to prove its output onchain

Its first use case will be for proving that blocks on the Unichain L2 were built using fair and transparent ordering rules

System Components

  1. TEE Devices
  2. TEE Public Keys (these are used to identify and verify TEEs and their outputs)
  3. TEE Attestations (also called Quotes)
  4. Block Signature Transaction
  5. Governance Values

System Flows

  1. Registering a TEE Device (also referred to as a block builder)

    a. Should only be callable from a TEE-controlled address

    b. Verify TEE Quote

    c. extract and store TEE address and workload info

    d. set liveness (we want a way to indicate that a TEE device has not been active for a long period of time, and for that we use liveness)

  2. Verify Flashtestation transaction

    a. Check signature of transactions against registry of live builder keys

    b. update TEE device liveness

  3. Deregistering a TEE Device

    b. Mark TEE device as "retired"

Deploy

This will perform a simple test to see if onchain verification of a tdx attestation works

forge script --chain 11155111 --rpc-url $ETHEREUM_SEPOLIA_RPC_URL script/FlashtestationRegistry.s.sol:FlashtestationRegistryScript

TODOs

  • Implement TEE Device Registry
  • [] Implement Flashtestation transaction verification

Open Questions

  • Should it be Upgradeable? Pros: - very simple to account for changes to the Automata DCAP Attestation contract, contract bugs, contract upgrades - Doesn't really impact the trust model, because we already expect to have some Security Council of Unichain + Flashbots in the beginning that manages which workloadIDs to trust (via the setting of Policies) Cons: - trust model now relies on owner (probably a security council of Unichain + Flashbots) to remain not collude. If they do collude, they can upgrade the contract to emit a malicious Registered event and trick users into incorrectly trusting that blocks are being verified by a trusted TEE

Foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Foundry consists of:

  • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
  • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
  • Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
  • Chisel: Fast, utilitarian, and verbose solidity REPL.

Documentation

https://book.getfoundry.sh/

Usage

Build

$ forge build

Test

$ forge test

Format

$ forge fmt

Gas Snapshots

$ forge snapshot

Anvil

$ anvil

Deploy

$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>

Cast

$ cast <subcommand>

Help

$ forge --help
$ anvil --help
$ cast --help

About

flash attestations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •