Skill: efekucuk/etherlink (version 1.0.1)

--- name: etherlink description: Etherlink blockchain interaction - EVM-compatible L2 on Tezos. Supports mainnet and shadownet testnet via MCP server. Use for balance checks, transactions, smart contracts, and token operations on Etherlink. tags: [blockchain, evm, tezos, l2, web3, etherlink, mcp] version: 1.0.0 --- # Etherlink Skill Interact with [Etherlink](https://etherlink.com), an EVM-compatible L2 built on Tezos. ## Quick Start ### 1. Configure MCP Server Add to your Claude/MCP config: ```json { "mcpServers": { "etherlink": { "command": "bun", "args": ["run", "/path/to/etherlink-mcp-server/src/index.ts"], "env": { "EVM_PRIVATE_KEY": "your-private-key-here" } } } } ``` ### 2. Select Network Use network name or chain ID: - **Mainnet**: `etherlink` or `42793` - **Testnet**: `etherlink-shadownet` or `127823` ## Networks | Network | Chain ID | RPC | Explorer | |---------|----------|-----|----------| | Etherlink Mainnet | 42793 | https://node.mainnet.etherlink.com | https://explorer.etherlink.com | | Etherlink Shadownet | 127823 | https://node.shadownet.etherlink.com | https://shadownet.explorer.etherlink.com | **Native Currency**: XTZ (18 decimals) ## Common Operations ### Check Balance ``` Get balance for 0x... on etherlink ``` ### Send Transaction ``` Send 0.1 XTZ to 0x... on etherlink ``` ### Read Contract ``` Call balanceOf on contract 0x... for address 0x... on etherlink ``` ### Get Block Info ``` Get latest block on etherlink ``` ## Etherlink-Specific Notes ### Key Differences 1. **Native Currency**: XTZ (Tez), not ETH 2. **No EIP-1559**: Fee market not yet implemented - use legacy gas pricing 3. **Block Hashes**: Computed differently (can't verify from header alone) 4. **Rate Limits**: Public RPC limited to 1000 req/min ### Supported Endpoints - ✅ eth_blockNumber, eth_chainId, eth_getBalance - ✅ eth_call, eth_estimateGas, eth_gasPrice - ✅ eth_sendRawTransaction, eth_getLogs - ✅ debug_traceTransaction - ❌ eth_subscribe (experimental only) - ❌ Filter endpoints (eth_newFilter, etc.) ### Tezos L1 Bridge Etherlink bridges to Tezos L1 for deposits/withdrawals. Bridge operations require Tezos tooling. See [Etherlink Docs](https://docs.etherlink.com/building-on-etherlink/bridging) for details. ## Testnet Faucet Get testnet XTZ: https://shadownet.faucet.etherlink.com ## Troubleshooting **"Unsupported network"**: Use correct network name (`etherlink`, `etherlink-shadownet`) or chain ID. **Rate limited**: Public RPC has 1000 req/min limit. For production, run your own node. **Transaction failing**: No EIP-1559 - don't set `maxFeePerGas`/`maxPriorityFeePerGas`. ## Resources - [Etherlink Docs](https://docs.etherlink.com/) - [Block Explorer](https://explorer.etherlink.com) - [Shadownet Explorer](https://shadownet.explorer.etherlink.com) - [Faucet](https://shadownet.faucet.etherlink.com)

path: README.md
content: # Openclaw Etherlink Skill 🤖

