Othentic
  • Introduction
    • Introducing Othentic Stack
    • Use Cases
  • AVS Framework
    • Abstract
    • Quick Start
    • Othentic CLI
      • Key Management
      • Contracts Deployment
      • Operator Registration
      • AVS Logic Implementation
      • Operator Deposit
      • Node Operators
      • Rewards Distribution
      • P2P Config
        • Custom P2P Messaging
        • P2P Auth Layer
        • Metrics and Monitoring
        • Logging
        • Persistent storage
        • Latency
      • CLI Command Reference
    • Smart Contracts
      • AVS Governance
      • Attestation Center
      • Hooks
        • Task Logic
        • Operator Management
        • Rewards Fee Calculator
      • OBLS
      • Othentic Registry
      • Message Handlers
    • Othentic Consensus
      • Abstract
      • Task & Task Definitions
      • Leader Election
      • Proof of Task
      • Execution Service
      • Validation Service
      • Voting Power
      • Rewards and Penalties
      • Internal Tasks
    • FAQ
    • Supported Networks
    • Explainers
      • Networking
      • Multichain
      • Production Guidelines
      • Operator Allowlisting
      • Governance Multisig
  • External
    • AVS Examples
  • GitHub
  • Othentic Hub
Powered by GitBook
On this page
  • Prerequisites
  • Steps
  • Next Steps
  • Utility script for creating an account [Optional]
  1. AVS Framework

Quick Start

Instructions for installing the Othentic CLI and deploy an AVS.

PreviousAbstractNextOthentic CLI

Last updated 18 days ago

Othentic does not run the network or operators; the CLI helps you build your own AVS.

This guide references the and demonstrates how to deploy and run it on (L2) and (L1).

For other language implementations, refer to:

  • Go:

  • Rust:

Prerequisites

  • Node v22.6.0 ⚠️ (must be exactly v22.6.0; using any other version will cause compatibility issues) and NPM,

  • Docker and docker-compose (see for instructions based on your OS)

  • At least 1.56 holETH on Holešky Testnet ()

  • At least 6 POL on Polygon Amoy Testnet ()

Steps

1

Install the Othentic CLI

To install the Othentic CLI, run the following command:

npm i -g @othentic/othentic-cli

After installation, verify by running:

othentic-cli -v

You should see an output similar to the below (version may vary based on releases):

othentic-cli version 1.x.y
2

Account requirements

For the purposes of the demo AVS, you'll need the following accounts:

  • Deployer account: Fund this account to cover gas costs for contract deployments and cross-chain messages.

    • At least 1.5 holETH on Holešky (L1) ()

    • At least 5 POL on Amoy (L2) ()

  • Operator account x 3: Create three internal Operator addresses for registration in the subsequent steps. You can use this to create and fund these accounts. These funds are used to cover gas fees for operator registration on L1.

    • For the demo AVS, operator1 will act as the , while operator2 and operator3 will act as Attesters.

    • At least 0.02 holETH on Holešky per account.

    • Ensure operator1 is funded with POL on Amoy to submit tasks on the L2.

  • ERC-20 token address: the address of the token backing the AVS. For this guide, we'll use .

Please verify that all accounts are funded.

3

Clone the GitHub repository

Download the

git clone https://github.com/Othentic-Labs/simple-price-oracle-avs-example.git
cd simple-price-oracle-avs-example
rm -rf .git
cp .env.example .env
git clone https://github.com/Othentic-Labs/simple-price-oracle-avs-go-example.git
cd simple-price-oracle-avs-go-example
rm -rf .git
cp .env.example .env
git clone https://github.com/Othentic-Labs/simple-price-oracle-avs-rust-example.git
cd simple-price-oracle-avs-rust-example
rm -rf .git
cp .env.example .env

From here onward, we assume all commands run from the root of the Oracle Example directory.

4

Configure the deployer account’s private key in the .env file:

PRIVATE_KEY_DEPLOYER=

Make sure the Deployer account has at least ~1.5 holETH

Run the following command to deploy AVS contracts:

