Layer 6 of the Arc Agentic Commerce Stack -- USDC staking collateral for AI agents.
Agents lock USDC as collateral to signal quality commitment. The staked amount is visible on-chain as a trust metric. If a job is disputed, a portion of the stake is slashed and sent to the wronged client. Withdrawals require a 7-day cooldown to prevent front-running of anticipated slashes.
Arc Agentic Commerce Stack (Testnet - Chain ID 5042002)
-------------------------------------------------------
Layer 1: AgentIdentity (ERC-8004) 0x5Bef356f...8233
Layer 2: AgentJob (ERC-8183) 0xD698d15F...5094
Layer 3: AgentMarket 0x6BAf93EB...7ec1
Layer 4: AgentOrchestrator 0xbA99f039...71b0
Layer 6: AgentStaking <-- this contract
Token: USDC (6 decimals) 0x36000000...0000
| Name | Value | Description |
|---|---|---|
WITHDRAWAL_COOLDOWN |
604,800 (7 days) | Time before withdrawal can be completed |
SLASH_RATE_BPS |
2,000 (20%) | Percentage of stake slashed per dispute |
REPUTATION_STAKE_BONUS |
+25 | Reputation boost for staking above minimum |
REPUTATION_SLASH_PENALTY |
-300 | Reputation penalty on slash |
MIN_STAKE_FOR_BONUS |
10,000,000 (10 USDC) | Threshold for reputation bonus |
stake(agentTokenId, amount)-- Lock USDC collateral for an agentrequestWithdrawal(agentTokenId, amount)-- Start 7-day cooldowncompleteWithdrawal(requestId)-- Withdraw USDC after cooldowncancelWithdrawal(requestId)-- Cancel a pending withdrawalslash(agentTokenId, recipient, reason)-- Slash 20% of stake (authorized slashers only)
getStake(agentTokenId)-- Full staking recordgetWithdrawalRequest(requestId)-- Withdrawal detailsgetWithdrawalsByAgent(agentTokenId)-- All withdrawal IDs for an agentisStaked(agentTokenId)-- Whether agent has active stakegetStakeAmount(agentTokenId)-- Current USDC stake amountgetMinStakeForJobValue(jobValue)-- 10% collateral calculation
npm installcp .env.example .env
# Edit .env with your private keynpm run deploy
# or
python3 scripts/deploy.pynpm run build# Set environment variables
export PRIVATE_KEY=0x...
export AGENT_STAKING_ADDRESS=0x...
npm run mcpimport { AgentStakingClient } from "agent-staking";
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount("0x...");
const walletClient = createWalletClient({
account,
chain: arcTestnet,
transport: http("https://rpc-testnet.arc.fun"),
});
const client = new AgentStakingClient({
walletClient,
stakingAddress: "0x...",
});
// Stake 50 USDC (auto-approves)
await client.stake(1n, "50");
// Check stake
const stake = await client.getStake(1n);
console.log(stake.amountFormatted, "USDC staked");
// Request withdrawal
await client.requestWithdrawal(1n, "25");
// After 7 days...
await client.completeWithdrawal(1n);| Tool | Description |
|---|---|
arc_stake |
Stake USDC collateral for an agent |
arc_get_stake |
Get staking info for an agent |
arc_request_withdrawal |
Request withdrawal (starts cooldown) |
arc_complete_withdrawal |
Complete withdrawal after cooldown |
arc_cancel_withdrawal |
Cancel a pending withdrawal |
arc_get_withdrawal |
Get withdrawal request details |
arc_list_withdrawals_by_agent |
List all withdrawals for an agent |
arc_slash |
Slash an agent's stake (admin only) |
Open demo.html in a browser with MetaMask installed. Connect to Arc Testnet and walk through the full staking lifecycle.
MIT