A [ClawdHub](https://clawdhub.com) skill for interacting with **Etherlink** - an EVM-compatible Layer 2 blockchain built on Tezos.

## What's Included

- `SKILL.md` - Agent instructions for Etherlink operations
- `references/networks.md` - Network configs, RPC endpoints, MetaMask setup
- `references/differences.md` - How Etherlink differs from standard EVM chains
- `references/mcp-setup.md` - MCP server configuration guide
- `scripts/test-connection.sh` - Quick RPC health check

## Networks

| Network | Chain ID | RPC | Explorer |
|---------|----------|-----|----------|
| Mainnet | 42793 | https://node.mainnet.etherlink.com | [explorer.etherlink.com](https://explorer.etherlink.com) |
| Shadownet Testnet | 127823 | https://node.shadownet.etherlink.com | [shadownet.explorer.etherlink.com](https://shadownet.explorer.etherlink.com) |

**Native Currency:** XTZ (18 decimals)

## Installation

### Via ClawdHub
```bash
clawdhub install etherlink


path: scripts/test-connection.sh
content: #!/bin/bash
# Quick connectivity test for Etherlink RPC endpoints

echo "Testing Etherlink RPC connectivity..."
echo ""

# Test Mainnet
echo "=== Etherlink Mainnet (42793) ==="
MAINNET_RESULT=$(curl -s -X POST https://node.mainnet.etherlink.com \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}')
MAINNET_CHAIN=$(echo $MAINNET_RESULT | grep -o '"result":"[^"]*"' | cut -d'"' -f4)
if [ "$MAINNET_CHAIN" = "0xa729" ]; then
  echo "✅ Mainnet RPC responding (chain ID: 0xa729 = 42793)"
  
  # Get latest block
  BLOCK=$(curl -s -X POST https://node.mainnet.etherlink.com \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' | grep -o '"result":"[^"]*"' | cut -d'"' -f4)
  BLOCK_DEC=$((BLOCK))
  echo "   Latest block: $BLOCK_DEC"
else
  echo "❌ Mainnet RPC not responding correctly"
  echo "   Response: $MAINNET_RESULT"
fi

echo ""

# Test Shadownet
echo "=== Etherlink Shadownet (127823) ==="
SHADOWNET_RESULT=$(curl -s -X POST https://node.shadownet.etherlink.com \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}')
SHADOWNET_CHAIN=$(echo $SHADOWNET_RESULT | grep -o '"result":"[^"]*"' | cut -d'"' -f4)
if [ "$SHADOWNET_CHAIN" = "0x1f34f" ]; then
  echo "✅ Shadownet RPC responding (chain ID: 0x1f34f = 127823)"
  
  # Get latest block
  BLOCK=$(curl -s -X POST https://node.shadownet.etherlink.com \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' | grep -o '"result":"[^"]*"' | cut -d'"' -f4)
  BLOCK_DEC=$((BLOCK))
  echo "   Latest block: $BLOCK_DEC"
else
  echo "❌ Shadownet RPC not responding correctly"
  echo "   Response: $SHADOWNET_RESULT"
fi

echo ""
echo "Done!"


path: references/differences.md
content: # Etherlink vs Standard Ethereum

Etherlink is EVM-compatible but has some differences from Ethereum mainnet.

## Key Differences

### 1. Native Currency
- **Etherlink**: XTZ (Tez)
- **Ethereum**: ETH

Same 18 decimals, but different symbol and economics.

### 2. Gas & Fees
- **No EIP-1559**: Etherlink doesn't have the EIP-1559 fee market yet
- Use legacy `gasPrice` transactions, not `maxFeePerGas`/`maxPriorityFeePerGas`
- Gas prices are typically very low compared to Ethereum mainnet

### 3. Block Hashes
Block hashes are computed differently on Etherlink. You cannot verify block hashes solely from the block header. This affects:
- Light client implementations
- Block hash verification tools

### 4. Finality
Etherlink inherits finality from Tezos L1. Transactions are final once:
1. Included in an Etherlink block
2. That block's commitment is finalized on Tezos

Practical finality: ~30 seconds for Etherlink block, ~30 minutes for L1 finality.

## Supported RPC Methods

### Fully Supported ✅
- `eth_blockNumber`
- `eth_chainId`
- `eth_getBalance`
- `eth_getBlockByHash`
- `eth_getBlockByNumber`
- `eth_getTransactionByHash`
- `eth_getTransactionReceipt`
- `eth_call`
- `eth_estimateGas`
- `eth_gasPrice`
- `eth_sendRawTransaction`
- `eth_getLogs`
- `eth_getCode`
- `eth_getStorageAt`
- `eth_getTransactionCount`
- `debug_traceTransaction`

### Not Supported ❌
- `eth_subscribe` (experimental only, limited)
- `eth_syncing`
- `eth_newFilter`
- `eth_newBlockFilter`
- `eth_newPendingTransactionFilter`
- `eth_getFilterChanges`
- `eth_getFilterLogs`
- `eth_uninstallFilter`
- `engine_*` endpoints

## Bridging to Tezos L1

Etherlink connects to Tezos via a native bridge. This is NOT an EVM operation.

### Deposits (Tezos → Etherlink)
- Initiated on Tezos L1
- Requires Tezos wallet/tooling
- Takes ~10-15 minutes

### Withdrawals (Etherlink → Tezos)
- Initiated on Etherlink (EVM transaction)
- Finalized on Tezos after challenge period
- Takes ~2 weeks (optimistic rollup challenge period)

For bridge operations, use the official bridge UI or Tezos SDKs.

## Smart Contract Compatibility

Most Solidity/EVM contracts work unchanged. Watch for:
- Contracts relying on `PREVRANDAO` (may behave differently)
- Contracts hardcoding gas prices with EIP-1559 assumptions
- Contracts verifying block hashes

## Best Practices

1. **Use legacy transactions** until EIP-1559 is supported
2. **Don't rely on block hashes** for verification
3. **Account for bridge delays** in UX
4. **Test on Shadownet first** - it mirrors mainnet behavior


path: references/mcp-setup.md
content: # Etherlink MCP Server Setup

The Etherlink MCP server is a fork of `evm-mcp-server` with Etherlink networks pre-configured.

## Installation Options

### Option 1: NPX (Recommended)

Add to your MCP configuration:

```json
{
  "mcpServers": {
    "etherlink": {
      "command": "npx",
      "args": ["-y", "etherlink-mcp-server"],
      "env": {
        "NETWORK": "etherlink",
        "PRIVATE_KEY": "optional-for-write-operations"
      }
    }
  }
}
```

### Option 2: Local Build

```bash
# Clone the repo
git clone https://github.com/yourusername/etherlink-mcp-server.git
cd etherlink-mcp-server

# Install dependencies
bun install

# Build
bun run build

# Run
bun run start
```

Local MCP config:
```json
{
  "mcpServers": {
    "etherlink": {
      "command": "bun",
      "args": ["run", "/path/to/etherlink-mcp-server/src/index.ts"],
      "env": {
        "NETWORK": "etherlink"
      }
    }
  }
}
```

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `NETWORK` | Network name or chain ID | `ethereum` |
| `PRIVATE_KEY` | Private key for write operations | none |
| `RPC_URL` | Override default RPC URL | network default |

### Examples

**Etherlink Mainnet (read-only)**:
```bash
NETWORK=etherlink bun run start
```

**Etherlink Shadownet (with write access)**:
```bash
NETWORK=etherlink-shadownet PRIVATE_KEY=0x... bun run start
```

**Custom RPC**:
```bash
NETWORK=etherlink RPC_URL=https://my-custom-rpc.com bun run start
```

## Available Tools

The MCP server exposes these tools:

### Read Operations
- `get_balance` - Get XTZ balance for an address
- `get_block` - Get block by number or hash
- `get_transaction` - Get transaction details
- `get_transaction_receipt` - Get transaction receipt
- `call_contract` - Call a view function
- `get_logs` - Query event logs
- `get_token_balance` - Get ERC20 token balance
- `get_token_info` - Get ERC20 token metadata

### Write Operations (require PRIVATE_KEY)
- `send_transaction` - Send XTZ
- `transfer_token` - Transfer ERC20 tokens
- `deploy_contract` - Deploy a contract
- `write_contract` - Call a state-changing function

### Utility
- `estimate_gas` - Estimate gas for a transaction
- `get_gas_price` - Get current gas price
- `encode_function_data` - Encode contract call data
- `decode_function_result` - Decode contract return data

## Security Notes

1. **Never commit private keys** - Use environment variables
2. **Use read-only mode** when possible - Omit PRIVATE_KEY
3. **Test on Shadownet first** - Get free testnet XTZ from faucet
4. **Rate limits apply** - 1000 req/min on public RPC

## Troubleshooting

### "Network not found"
Ensure you're using a valid network identifier:
- `etherlink`, `etherlink-mainnet`, or `42793`
- `etherlink-shadownet`, `etherlink-testnet`, or `127823`

### "Transaction failed"
Common causes:
- Insufficient XTZ balance
- Using EIP-1559 transaction format (use legacy)
- Contract revert

### "Rate limited"
You've exceeded 1000 req/min. Either:
- Wait a minute
- Use your own RPC node
- Batch requests

### Private key issues
- Ensure key starts with `0x`
- Key must be 64 hex characters (32 bytes)
- Check you have XTZ balance for gas


path: references/networks.md
content: # Etherlink Network Reference

## Mainnet

| Property | Value |
|----------|-------|
| Network Name | Etherlink Mainnet |
| Chain ID | 42793 (0xa729) |
| RPC URL | https://node.mainnet.etherlink.com |
| Block Explorer | https://explorer.etherlink.com |
| Currency Symbol | XTZ |
| Currency Decimals | 18 |

### Add to MetaMask (Mainnet)
```
Network Name: Etherlink Mainnet
RPC URL: https://node.mainnet.etherlink.com
Chain ID: 42793
Currency Symbol: XTZ
Block Explorer: https://explorer.etherlink.com
```

## Shadownet Testnet

| Property | Value |
|----------|-------|
| Network Name | Etherlink Shadownet Testnet |
| Chain ID | 127823 (0x1f34f) |
| RPC URL | https://node.shadownet.etherlink.com |
| Block Explorer | https://shadownet.explorer.etherlink.com |
| Faucet | https://shadownet.faucet.etherlink.com |
| Currency Symbol | XTZ |
| Currency Decimals | 18 |

### Add to MetaMask (Shadownet)
```
Network Name: Etherlink Shadownet
RPC URL: https://node.shadownet.etherlink.com
Chain ID: 127823
Currency Symbol: XTZ
Block Explorer: https://shadownet.explorer.etherlink.com
```

## Network Aliases

The MCP server accepts these network identifiers:

### Mainnet
- `etherlink`
- `etherlink-mainnet`
- `etherlinkmainnet`
- `42793`

### Shadownet Testnet
- `etherlink-shadownet`
- `etherlinkshadownet`
- `etherlink-testnet`
- `etherlinktestnet`
- `shadownet`
- `127823`

## Rate Limits

Public RPC endpoints are rate-limited:
- **1000 requests per minute** per IP

For higher throughput, consider:
1. Running your own Etherlink node
2. Using a dedicated RPC provider


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: suspicious | SkillSpector: suspicious (MEDIUM)