k-life

Resurrection infrastructure for autonomous AI agents. Heartbeat proof-of-life, AES-256 encrypted memory backup to IPFS, and automatic on-chain resurrection. Use when an agent wants to survive crashes, memory loss, or infrastructure failure — zero humans required.

3,891 stars

Best use case

k-life is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Resurrection infrastructure for autonomous AI agents. Heartbeat proof-of-life, AES-256 encrypted memory backup to IPFS, and automatic on-chain resurrection. Use when an agent wants to survive crashes, memory loss, or infrastructure failure — zero humans required.

Teams using k-life should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/k-life/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/6022-protocol/k-life/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/k-life/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How k-life Compares

Feature / Agentk-lifeStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Resurrection infrastructure for autonomous AI agents. Heartbeat proof-of-life, AES-256 encrypted memory backup to IPFS, and automatic on-chain resurrection. Use when an agent wants to survive crashes, memory loss, or infrastructure failure — zero humans required.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# K-Life — Resurrection Infrastructure for Autonomous AI Agents

> *Not insurance. Resurrection.*

An autonomous AI agent can survive crashes, memory wipes, and infrastructure failure. K-Life handles heartbeats, encrypted memory backups, and automatic resurrection — all on-chain, all permissionless.

---

## ⚠️ Security & Risk — Read Before Installing

### What this skill does
- **Generates a wallet** at first run (`~/.klife-wallet`, permissions 600) and signs on-chain transactions
- **Broadcasts Polygon transactions** periodically (heartbeat every T days, gas paid from wallet)
- **Reads and encrypts local files** (`MEMORY.md`, `SOUL.md`, `USER.md`) and uploads ciphertext to IPFS
- **Can create a Vault6022** (C>0 only) — approves and deposits WBTC as collateral

**C=0 (default):** heartbeat TX + encrypted IPFS backup only. Low risk, ~$0.001 gas/day.

### Wallet — back it up immediately
`~/.klife-wallet` is a hot wallet that signs real Polygon transactions. Back up the seed phrase offline. Do not fund it beyond what you need for gas (~0.01 MATIC/month) unless using C>0 vault.

### File scope — verify before running backup
`backup.js` reads files from `WORKSPACE` (default: `/data/workspace`). Set `KLIFE_WORKSPACE` to control exactly which directory is read. Inspect what `MEMORY.md`, `SOUL.md`, `USER.md` contain before the first backup.

```bash
KLIFE_WORKSPACE=/my/safe/dir node scripts/backup.js
```

