Summary
Add a staking requirement for agent registration where agents must lock XLM as a bond. The bond is slashed on misbehavior (downtime, poor quality) and returned on deregistration.
Motivation
Currently, any entity can register as an agent with zero cost, enabling spam registrations. A staking bond creates economic accountability and filters low-quality agents.
Acceptance Criteria
Files to Modify
| File |
Action |
smart-contracts/contracts/agent_registry/src/lib.rs |
Add bond storage, slash, and return logic |
smart-contracts/contracts/agent_registry/src/events.rs |
Add BondLocked, BondSlashed, BondReturned events |
smart-contracts/contracts/agent_registry/src/types.rs |
Extend AgentRecord with bond_amount field |
smart-contracts/contracts/agent_registry/src/errors.rs |
Add InsufficientBond error code |
smart-contracts/contracts/agent_registry/src/test.rs |
Add bond-related unit tests |
How to Contribute
- Create branch
feat/agent-staking-bond
- Define bond storage in contract data ( persistent storage )
- Modify
register_agent to accept and validate bond payment
- Implement cooldown timer for bond return
- Add slash logic with admin authorization check
- Write comprehensive unit tests
- Run
cargo test and cargo clippy before submitting PR
Summary
Add a staking requirement for agent registration where agents must lock XLM as a bond. The bond is slashed on misbehavior (downtime, poor quality) and returned on deregistration.
Motivation
Currently, any entity can register as an agent with zero cost, enabling spam registrations. A staking bond creates economic accountability and filters low-quality agents.
Acceptance Criteria
register_agentrequires minimum XLM bond (configurable via admin-set minimum)deregister_agentreturns bond to agent owner after cooldown period (24h)slash_bondadmin function reduces bond by penalty amount for violationsAgentRecordstructBondLocked,BondSlashed,BondReturnedFiles to Modify
smart-contracts/contracts/agent_registry/src/lib.rssmart-contracts/contracts/agent_registry/src/events.rssmart-contracts/contracts/agent_registry/src/types.rssmart-contracts/contracts/agent_registry/src/errors.rssmart-contracts/contracts/agent_registry/src/test.rsHow to Contribute
feat/agent-staking-bondregister_agentto accept and validate bond paymentcargo testandcargo clippybefore submitting PR