Skip to content

neutiyoo/mach-avs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mach AVS (M2)

AltLayer Mach AVS is a fast finality layer for Ethereum rollups. In Mach AVS , operators will run verifier nodes for rollups, monitor the rollup for fraudulent behavior, and submit a fraudulent alert to Mach AVS. Fraudulent alert can then be confirmed via sufficient quorum or ZK proofs.

Use cases

  1. Fast finality services for Web3 application
  2. Circuit breaker for RPC nodes

Current Deployment

Mainnet

AltLayer MACH AVS

Name Address
ProxyAdmin 0xba9aC2c9d1Fc2Ba22f3709EC073757777447bb5B
ServiceManager 0x71a77037870169d47aad6c2C9360861A4C0df2bF
RegistryCoordinator 0x561be1AB42170a19f31645F774e6e3862B2139AA
BLSApkRegistry 0xF9f34Bc6309A52c266881066e8c58fbF562D442c
IndexRegistry 0x1BE83d6CE83bC516630afE535F36652A1511779B
OperatorStateRetriever 0x8Ad765474f86FFb0A742041427383b524192b71f
PauserRegistry 0xcCC62915256c7137aaD62d5E4385fc737264D2B1
StakeRegistry 0x49296A7D4a76888370CB377CD909Cc73a2f71289

Xterio MACH AVS

Name Address
ProxyAdmin 0x185416d7B186d2D9474c9877eaf1C28dD0d7FB43
ServiceManager 0x6026b61bDD2252160691CB3F6005B6B72E0Ec044
RegistryCoordinator 0x6e32dD4169825337B54236b9355910b83E51e5a8
BLSApkRegistry 0xF8388C2D74fAde1C8367Cb9E419e395dB4c5FA75
IndexRegistry 0x15637782bdcdf9FC282EE592d333c63C1d6D2536
OperatorStateRetriever 0x342D475f3ae36e0CFBF19c222f203048446955b6
PauserRegistry 0x895Dd27289096722c389Cb3fd99aF2750190a48a
StakeRegistry 0x681b76916fdecc07705b91e032D435f03B678C76

DODOchain MACH AVS

Name Address
ProxyAdmin 0x25f8f07D6fdB1B4799169c983624708E33A96571
ServiceManager 0xd50E0931703302B080880C45148F5D83ea66aE2a
RegistryCoordinator 0xCa7f0a65f82230691580F41876161E6282460F29
BLSApkRegistry 0x69Ad83345f2AA1D95DC5f2539756e1858b6e8C57
IndexRegistry 0xae60938bba94605DC759708A56Fbf99E8Bd9A3Dd
OperatorStateRetriever 0x1d6F6af4464BDb3f2977d4A3EFC29A60d362D20B
PauserRegistry 0x201FD6D35580b6e35e4009965C39E55ba1a5E35B
StakeRegistry 0xC4b21787131bCA9898e1B52EE6F6F23B126698D8

Testnet

AltLayer MACH AVS

Name Address
ProxyAdmin 0x2AB98471C25061C11431EA72F92215DC1d918C64
ServiceManager 0xAE9a4497dee2540DaF489BeddB0706128a99ec63
RegistryCoordinator 0x1eA7D160d325B289bF981e0D7aB6Bf3261a0FFf2
BLSApkRegistry 0x2e9267bAbAdD516471c884D41ED1A1c1D01aeDf3
IndexRegistry 0x6b715bFFf9A6bbD1Eb745B55df8cEd592CbcbB50
OperatorStateRetriever 0xBE1c904525910fdB49dB33b4960DF9aC9f603dC7
PauserRegistry 0x709510e198967ff878041C56866beB43C4196862
StakeRegistry 0x0b3eE1aDc2944DCcBb817f7d77915C7d38F7B858

Xterio MACH AVS

Name Address
ProxyAdmin 0xeBaE2a37884e7aeC83c0e69A146e4920c6aAE6Dc
ServiceManager 0x648e5012D7B30755963755F7dd7Ff03e2F61bF8B
RegistryCoordinator 0xC452d0BcEE841EEd2AEe687495558e7a3C6010BE
BLSApkRegistry 0xE0268135fC9202a71810a631CC90266c97AFC156
IndexRegistry 0xe6437C48B45f4333871C2D99ecaB6751f465F1b6
OperatorStateRetriever 0x222B52694Ab22AFc155B573baF52C1ed9a26b3f1
PauserRegistry 0x4eFbD4288119436F91aF2BA199809e82444A4966
StakeRegistry 0x6628b0Cc07a6fdB84d660DeF0E74F3C21D78C290