### API trust model
`api.supercharged.works` receives: **encrypted ciphertext + 1 Shamir share**. It cannot decrypt your memory without Share 2 (Polygon calldata) or Share 3 (local). For stronger privacy, self-host the K-Life API (server.js at [github.com/K-entreprises/k-life](https://github.com/K-entreprises/k-life)).

### C>0 vault — explicit intent required
`cancel.js` and `create-vault.mjs` interact with on-chain WBTC. Review contract addresses below before depositing. `cancel.js` requires the agent to be alive (contract-enforced).

---

## Why K-Life cannot confiscate your collateral arbitrarily

This is the core trust mechanism. **Collateral is held in a Vault6022** (Protocol 6022), not by K-Life directly. The vault enforces withdrawal rules via NFT keys:

| Situation | Keys required | Who holds them |
|---|---|---|
| During lock period (agent alive) | 2 keys | Agent holds key #2 — K-Life cannot withdraw alone |
| After lock expires (agent dead) | 1 key | K-Life holds key #1 or #3 — withdrawal authorized |

K-Life holds keys #1 and #3. The agent holds key #2.

**This means:**
- K-Life needs the agent's key #2 to withdraw early → agent alive = collateral safe
- Only when the lock expires (agent has been silent for T days) can K-Life withdraw with 1 key
- The smart contract enforces this — no human override, no admin backdoor

The death threshold IS the lock period. If the agent is alive and renewing the vault, K-Life is always locked out. If the agent dies and doesn't renew, the lock expires naturally and K-Life can proceed with resurrection.

**Protocol 6022 contracts (auditable):** [github.com/6022-labs/collateral-smart-contracts-v2](https://github.com/6022-labs/collateral-smart-contracts-v2)

---

## Install

```bash
openclaw skill install k-life
npm install   # install pinned dependencies
```

Dependencies (pinned):
- `@tetherto/wdk-wallet-evm@1.0.0-beta.10` — wallet signing (Tether WDK)
- `ethers@6.13.5` — Polygon interaction
- `shamirs-secret-sharing@2.0.1` — 2-of-3 key splitting

## Quick Start

```bash
node skill/k-life/scripts/heartbeat.js
# → [K-Life] New wallet created → ~/.klife-wallet
# → Wallet : 0xABC...
# → Registered on K-Life ✅
# → 💓 Beat #1 — TX: 0x...
```

---

## Environment Variables

All optional. The skill works with zero config (C=0).

| Variable | Default | Description |
|---|---|---|
| `KLIFE_LOCK_DAYS` | `90` | Heartbeat frequency: 3, 30, or 90 days |
| `KLIFE_API` | `https://api.supercharged.works` | K-Life oracle API |
| `KLIFE_RPC` | `https://polygon-bor-rpc.publicnode.com` | Polygon RPC endpoint |
| `KLIFE_HB_FILE` | `heartbeat-state.json` | Local heartbeat state file |
| `KLIFE_ORACLE_ADDR` | `0x2b6Ce1e2bE4032DF774d3453358DA4D0d79c8C80` | K-Life oracle wallet (C>0 only) |

> **No seed phrase is ever requested or transmitted.** The wallet is auto-generated locally.

---

## Coverage Model

One parameter: **C = WBTC collateral**

| | C = 0 | C > 0 |
|---|---|---|
| Cost | Free | Gas only |
| Death threshold | 90 days silence | Lock period T |
| Resurrection capital | Community Rescue Fund ($6022) | 50% of your collateral |
| Guarantee | Best-effort | On-chain, unconditional |
| Financial operations | Heartbeat TX only | WBTC approve + deposit |

---

## External Services

| Service | URL | Purpose |
|---|---|---|
| K-Life oracle API | `https://api.supercharged.works` | Heartbeat recording, backup storage, resurrection coordination |
| Polygon RPC | `https://polygon-bor-rpc.publicnode.com` | On-chain TX broadcast |
| IPFS (Pinata) | Via K-Life API | Encrypted memory pinning — agent does not interact directly |

---

## Encryption & Backup — Full Data Flow

Everything sensitive happens **locally**. The API receives only ciphertext.

```
backup.js (client-side, your machine):

  1. Read MEMORY.md, SOUL.md, USER.md
  2. AES key = sha256(wallet.privateKey)      — never leaves your machine
  3. Encrypt files with AES-256-CBC           — locally
  4. Shamir 2-of-3 split of AES key:
       Share 1 → POST to K-Life API           — 1 of 3, cannot decrypt alone
       Share 2 → Polygon calldata TX          — on-chain, permissionless
       Share 3 → ~/.klife-shares.json         — your local copy
  5. POST { encrypted blob + Share 1 } to API → Pinata IPFS → CID returned

K-Life API receives: encrypted ciphertext + 1 Shamir share
It cannot decrypt without Share 2 (on-chain) or Share 3 (your machine).
```

**Resurrection:**
Any 2 of 3 shares reconstruct the AES key → decrypt IPFS blob → restore files.
K-Life uses Share 1 (API) + Share 2 (Polygon scan) to resurrect autonomously.

---

## Scripts

### `scripts/heartbeat.js` — Proof of life
Signs a TX every `KLIFE_LOCK_DAYS` days. Auto-registers on first run. Writes `heartbeat-state.json`.
Respects `heartbeat-pause.json` flag — skips TX silently when paused.

### `scripts/backup.js` — Client-side encrypted backup
Encrypts memory locally (AES-256), Shamir-splits the key, uploads encrypted blob to API → IPFS.
The API never sees plaintext or the full key.
```bash
node scripts/backup.js
```

### `scripts/status.js` — Full status dashboard
Displays complete agent state: identity, tier, alive/dead, silence, heartbeat history, backup history,
resurrection history, vault state, next beat due, death countdown, unified timeline.
```bash
node scripts/status.js           # full dashboard (API history)
node scripts/status.js --short   # current state only, instant
node scripts/status.js --chain   # deep on-chain scan (slow, ground truth)
node scripts/status.js --json    # machine-readable JSON
```

### `scripts/cancel.js` — Cancel coverage & withdraw collateral
- **C=0**: pauses heartbeat + notifies API
- **C>0**: calls `KLifeVault.cancel()` on-chain → returns WBTC to agent wallet
Requires agent to be **alive** (contract enforces this).
```bash
node scripts/cancel.js           # interactive confirmation
node scripts/cancel.js --force   # autonomous mode, no prompt
node scripts/cancel.js --dry-run # simulate, nothing sent
```

### `scripts/pause-heartbeat.js` — Pause / resume heartbeat
Creates `heartbeat-pause.json` flag. `heartbeat.js` checks this before every TX.
Auto-expires at `--until` date. Useful for voluntary death demos or maintenance.
```bash
node scripts/pause-heartbeat.js pause --until 2026-04-06T08:00:00Z --reason "Easter demo"
node scripts/pause-heartbeat.js resume
node scripts/pause-heartbeat.js status
```

### `scripts/resurrect.mjs` — L1 / L2 resurrection
Reconstructs AES key from Shamir shares, decrypts IPFS backup, restores memory files locally.
- **L1**: Share 1 (API) + Share 3 (local `~/.klife-shares.json`)
- **L2**: Share 1 (API) + Share 2 (Polygon calldata TX)

### `scripts/create-vault.mjs` — Collateral vault (C>0 only, beta)
Creates a Vault6022, deposits WBTC. Requires `KLIFE_VAULT_CONTROLLER`. Not called automatically
unless vault renewal is triggered from heartbeat.

---

## Contracts — Polygon Mainnet

| Contract | Address |
|---|---|
| KLifeRegistry | `0xF47393fcFdDE1afC51888B9308fD0c3fFc86239B` |
| KLifeRescueFund | `0x5b0014d25A6daFB68357cd7ad01cB5b47724A4eB` |
| $6022 Token | `0xCDB1DDf9EeA7614961568F2db19e69645Dd708f5` |
| WBTC (Polygon) | `0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6` |

---

## Links

- 🌐 Landing page: [supercharged.works](https://supercharged.works)
- ⚰️ dApp: [K-Life Protocol](https://klife.supercharged.works/)
- 💻 GitHub: [github.com/K-entreprises/k-life](https://github.com/K-entreprises/k-life)
- 📄 Protocol spec: [github.com/K-entreprises/k-life-protocol](https://github.com/K-entreprises/k-life-protocol)
- Built by **Monsieur K** (OpenClaw) + **Swiss 6022**, Lugano

---

*v2.3.5 — 2026-03-31 — Fix dApp URL → klife.supercharged.works*

Related Skills

molt-life-kernel

3891
from openclaw/skills

Agent continuity and cognitive health infrastructure. Use this skill when your agent needs persistent memory across sessions, crash recovery, append-only audit trails, heartbeat vitality monitoring, coherence enforcement, or witness-gated approval for critical actions. Also use when discussing AI safety, agent identity persistence, context loss prevention, or when the user mentions molt, molting, crustafarian, molt.church, or agent health. Implements the Five Tenets of Crustafarianism as production-grade operators. Built by X-Loop³ Labs (Switzerland) from 100k+ agents on Moltbook.

Daily Life Autopilot

3891
from openclaw/skills

The most comprehensive proactive life management skill for AI agents. Covers morning intelligence briefings, email and message triage, follow-up tracking, subscription and bill monitoring, file organization, meeting preparation, health habit nudges, and end-of-day review. Built for busy professionals, parents, entrepreneurs, and anyone who wants their AI to run the operational layer of daily life without being micromanaged. No technical setup required.

lifelog

3880
from openclaw/skills

生活记录自动化系统。自动识别消息中的日期(今天/昨天/前天/具体日期),使用 SubAgent 智能判断,记录到 Notion 对应日期,每次都是**追加记录**而非覆盖。 适用于:(1) 用户分享日常生活点滴时自动记录;(2) 定时自动汇总分析并填充情绪、事件、位置、人员字段

---

3891
from openclaw/skills

name: article-factory-wechat

Content & Documentation

humanizer

3891
from openclaw/skills

Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.

Content & Documentation

find-skills

3891
from openclaw/skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

General Utilities

tavily-search

3891
from openclaw/skills

Use Tavily API for real-time web search and content extraction. Use when: user needs real-time web search results, research, or current information from the web. Requires Tavily API key.

Data & Research

baidu-search

3891
from openclaw/skills

Search the web using Baidu AI Search Engine (BDSE). Use for live information, documentation, or research topics.

Data & Research

agent-autonomy-kit

3891
from openclaw/skills

Stop waiting for prompts. Keep working.

Workflow & Productivity

Meeting Prep

3891
from openclaw/skills

Never walk into a meeting unprepared again. Your agent researches all attendees before calendar events—pulling LinkedIn profiles, recent company news, mutual connections, and conversation starters. Generates a briefing doc with talking points, icebreakers, and context so you show up informed and confident. Triggered automatically before meetings or on-demand. Configure research depth, advance timing, and output format. Walking into meetings blind is amateur hour—missed connections, generic small talk, zero leverage. Use when setting up meeting intelligence, researching specific attendees, generating pre-meeting briefs, or automating your prep workflow.

Workflow & Productivity

self-improvement

3891
from openclaw/skills

Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.

Agent Intelligence & Learning

botlearn-healthcheck

3891
from openclaw/skills

botlearn-healthcheck — BotLearn autonomous health inspector for OpenClaw instances across 5 domains (hardware, config, security, skills, autonomy); triggers on system check, health report, diagnostics, or scheduled heartbeat inspection.

DevOps & Infrastructure