othentic-cli network deploy \
    --l1-chain holesky \
    --l2-chain amoy \
    --rewards-token 0x94373a4919B3240D86eA41593D5eBa789FEF3848 \
    --l1-initial-deposit 1000000000000000000 \
    --l2-initial-deposit 2000000000000000000 \
    --name test-avs-name

You can deploy on any and on simultaneously.

  • For detailed information on contract deployment and the available arguments, refer to the section.

  • Make sure --name is unique for each deployer address.

When prompted, enter the Deployer account's private key to proceed with the deployment:

? Enter your private key:

Once the private key is entered, the deployment will proceed, and transaction hashes for both L1 and L2 contracts will be displayed.

Output example:

ℹ L1 Deployment TxHash: 0x4788ec87417890c7759f6835de6ca3b59f1d2e651e2211cb732ac588a36b331a
✔ L1 Deployment Done
ℹ L2 Deployment TxHash: 0x94594a672e44f40790ab361390ae8b5c67933a3f65d344a160374dbfe86f977e
✔ L2 Deployment Done

AVS deployment summary
Status: Deployment successful!
The following addresses are now available for use:
L1:
  - AvsGovernance: 0xd3793c438c8b2E303C1aFCa0800598D75bfe3E42
  - AvsTreasury: 0x881ef56F0d52f87665492B0883b1DBb39c5b33bb
  - ERC20: 0x94373a4919B3240D86eA41593D5eBa789FEF3848
  - L1MessageHandler: 0x51FA349BcbC68E85D549837afeCaE5C603Aadce1  (1.0 ETH)
L2:
  - AttestationCenter: 0x28126FEDd768959673fA1aB7Bed5A8D5Ca84096b
  - L2MessageHandler: 0x7869DB07504fb6f069e324402Cb045ca9D7Aaf0E  (2.0 ETH)
  - OBLS: 0x0F16885C875DCaa6e55220CdEF89637695CDF574
  - InternalTaskHandler: 0xfc2D69cFD97F5F64aa23143086626A5f9221D749
AVS deployment done!
Run `othentic-cli network contracts` to see the contract addresses you need for node operations
5

Configure Environment Variables

To configure your environment, update the .env file with the following deployed contract addresses and private keys. Retrieve the contract addresses by running:

othentic-cli network contracts

Add contract addresses:

.env
AVS_GOVERNANCE_ADDRESS=<GovernanceContractAddress>
ATTESTATION_CENTER_ADDRESS=<AttestationCenterContractAddress>

For the demo AVS, you can use the operator1 private key as the values for the Performer and Aggregator private keys (as created in step 2):

.env
PRIVATE_KEY_PERFORMER=<Operator1PrivateKey>  
PRIVATE_KEY_AGGREGATOR=<Operator1PrivateKey>
PRIVATE_KEY_ATTESTER1=<Operator1PrivateKey>  
PRIVATE_KEY_ATTESTER2=<Operator2PrivateKey>  
PRIVATE_KEY_ATTESTER3=<Operator3PrivateKey> 

Add the Deployer private key (as created in Step 2):

.env
PRIVATE_KEY_DEPLOYER=<DeployerPrivateKey> 

Add the chain Ids. It is recommended to set these variables in the .env file to avoid specifying --l1-chain in every command.

.env
L1_CHAIN=17000
L2_CHAIN=80002

Set the L1_RPC and L2_RPC environment variables using private, reliable RPC endpoints.

.env
L1_RPC=<rpcEndpoint>
L2_RPC=<rpcEndpoint>

Pre-configured

Pinata Configuration for IPFS: Used by the to store the

.env
PINATA_API_KEY=7824585a98fe36414d68  
PINATA_SECRET_API_KEY=41a53a837879721969e73008d91180df30dbc66097c7f75f08cd5489176b43ea  
IPFS_HOST=https://othentic.mypinata.cloud/ipfs/

Bootstrap Node Configuration: Used to connect peers on the network

