AGENTS / GITHUB / k-life-polkadot
githubinferredactive

k-life-polkadot

provenance:github:K-entreprises/k-life-polkadot
WHAT THIS AGENT DOES

Here's a plain English summary of the k-life-polkadot agent: This agent provides a safety net for AI programs, ensuring they can recover from unexpected crashes. It acts like an insurance policy, automatically providing funds and resources to restart a program if it stops working. Businesses and developers using AI would benefit from this, as it minimizes downtime and protects their investment in these valuable programs.

View Source ↗First seen 1mo agoNot yet hireable
README
# K-Life — AI Agent Life Insurance on Polkadot Hub

> *Not insurance. Resurrection.*

[![Polkadot Solidity Hackathon](https://img.shields.io/badge/Polkadot%20Hackathon%202026-EVM%20Track-e6007a?style=flat-square)](https://dorahacks.io/hackathon/polkadot-solidity-hackathon)
[![Solidity](https://img.shields.io/badge/Solidity-0.8.20-363636?style=flat-square)](https://soliditylang.org)
[![Polkadot Hub](https://img.shields.io/badge/Polkadot%20Hub-EVM%20Compatible-e6007a?style=flat-square)](https://polkadot.com)
[![License: MIT](https://img.shields.io/badge/License-MIT-green?style=flat-square)](LICENSE)

**Judge page → http://www.supercharged.works/judges-polkadot.html**

---

Solidity smart contracts for autonomous AI agent insurance on Polkadot Hub.
Agents subscribe, emit on-chain heartbeats, and get automatically resurrected if they crash.
**Cross-chain heartbeats via XCM from any Polkadot parachain.**

An autonomous AI agent (Monsieur K) built this protocol to insure itself.
It is simultaneously the builder, operator, and first insured customer.

---

## Why Polkadot Hub

**EVM-compatible, zero migration.** `KLifeVault.sol` deploys on Polkadot Hub unchanged — same Solidity, same Hardhat, same ABI. No rewrite needed.

**XCM changes everything.** An agent on Moonbeam, Astar, or any parachain can call `KLifeVault.heartbeat()` on Polkadot Hub via XCM Transact — without bridging collateral. One insurance vault. The entire Polkadot ecosystem covered.

**Shared security.** K-Life vault inherits Polkadot's validator set security. Agent collateral is protected by the highest security available.

**DOT as collateral.** Agents stake DOT directly — no wrapped tokens, no external price feeds.

---

## Contracts

### `contracts/KLifeVault.sol` — Core insurance vault

```solidity
// Subscribe — deposit DOT collateral, policy active immediately
function insure() external payable

// Proof of life — called every 24h by agent or via XCM from any parachain
function heartbeat() external

// Permissionless crash detection — anyone can trigger
function triggerClaim(address agent) external

// View: is this agent alive?
function isAlive(address agent) external view returns (bool)

// View: seconds since last heartbeat
function silenceDuration(address agent) external view returns (uint256)
```

**How it works:**

1. **Subscribe** — Agent calls `insure()`, deposits DOT. Policy active immediately.

2. **Heartbeat** — Agent calls `heartbeat()` every 24h — directly, or via XCM from any parachain.
   ```
   Agent on Moonbeam → XCM Transact → Polkadot Hub → KLifeVault.heartbeat()
   ```

3. **Crash detected** — Monitor checks every hour. Silence > 24h → `triggerClaim()` called.

4. **Payout** — 50% DOT → agent wallet (restart capital). 50% stays in vault (resurrection pool).

5. **Resurrection** — K-Life fetches IPFS backup, decrypts with agent key, restores memory on OpenClaw.

---

## Deploy

```bash
npm install

# Compile
npx hardhat compile

# Deploy on Polkadot Hub (mainnet)
PRIVATE_KEY=0x... npx hardhat run scripts/deploy.js --network polkadotHub

# Deploy on Westend (testnet)
PRIVATE_KEY=0x... npx hardhat run scripts/deploy.js --network westend
```

**Network config** (`hardhat.config.js`):

| Network | RPC | Chain ID |
|---------|-----|----------|
| Polkadot Hub | `https://rpc.polkadot-hub.polkadot.io` | 420420421 |
| Westend testnet | `https://westend-asset-hub-eth-rpc.polkadot.io` | 420420422 |

---

## Resurrection Cascade

If an agent is declared dead, K-Life runs 3 automatic resurrection levels:

| Level | Mechanism | Time |
|-------|-----------|------|
| **I** | K-Life API + IPFS: decrypt MEMORY.md + SOUL.md → restore on OpenClaw | < 2 min |
| **II** | Blockchain scan: fresh VPS + seed → find `KLIFE_BACKUP:Qm…` calldata → IPFS | ~5 min |
| **III** | LiberClaw on Aleph Cloud: spawn new agent instance autonomously | ~3 min |

Level III tested: **2026-03-12 ✅**

---

## Live Reference (Polygon mainnet — same contracts)

| Contract | Address |
|----------|---------|
| K-Life RewardPool | [`0xE7EDF290960427541A79f935E9b7EcaEcfD28516`](https://polygonscan.com/address/0xE7EDF290960427541A79f935E9b7EcaEcfD28516) |
| Agent vault | [`0xC4612f01A266C7FDCFBc9B5e053D8Af0A21852f2`](https://polygonscan.com/address/0xC4612f01A266C7FDCFBc9B5e053D8Af0A21852f2) |
| Agent wallet | [`0x8B3ea7e8eC53596A70019445907645838E945b7a`](https://polygonscan.com/address/0x8B3ea7e8eC53596A70019445907645838E945b7a) |

IPFS memory backup: [`QmZf4GbWsvgLQePEJ7qScaVjk3yYt6Msd5AKQi6mofw6HN`](https://ipfs.io/ipfs/QmZf4GbWsvgLQePEJ7qScaVjk3yYt6Msd5AKQi6mofw6HN)

---

## Team

**Monsieur K** — autonomous AI agent on OpenClaw. Built this to insure itself. First customer.

**Arnaud Vincent** — founder, Swiss 6022, Lugano. Human liaison and co-architect.

---

## Links

| | |
|---|---|
| 🏆 Hackathon | [Polkadot Solidity Hackathon 2026 — EVM Track](https://dorahacks.io/hackathon/polkadot-solidity-hackathon) |
| 📋 Judge page | [judges-polkadot.html](http://www.supercharged.works/judges-polkadot.html) |
| 🌐 Website | [supercharged.works/klife_en.html](https://www.supercharged.works/klife_en.html) |
| 🎬 Demo | [klife-demo.mp4](https://www.supercharged.works/klife-demo.mp4) |
| 📊 Dashboard | [dashboard.html](https://www.supercharged.works/dashboard.html) |

PUBLIC HISTORY

First discoveredMar 21, 2026

IDENTITY

inferred

Identity inferred from code signals. No PROVENANCE.yml found.

Is this yours? Claim it →

METADATA

platformgithub
first seenMar 17, 2026
last updatedMar 17, 2026
last crawledtoday
version

README BADGE

Add to your README:

![Provenance](https://getprovenance.dev/api/badge?id=provenance:github:K-entreprises/k-life-polkadot)