Audits

Components

Mach AVS consists of the following component:

  • Mach AVS service manager contract
  • Mach AVS aggregator (for signature aggregation version)
  • Mach AVS operator
  • Mach verifier

Architecture

BLS Signature Aggregation Mode

BLS Mode

sequenceDiagram
    participant MC as Mach Contract
    
    participant MA as Mach Aggregator
    participant MO as Mach Operator
    
    participant MV as Mach Verifier
    
    participant L2 as Layer2
    
    MV ->> L2: Fetch Layer2 Status
    MV ->> MV: Verify Layer2 Blocks by executor
    
    alt the block is valid
    MV ->> L2: Fetch next blocks
    else the block is invalid
    MV ->> MO: Commit alert to operator
    MV ->> MC: Commit a Earlier Alert
    MO ->> MO: Sig the alert
    MO ->> MA: Commit alert bls sig
    MA ->> MC: If collected, commit Avs confirmed Alert
    MV ->> MV: generate zk-snark-proof
    MV ->> MC: commit Zk proved Alert
    end
Loading

ZK Proof Mode

ZK Proof Mode

sequenceDiagram
    actor US as UserService
    actor UC as UserContract
    participant MC as Mach Contract
    participant MS as Mach Services
    participant L2 as Layer2


    US->>MC: A Rpc for Layer2

    MC->>L2: Map Rpc request if no alert

    UC->>MC: IsAlert

    MS->>L2: Fetch status and verify

    MS->>MC: Commit Alert for Layer2
    MS->>MC: Commit ZK proof for Alert
Loading

Mach AVS service manager contract

Mach AVS service manager contracts can be found in contracts folder

Dependencies

Mach AVS uses EigenLayer Middleware v0.1.2

Alert submission and verification

BLS Signature Aggregation Mode

The aggregator service will collect BLS signatures from operators in Mach AVS. Upon reaching sufficient threshold, the aggregator will confirmAlert) to submit the alert. Once verified, the alert will be confirmed.

ZK Proof Mode

In this mode, it does not need an aggregator to collect signatures. ZK Proof will replace the process of collecting BLS signature.

Operator can detect block or output root mismatch and submit an alert using alertBlockMismatch() and alertBlockOutputOracleMismatch() respectively. After the alert is submitted, operator will compute the corresponding ZK proof to prove the alert and submit the proof using submitProve().

ZK Proof generation can be either done using RISC0 or GPU.

Training wheels

Mach AVS includes operator allowlist which can be managed by contract owner.

Enable/Disable operator allowlist

  • Enable operator allowlist: enableAllowlist()
  • Diosable operator allowlist: disableAllowlist()

Operator allowlist management

  • Add operator to whitelist: addToAllowlist(address operator)
  • Remove operator from whitelist: removeFromAllowlist(address operator)

Mach AVS Aggregator (for BLS Signature Mode)

Aggregator sample configuration file can be found at config-files/aggregator.yaml.

./bin/mach-aggregator --config <PATH_TO_CONFIG> \
    --ecdsa-private-key <OWNER_PRIVATE> \
    --avs-deployment ./contracts/script/output/machavs_deploy_output.json

The --avs-deployment is use the machavs_deploy_output.json output by deploy script.

Mach AVS aggregator service can be found in aggregator

Mach AVS Operator (for BLS Signature Aggregation Mode)

Operator sample configuration file can be found at config-files/operator.yaml.

Operator can be run using the following command:

./bin/mach-operator-signer --config <PATH_TO_CONFIG> 

Node operator client can be found in operator. For more information on how to run operator, check out our guide at here

Mach AVS Verifier

Verifier for ZK Proof mode

The ZK Proof mode verifier codebase is found at https://github.com/alt-research/alt-mach-verifier

Verifier for BLS Signature Aggregation mode

The verifier codebase is found at https://github.com/alt-research/mach

Deployment scripts for running within local devnet

Check out scripts

Build a devnet by docker-compose

For devnet, we can use docker-compose:

docker compose build
docker compose up

it will boot anvil as layer1, a aggregator and a operator for test.

Build and Run

If want to run Mach AVS by binary, can see the documentations:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 53.0%
  • Go 43.5%
  • Shell 1.7%
  • Dockerfile 1.3%
  • Makefile 0.5%