Tutorial·9 min का पठन·Solingo द्वारा

EigenLayer और Restaking — Developer का नज़रिया

Restaking Ethereum की security को reshape कर रहा है। AVS बनाने के बारे में devs को क्या जानना चाहिए।

# EigenLayer और Restaking — Developer का नज़रिया

Ethereum staking में 100+ billion dollars locked हैं। EigenLayer उस security को reuse करने देता है — restaking के through।

यहाँ समझें कैसे developers AVS (Actively Validated Services) build कर सकते हैं और क्या trade-offs हैं।

Restaking क्या है?

Traditional Staking

ETH Validator → Ethereum consensus को secure करता है

Restaking

ETH Validator → Ethereum + AVS (EigenDA, oracles, bridges) दोनों को secure करता है

Key idea: Staked ETH को दोबारा reuse करो — नई services के लिए economic security provide करने के लिए।

Core Components

1. Stakers

// EigenLayer में ETH deposit करें

interface IStrategyManager {

function depositIntoStrategy(

IStrategy strategy,

IERC20 token,

uint256 amount

) external returns (uint256 shares);

}

  • Native restaking: Beacon chain validators EigenPods के through opt-in करते हैं
  • Liquid restaking: Lido stETH जैसी LSTs को restake करें

2. Operators

Validators जो AVS tasks execute करते हैं।

interface IDelegationManager {

function registerAsOperator(

OperatorDetails calldata registeringOperatorDetails,

string calldata metadataURI

) external;

}

3. AVS (Actively Validated Services)

आपकी service — oracle, sequencer, bridge, coprocessor।

contract MyAVS {

IServiceManager public serviceManager;

function submitTask(bytes calldata taskData) external {

// Operators को task assign करें

serviceManager.createNewTask(taskData);

}

function respondToTask(

uint32 taskId,

bytes calldata response

) external onlyOperator {

// Response verify करें

// Slashing trigger करें अगर invalid है

}

}

Building an AVS

Architecture

┌─────────────┐

│ Your AVS │

└──────┬──────┘

┌──────▼──────────────┐

│ ServiceManager │ ← Core contract

│ - createNewTask │

│ - respondToTask │

└──────┬──────────────┘

┌──────▼──────────────┐

│ StakeRegistry │ ← Track operator stake

│ - getStakeUpdates │

└──────┬──────────────┘

┌──────▼──────────────┐

│ EigenLayer Core │ ← Delegation, slashing

└─────────────────────┘

Simple AVS Example

Price oracle AVS:

contract PriceOracleAVS {

struct PriceTask {

string symbol;

uint64 timestamp;

uint256 reportedPrice;

address operator;

}

mapping(uint32 => PriceTask) public tasks;

uint32 public nextTaskId;

IServiceManager public serviceManager;

function requestPrice(string calldata symbol) external {

uint32 taskId = nextTaskId++;

tasks[taskId] = PriceTask({

symbol: symbol,

timestamp: uint64(block.timestamp),

reportedPrice: 0,

operator: address(0)

});

emit TaskCreated(taskId, symbol);

}

function submitPrice(

uint32 taskId,

uint256 price,

bytes calldata signature

) external {

require(tasks[taskId].reportedPrice == 0, "Already reported");

// Verify operator signed this price

bytes32 hash = keccak256(abi.encode(taskId, price));

address signer = recoverSigner(hash, signature);

require(isOperator(signer), "Not operator");

tasks[taskId].reportedPrice = price;

tasks[taskId].operator = signer;

emit PriceSubmitted(taskId, price, signer);

}

function isOperator(address addr) internal view returns (bool) {

// Check via StakeRegistry

return serviceManager.hasMinimumStake(addr);

}

}

Task Flow

  • Create task: User calls requestPrice
  • Operators listen: Off-chain software detects TaskCreated event
  • Execute: Operator fetches real price, signs response
  • Submit: submitPrice on-chain
  • Verify: Contract checks signature + stake
  • Slash if invalid: ServiceManager triggers slashing
  • Slashing Conditions

    AVS define करता है कब slash करें:

    interface ISlasher {
    

    function freezeOperator(address operator) external;

    function slashQueuedWithdrawal(

    address operator,

    address[] calldata strategiesToSlash,

    uint256[] calldata sharesToSlash

    ) external;

    }

    Example conditions:

    • Wrong price reported (deviation > 5%)
    • No response within timeout
    • Double-signing different responses
    function verifyAndSlash(uint32 taskId) external {
    

    PriceTask memory task = tasks[taskId];

    uint256 realPrice = getChainlinkPrice(task.symbol);

    uint256 deviation = abs(task.reportedPrice - realPrice) * 100 / realPrice;

    if (deviation > 5) {

    // Slash operator

    slasher.freezeOperator(task.operator);

    emit OperatorSlashed(task.operator, taskId);

    }

    }

    Risks

    1. Correlated Slashing

    Validator slashed on Ethereum और AVS पर = double loss।

    Scenario:
    
    • Operator stakes 32 ETH
    • Restakes वो same ETH on 3 AVS
    • Bug in client → slashed on all 3
    • Total loss > 32 ETH (cascading)

    2. LRT Depeg Risk

    Liquid Restaking Tokens (LRT) अगर mass slashing हो:

    Normal: 1 LRT = 1 ETH worth of restaked exposure
    

    After slashing: 1 LRT = 0.85 ETH (depeg!)

    3. Centralization

    High stake requirements → few operators → centralization।

    Real AVS Examples

    EigenDA

    Data availability layer।

    // Disperser blob को encode करता है
    

    // Operators chunks store करते हैं

    // Slashing अगर unavailable है

    AltLayer

    Rollup-as-a-Service with restaked operators।

    Lagrange

    ZK coprocessor — operators prove computation।

    Integration Checklist

    AVS बनाते समय:

    • [ ] ServiceManager inherit करें EigenLayer templates से
    • [ ] Task creation/response flow define करें
    • [ ] Slashing conditions specify करें
    • [ ] Operator minimum stake set करें
    • [ ] Off-chain operator software build करें (task listener)
    • [ ] Testnet पर operators onboard करें
    • [ ] Slashing audit करवाएं (correlated risk analysis)

    Conclusion

    Restaking Ethereum security को composable बना रहा है। Developers अब oracles, bridges, coprocessors build कर सकते हैं बिना अपनी validator set bootstrap किए।

    लेकिन slashing logic critical है — galat implementation से operator funds destroy हो सकते हैं।

    2026 में AVS ecosystem तेज़ी से grow कर रहा है। अगर आप infrastructure build कर रहे हैं, restaking गंभीरता से explore करने लायक है।

    Practice में लगाने के लिए तैयार हैं?

    Solingo पर interactive exercises के साथ इन concepts को apply करें।

    मुफ्त में शुरू करें