βββ ββββββββββ βββ βββ ββββ βββ βββ βββββββ
βββ βββ βββ βββ βββ ββββββ βββ βββ βββ βββ
ββββββββββ βββ ββββββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ
ββββ βββ βββ ββββββββββ βββ βββ βββ βββ ββββββββββ βββ βββ βββββββββ
ββββ ββββββββ βββ βββ βββ βββ βββ βββ βββ βββ βββ βββ
ββββ βββ βββ βββ βββ ββββ βββ βββ βββ βββ ββββββ βββ βββ
ββββββββββ βββ ββββββ βββββββββ βββ βββ βββ βββ ββββ βββββββ
Automated validator bot for zkPull protocol using AVS (Actively Validated Service) by EigenLayer.
The operator bot automatically:
- Listens for new validation tasks
- Verifies GitHub PR merge status using zkTLS
- Submits validation results to the AVS contract
- Earns rewards for successful validations
- Node.js >= 16.0.0
- Mantle USD tokens for stake
- zkTLS API access (optional, has fallback)
cd operator
npm install- Copy
.env.exampleto.env:
cp .env.example .env- Fill in your configuration:
MANTLE_SEPOLIA_RPC_URL=https://rpc.sepolia.mantle.xyz
OPERATOR_PRIVATE_KEY=0x...
AVS_CONTRACT_ADDRESS=0x...
OPERATOR_ENDPOINT=https://your-operator.com
STAKE_AMOUNT=0.1
ZKTLS_API_URL=https://api.zktls.io
ZKTLS_API_KEY=your_api_key_herenpm run registerThis will:
- Register your address as an operator
- Stake the specified amount of MNT
- Set your endpoint URL
npm startThe bot will:
- Listen for new validation tasks
- Automatically pick up and process tasks
- Submit validation results
- Run continuously until stopped (Ctrl+C)
npm run deregisterThis will:
- Deregister your operator
- Return your staked MNT
1. New Claim Submitted
β
2. AVS Creates Task
β
3. Bot Picks Up Task
β
4. Bot Verifies PR with zkTLS
β
5. Bot Submits Validation
β
6. AVS Executes Validation on IssuesClaim
β
7. Developer Receives Reward (if valid)
-
zkTLS Verification (Primary):
- Calls zkTLS API to verify PR merge status
- Generates cryptographic proof
- Submits proof with validation
-
Fallback Verification:
- If zkTLS API fails, uses GitHub API directly
- Less secure but ensures system availability
- Marked as fallback in proof data
The bot logs all activities:
π Starting zkTLS Operator Bot...
π Operator Address: 0x...
π AVS Contract: 0x...
β
Bot started successfully!
π Listening for new tasks...
π¬ New task created: #1
Issue: 0, Claim: 0
π― Attempting to pick task #1...
β
Task #1 picked successfully
π Processing task #1...
PR Link: https://github.com/user/repo/pull/123
Developer: 0x...
π Verifying with zkTLS...
Validation Result: β
VALID
π€ Submitting validation...
β³ Waiting for confirmation...
β
Validation submitted (tx: 0x...)
β
Task #1 completed
Operators earn rewards through:
- Task completion fees
- Staking rewards
- Protocol incentives
Operators can be slashed for:
- Submitting false validations
- Being offline for extended periods
- Malicious behavior
# Check if registered
node -e "
const { ethers } = require('ethers');
const provider = new ethers.providers.JsonRpcProvider(process.env.MANTLE_SEPOLIA_RPC_URL);
const wallet = new ethers.Wallet(process.env.OPERATOR_PRIVATE_KEY, provider);
console.log('Operator Address:', wallet.address);
"- Check if other operators are faster
- Increase poll interval
- Check network connectivity
- Verify AVS contract address
- Check zkTLS API key
- Verify GitHub PR link format
- Check network connectivity
- Review bot logs for errors
node operator.jsnode -e "
const bot = require('./operator.js');
const instance = new bot.ZKTLSOperatorBot();
instance.verifyPRWithZKTLS('https://github.com/user/repo/pull/123')
.then(result => console.log(result));
"# Install PM2
npm install -g pm2
# Start bot
pm2 start operator.js --name zkpull-operator
# Monitor
pm2 logs zkpull-operator
# Auto-restart on reboot
pm2 startup
pm2 save# Build image
docker build -t zkpull-operator .
# Run container
docker run -d \
--name zkpull-operator \
--env-file .env \
--restart unless-stopped \
zkpull-operator# Create service file
sudo nano /etc/systemd/system/zkpull-operator.service
# Add:
[Unit]
Description=zkPull Operator Bot
After=network.target
[Service]
Type=simple
User=your-user
WorkingDirectory=/path/to/operator
ExecStart=/usr/bin/node operator.js
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
# Enable and start
sudo systemctl enable zkpull-operator
sudo systemctl start zkpull-operator
sudo systemctl status zkpull-operator-
Private Key Security:
- Never commit private keys
- Use hardware wallets for production
- Rotate keys regularly
-
API Keys:
- Keep zkTLS API keys secure
- Use environment variables
- Rotate keys periodically
-
Network Security:
- Use HTTPS for all endpoints
- Implement rate limiting
- Monitor for suspicious activity
-
Monitoring:
- Set up alerts for failures
- Monitor stake balance
- Track validation success rate
MIT