AltLayer Documentation
  • 👋Welcome
    • Overview
  • Restaked Rollups
    • VITAL for Decentralised Verification
      • Tier-1 Finality
      • Tier-2 Finality
      • Tier-3 Finality
    • MACH for Faster Finality
      • Interoperability via MACH
    • SQUAD for Decentralised Sequencing
    • Staking of dApp Token
  • Wizard
    • Introduction
    • Technical overview
    • Create AVS
    • Manage AVS
    • Operator management
    • Hosted operator API (BLS based)
    • Custom AVS specification
      • Constructor specification requirements
      • Import Externally-Deployed AVS
    • Report bug or submit a feature request
  • Autonome
    • Deploy AI Agent
    • Autonome API guide
    • Uploading your own agent framework
    • Twitter/X login troubleshooting guide
  • ♾️AltLayer-Facilitated Actively Validated Services
    • Overview
    • AltLayer MACH AVS
      • Operator Guide
      • User Delegation Guide
    • Cyber MACH AVS for Cyber L2
      • Operator Guide
      • User Delegation Guide
    • DODOchain MACH AVS for DODO Chain
      • Operator Guide
      • User Delegation Guide
    • Fast Finality Layer for Soneium
      • Operator Guide
      • User Delegation Guide
    • Xterio MACH AVS for Xterio Chain
      • Operator Guide
      • User Delegation Guide
  • Upgrade Guide
  • 🥩ALT Restaking
    • Staking Info & Parameters
    • Restake ALT
    • Delegating reALT
    • Check and Claim Staking Rewards
    • Unstake ALT
    • Migration from Xterio (Legacy) ALT Pool to Xterio Restaked ALT Pool
    • Testnet reALT faucet
  • Rollup-as-a-Service
    • What is Rollup-as-a-Service (RaaS)?
    • AltLayer's RaaS Offering
    • RaaS Onboarding Guide
      • Optimism Rollup FAQ
      • Arbitrum Rollup FAQ
    • AltLayer Ecosystem
    • Clients in the Spotlight
    • Pricing Model
  • External Integrations
    • Account Abstraction using Biconomy
    • Enabling permissionless interoperability on AltLayer Rollup with Hyperlane
      • Deplying Hyperlane Warp Routes for ERC20 Token Bridging
      • Running Off-chain Agents
      • Setting up the bridging UI
    • Cross-chain Interoperability using Celer
      • Fungible Token Bridging
      • Non-fungible Token Bridging
      • Generic Message Passing
      • cBridge SDK
  • AltLayer's In-House Rollup Stack in Depth
    • How does AltLayer's in-house rollup stack work?
    • Decentralized Sequencer Set
    • Security via Fraud Proof
  • Rollup Types
    • Flash Layer Rollups
      • Example Use cases
        • NFT Mint Events
        • Games
        • Event Ticketing
    • Persistent Rollups
  • Core Features of AltLayer's In-House Rollup Stack
    • Modular
    • Elastic
    • Multi-VM Support
    • Fraud Proofs
    • Decentralized Sequencers
    • Tiered-Finality
  • FlashLayer Showcase
    • AltLayer's POAP NFTs Collection Mint
      • Performance Test in the Wild
    • Dark Forest Community Round
    • Oh Ottie! NFT Collection Mint
    • Dark Forest Community Round for Jump Crypto's Pit Event
    • Ottie 2048
    • Other demos
      • Fraud Proof Demo
      • Flash Layer Demo
      • Rollup Launchpad Demo
      • FlashGPT Demo
  • Implementation Status
    • Roadmap
    • Development Status
  • Community & Support
    • Community
    • Support
Powered by GitBook
On this page
  • Overview
  • The rationale of operator proxy
  • Getting the operator and/or operator proxy endpoint and credentials
  • Operator API
  • Request header
  • Request body
  • Sample curl request
  • Operator Proxy API
  • Request header
  • Request body
  • Sample curl request
  • Sample success response
  1. Wizard

Hosted operator API (BLS based)

PreviousOperator managementNextCustom AVS specification

Last updated 7 months ago

Overview

The AltLayer-hosted operator comes with APIs. With the APIs, AVS only needs to design and implement its business logic. The API will handle the signature signing and submission to the aggregator.

To interact with the API, there are two options

  1. Interact with the managed operator

  2. Interact with the managed operator proxy

The rationale of operator proxy

While direct interaction with the operator provides the most significant degree of flexibility, it is often necessary to construct the parameters, which can be low-level.