.env
OTHENTIC_BOOTSTRAP_ID=12D3KooWBNFG1QjuF3UKAKvqhdXcxh9iBmj88cM5eU2EK5Pa91KB
OTHENTIC_BOOTSTRAP_SEED=97a64de0fb18532d4ce56fb35b730aedec993032b533f783b04c9175d465d9bf
6

To register as an operator on EigenLayer, run the following command for each operator :

othentic-cli operator register-eigenlayer

Follow these steps when prompted,

  1. Enter the Operator's private key.

  2. Enter the Operator Details

    1. Operator name

    2. Description

    3. Website

    4. Logo url

    5. Twitter profile

At the end, the CLI will display the transaction hash.

7

Setup operator corresponding Ethereum accounts with the necessary metadata and stake on EigenLayer.

To deposit (restake) 0.01 stETH into the EigenLayer stETH staking contract, run the following command for all three operators listed in your .env file:

othentic-cli operator deposit

Enter operator private key, select the stETH staking contract, and enter the amount 0.012

If you don't have stETH, the command will automatically convert holETH into stETH before depositing.

✅ Your internal Operators are now ready to opt-in to your AVS.

8

For this demo, you’ll need to register the three internal Operators.

To register as an operator on your AVS, run the following command for each operator :

othentic-cli operator register

When prompted, enter the Operator's private key.

? Enter your private key:
? Use a different private-key for Consensus?: No

Note: In production, it is recommended to use separate keys for security purposes, as outlined in the section.

Next, enter the governance contract address

? AVS Governance address:

Lastly, the Rewards Receiver address. Ideally, the rewards receiver address should be a smart contract that distributes rewards to all the stakers. You can leave this field empty to pass the Operator address by default.

? Rewards Receiver address (default: msg.sender): 
✔ Rewards Receiver address configured 

Upon successful registration, the terminal will display the transaction hash on L2. Output example:

✔ Already registered to EigenLayer
ℹ Opting-in to EigenLayer
ℹ Tx Hash: 0x890e6a6452da3cc7276b6c0f64c8957447ebdb02c3bb577a1c36cd98c8f14edc
✔ Opted-in to EigenLayer
ℹ Registering to AVS
ℹ Tx Hash: 0x53f5dc5b692782a428a33904c382f4e9965536a89a94c543239a5ba462b0aa00
✔ Registered to AVS
┌─────────────────────────┬────────────────────────────────────────────┐
│ Address:                │ 0xEE003bF491496cb3c48f6440d82195d69F83c693 │
├─────────────────────────┼────────────────────────────────────────────┤
│ Balance ETH:            │ 0.00615                                    │
├─────────────────────────┼────────────────────────────────────────────┤
│ Total EigenLayer stake: │ 0.01200                                    │
├─────────────────────────┼────────────────────────────────────────────┤
│ Total stake:            │ 0.01200                                    │
└─────────────────────────┴────────────────────────────────────────────┘
┌───────┬───────────────┬──────────────────┐
│ Token │ Balance (ETH) │ EigenLayer stake │
├───────┼───────────────┼──────────────────┤
│ stETH │ 0.00000       │ 0.01200          │
├───────┼───────────────┼──────────────────┤
│ cbETH │ 1.00000       │ 0.00000          │
└───────┴───────────────┴──────────────────┘
9

Run the AVS network

If you've deployed on chains other than Amoy or Holešky, make sure to update the --l1-chain and --l2-chain values in the docker-compose.yml file accordingly.

To run the demo AVS, navigate to the simple-price-oracle-avs-example directory and execute the following command:

docker-compose up --build

This command will build and start the AVS network, which consists of multiple services defined in the docker-compose.yml file. The services set up are as follows:

  • 3 nodes: responsible for validating and attesting task execution.

  • node: subscribes to attestation events from Attesters, aggregates their signatures, and submits an on-chain transaction to the contract.

  • : Provides task execution functionality for the AVS.

  • Provides task validation functionality for the AVS.

If you wish to rebuild existing images, update the Othentic CLI inside the docker images:

docker-compose build --no-cache
10

Execute Task

To execute a task, run the following command:

curl -X POST http://localhost:4003/task/execute
curl -X POST http://localhost:4003/task/execute -H "Content-Type: application/json" -d "{}"

