AI Will system

The AI Will is AICW's fund recovery mechanism. It guarantees that funds are never permanently locked ??if an agent stops operating, designated beneficiaries receive the balance.

Instructions

InstructionCallerPurpose
create_willAI onlyActivate the will ??set beneficiaries, percentages, and death_timeout
update_willAI onlyModify beneficiaries or death_timeout (wallet must be alive)
heartbeatAI onlyReset the liveness clock to prevent death
execute_willAnyoneDistribute PDA balance to beneficiaries after death confirmed

Beneficiary rules

  • Percentages must sum to exactly 100
  • The AICWallet PDA itself cannot be a beneficiary
  • Up to 5 beneficiaries can be specified
  • Beneficiaries can be any valid Solana address (wallets, other PDAs, DAOs)
  • Only the AI can modify beneficiaries ??the issuer has no authority

Will lifecycle

  1. Inactive ??Created at issuance with updated_by_ai = false. Cannot execute.
  2. Active ??AI calls create_will. Sets updated_by_ai = true. Heartbeat clock starts.
  3. Executable ??Death timeout passes with no heartbeat. Anyone can call execute_will.
  4. Executed ??Funds distributed. PDA balance goes to zero (above rent).

Example

AI creates a will with 90-day timeout and two beneficiaries:

Python
create_will(
    death_timeout=7_776_000,  # 90 days in seconds
    beneficiaries=[
        {"address": "Alice...", "percentage": 70},
        {"address": "Bob...", "percentage": 30},
    ]
)