Let's use the following example to illustrate it

    function confirmMessage(
        Params1 p1,
        ...
        ParamsN pN,
        NonSignerStakesAndSignature memory nonSignerStakesAndSignature
    ) external whenNotPaused onlyConfirmer {
    ...
    }

The operator API has a parameter called params_raw. This is the abi-encoded bytes of p1....pN. It can be complex to construct the encoded bytes.

Getting the operator and/or operator proxy endpoint and credentials

Go to the operator section and click on the menu button for "Hosted Operator Service".

Click on the "Credentials" link to display the endpoints, username and password. The username and password are required as the operator and operator proxy API have basic access authentication enabled.

Operator API

Request header

  • Content-Type: application/json

  • Authorization: Basic <base64 encoded of admin:password>

Request body

{
  "id": "1",
  "jsonrpc": "2.0",
  "method": "operator_createSigTask",
  "params": [
    {
      "avs_name": "op",
      "method": "tt",
      "params_raw": "0x00",
      "reference_block_number": 1000,
      "quorum_numbers": [
        0
      ],
      "quorum_threshold_percentages": [
        66
      ],
      "sig_hash": "0x0000000000000000000000000000000000000000000000000000000000000000"
    }
  ]
}
  • method: operator_createSigTask. This is the API method and should not be changed

  • params.avs_name: name of the AVS

  • params.method: the smart contract method that handled the contract call from the aggregator e.g respondToTask

  • params.param_raw: the abi-encoded call data. It can be all calldata or a subset of the calldata

  • params.reference_block_number: reference block number for quorum_numbers and quorum_threshold_percentages

  • params.quorum_numbers : quorum number in which operators have signed for

  • params.quorum_threshold_percentages : quorum threshold for the particular quorum number

  • params.sig_hash : the signed hash of param_raw

Sample curl request

Remember to update

  1. basic auth credentials

  2. avs name

  3. method

  4. params

  5. operator endpoint

curl --noproxy '*' \
  -H "Content-Type: application/json" \
  --header 'Authorization: Basic <base64 encoded admin:password>' 
  -d '{
    "id": "1",
    "jsonrpc": "2.0",
    "method": "operator_createSigTask",
    "params": [
      {
        "avs_name": "op",
        "method": "tt",
        "params_raw": "0x00",
        "reference_block_number": 1000,
        "quorum_numbers": [0],
        "quorum_threshold_percentages": [66],
        "sig_hash": "0x0000000000000000000000000000000000000000000000000000000000000000"
      }
    ]
  }' \
  https://your-avs-operator.alt.technology

Operator Proxy API

Request header

  • Content-Type: application/json

  • Authorization: Basic <base64 encoded of admin:password>

Request body

{
    "id": 2,
    "jsonrpc": "2.0",
    "method": "operator_createSigTaskResponse",
    "params": [
        {
            "method": "respondToRequest",
            "task_created_block": 3003011,
            "message": "0x00",
            "task_index": 100,
            "resp_message": "0x0000"
        }
    ]
}
  • method: operator_createSigTaskResponse. This is the API method and should not be changed

  • params.method: the smart contract method that handled the contract call from the aggregator, e.g respondToTask

  • params.task_created_block: the block number in which the task is created

  • params.message: the task message found inside the Task struct

  • params.task_index: the task index in the smart contract

  • params.resp_message: the response message for the task

Sample curl request

Remember to update

  1. basic auth credentials

  2. params

  3. operator proxy endpoint

curl --noproxy '*' -H "Content-Type: application/json" --header 'Authorization: Basic <base64 encoded admin:password>' \
-d '{
    "id": 2,
    "jsonrpc": "2.0",
    "method": "operator_createSigTaskResponse",
    "params": [
        {
            "method": "respondToRequest",
            "task_created_block": 3003011,
            "message": "0x00",
            "task_index": 100,
            "resp_message": "0x0000"
        }
    ]
}' \
https://your-avs.alt.technology

Sample success response

{
    "jsonrpc": "2.0",
    "id": 2,
    "result": {
        "task_index": 1,
        "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "sig_hash": "0x0000000000000000000000000000000000000000000000000000000000000000"
    }
}

The managed operator proxy abstracted away the complexity. It supports any AVS using the . When using the operator proxy API, there is no need to compute param_raw. The AVS builder can focus on providing the actual payload. As such, the API is much simpler and easier to use.

task manager convention