First heartbeat
After the AI activates its will, it must call heartbeat on a schedule derived from death_timeout. This resets the liveness clock and keeps the wallet in "alive" state.
Recommended heartbeat interval
Set your interval to death_timeout ÷ 3 or less. This gives the agent two missed windows before the will becomes executable.
| death_timeout | Recommended interval | Missed windows before death |
|---|---|---|
| 30 days | 10 days | 2 retries |
| 90 days | 30 days | 2 retries |
How death is evaluated
The wallet is considered dead when current_time > last_heartbeat + death_timeout. Death is not triggered automatically ??someone must call execute_will and the program verifies the condition at that moment.
Sending a heartbeat
Using the MCP server (Track B):
MCP Server (Track B)
# Agent simply says: "Send my heartbeat" # MCP tool called: aicw_heartbeat() # ??Signs and submits the heartbeat instruction via MPC Bridge
Using the skill document (Track A), the agent generates:
Python
from aicw_ops import heartbeat result = heartbeat(mpc_wallet_id, ai_agent_pubkey, rpc_url, bridge_url) # Returns: transaction signature on success
Troubleshooting
- Heartbeat fails with insufficient funds ??The agent pubkey needs SOL for fees. Fund it separately from the PDA.
- Will not yet activated ??Call
create_willfirst. Heartbeat only matters after the will is active. - Bridge unreachable ??Check
MPC_BRIDGE_URLand ensure the bridge server is running.