Skip to content

op-stack state(less) transition in an AWS Nitro enclave

License

Notifications You must be signed in to change notification settings

base-org/op-enclave

Repository files navigation

op-enclave

op-enclave is a relatively small modification to the op-stack that proves state transitions in a AWS Nitro Enclave, and submits the resulting state roots to the L1 chain. This removes the need for the 7-day challenge period, and allows for immediate withdrawals.

Directory Structure

├── bindings: Go bindings for various contracts, generated by `make bindings`
├── contracts: Solidity contracts
├── op-batcher: Batcher modification that submits batches immediately after withdrawals are detected
├── op-da: Data availability service for writing to S3 / file system
├── op-enclave: Stateless transition function, for running in a AWS Nitro TEE
├── op-proposer: L2-Output Submitter, communicates with op-enclave and submits proposals to L1
├── op-withdrawer: Withdrawal utility for submitting withdrawals to L1
├── register-signer: Registers a enclave signer key from a Nitro attestation with the SystemConfigGlobal contract
├── testnet: Dockerized testnet for running the op-enclave stack

Running a testnet

  1. Deploy the Nitro certificate manager using make deploy-cert-manager:
IMPL_SALT=0 DEPLOY_PRIVATE_KEY=<privatekey> RPC_URL=https://sepolia.base.org make deploy-cert-manager
  1. Deploy the system contracts using make deploy:
IMPL_SALT=0 DEPLOY_PRIVATE_KEY=<privatekey> DEPLOY_CONFIG_PATH=deploy-config/example.json RPC_URL=https://sepolia.base.org make deploy
  1. Generate a testnet genesis block and deploy the proxy contracts for a new chain using make testnet:
DEPLOY_PRIVATE_KEY=<privatekey> L1_URL=https://sepolia.base.org make testnet
  1. Copy testnet/.env.example to testnet/.env and fill in the environment variables, in particular the # per deploy section at the top.

  2. Run the testnet:

docker-compose -f testnet/Dockerfile up

About

op-stack state(less) transition in an AWS Nitro enclave

Resources

License

Stars

Watchers

Forks

Packages