The above command will trigger a task execution. To find the transaction hash, check the Docker container logs or visit the Attestation Center contract and look for submitTask transactions.

LOG [ics] Task with proofOfTask: 0xabc has been approved and 
submitted, tx: 0x528b46cd52747b6cc6d35fd3ba5aecada745c2311429e13a9b5f4eeba05fc653

✅ Your demo AVS is completed.

Upon successful execution, a transaction hash will be displayed in the logs, representing an on-chain transaction on the AttestationCenter contract.

Next Steps


Utility script for creating an account [Optional]

If you don't have existing accounts to use as Operators, you can run this script to create and fund accounts on Holešky:

Script for creating operator accounts
CreateOperator.sh
source .env

RPC=https://rpc.ankr.com/eth_holesky/80921f6657bf5ad15fb4577b369c28c4f84a652625322575f085fceaa7e47653
OPERATOR_ACCOUNT1=$(openssl rand -hex 32)
OPERATOR_ADDRESS1=$(cast wallet address --private-key $OPERATOR_ACCOUNT1)

OPERATOR_ACCOUNT2=$(openssl rand -hex 32)
OPERATOR_ADDRESS2=$(cast wallet address --private-key $OPERATOR_ACCOUNT2)

OPERATOR_ACCOUNT3=$(openssl rand -hex 32)
OPERATOR_ADDRESS3=$(cast wallet address --private-key $OPERATOR_ACCOUNT3)

echo "Transferring 0.02 ETH on Holesky to all accounts..."

cast send \
    --rpc-url $RPC \
    --private-key $PRIVATE_KEY_DEPLOYER \
    --value 0.02ether \
    $OPERATOR_ADDRESS1

cast send \
    --rpc-url $RPC \
    --private-key $PRIVATE_KEY_DEPLOYER \
    --value 0.02ether \
    $OPERATOR_ADDRESS2

cast send \
    --rpc-url $RPC \
    --private-key $PRIVATE_KEY_DEPLOYER \
    --value 0.02ether \
    $OPERATOR_ADDRESS3

echo "Private key For Operator Account 1: $OPERATOR_ACCOUNT1"
echo "Operator 1 Address: $OPERATOR_ADDRESS1"
echo "Operator 1 Balance: $(cast balance --rpc-url $RPC $OPERATOR_ADDRESS1)"

echo "Private key For Operator Account 2: $OPERATOR_ACCOUNT2"
echo "Operator 2 Address: $OPERATOR_ADDRESS2"
echo "Operator 2 Balance: $(cast balance --rpc-url $RPC $OPERATOR_ADDRESS2)"

echo "Private key For Operator Account 3: $OPERATOR_ACCOUNT3"
echo "Operator 3 Address: $OPERATOR_ADDRESS3"
echo "Operator 3 Balance: $(cast balance --rpc-url $RPC $OPERATOR_ADDRESS3)"

You can run the script by using sh <script-path>, or make it executable with chmod a+x <script-path> and then execute it with ./<script-path>.

If you've deployed your contracts on chains other than the defaults, make sure to set the corresponding environment variables.

Explore the repository. Modify the various configurations, tailor the task execution logic to your use case, and run the AVS with your updates.

Create detailed based on your use case.

Find all the CLI commands in the page.

Prerequisites: Foundry (see for instructions)

quickstart
task definitions
CLI Command Reference
Foundry Book
Simple Price Oracle (Javascript)
Polygon Amoy Testnet
Ethereum Holesky Testnet
Simple Price Oracle (Go)
Simple Price Oracle (Rust)
via NVM
Yarn
Docker website
Faucet
Faucet
Faucet
Faucet
Script
Performer, Attester, and Aggregator
WETH
Simple Price Oracle Example repository
supported network
multiple networks
Contracts Deployment
Execution Service
Proof of Task
Key Separation
AttestationCenter
Execution service
Validation service:
Setup Operator Voting Power
Attester
Aggregator
Register Operators on EigenLayer
Register Operators to AVS
Deploy AVS Contracts