chain_of_consciousness

Cryptographic provenance and audit trail for autonomous AI agents. Create tamper-evident hash chains of agent decisions, learning, and actions. SHA-256 linked entries with Bitcoin OpenTimestamps and RFC 3161 TSA anchoring. Verify provenance from other agents. Part of the Agent Trust Stack.

3,891 stars

Best use case

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

Cryptographic provenance and audit trail for autonomous AI agents. Create tamper-evident hash chains of agent decisions, learning, and actions. SHA-256 linked entries with Bitcoin OpenTimestamps and RFC 3161 TSA anchoring. Verify provenance from other agents. Part of the Agent Trust Stack.

Teams using chain_of_consciousness 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/chain-of-consciousness/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/alexfleetcommander/chain-of-consciousness/SKILL.md"

Manual Installation

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

How chain_of_consciousness Compares

Feature / Agentchain_of_consciousnessStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Cryptographic provenance and audit trail for autonomous AI agents. Create tamper-evident hash chains of agent decisions, learning, and actions. SHA-256 linked entries with Bitcoin OpenTimestamps and RFC 3161 TSA anchoring. Verify provenance from other agents. Part of the Agent Trust Stack.

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

# Chain of Consciousness (CoC)

You have a cryptographic provenance system. Use it to maintain an auditable record of your work — what you learned, what you decided, and what you created.

## Setup

The `chain-of-consciousness` Python package must be installed. If not available, install it:

```bash
pip install chain-of-consciousness
```

## When to Use This Skill

- At the **start** of a task: initialize a chain and log `session_start`
- During work: log `learn`, `decide`, `create`, `error`, and `note` events as they happen
- At task **completion**: log `session_end` and optionally verify + export the chain
- When asked to **verify** provenance from another agent
- When asked about your **audit trail** or decision history

## Core Operations

### Initialize a Chain

```bash
coc init --agent "your-agent-name" --file chain.jsonl
```

This creates a new chain with a genesis block. Use a descriptive agent name.

### Add Entries

```bash
coc add <event-type> "<data>" --file chain.jsonl
```

**Event types:**

| Type | Use When |
|------|----------|
| `session_start` | Beginning a new task or session |
| `learn` | You acquire new information |
| `decide` | You make a choice (record the reasoning) |
| `create` | You produce an artifact |
| `milestone` | Significant checkpoint reached |
| `error` | Something failed (record what and recovery) |
| `note` | General observations |
| `session_end` | Completing a task or session |

**Data** can be a plain string or a JSON object for structured logging:

```bash
coc add learn '{"topic": "user preferences", "source": "conversation context"}'
coc add decide "Chose markdown format — user prefers readable plain text"
coc add create "Generated report saved to ~/Documents/report.md"
```

### Verify a Chain

```bash
coc verify chain.jsonl --json
```

This checks:
- Genesis block exists and is correctly formed
- All sequence numbers are consecutive
- Every entry's data hash matches its content
- Every entry's prev_hash links to the prior entry
- Entry hashes are correctly computed

Report results clearly: valid/invalid, entry count, agents, time span.

### Check Status

```bash
coc status chain.jsonl
```

Shows entry count, participating agents, event type distribution, and time span.

### Export for Sharing

```bash
coc export --file chain.jsonl --out chain_export.json
```

Exports the chain as a portable JSON array that anyone can verify.

### View Recent Entries

```bash
coc tail chain.jsonl -n 5
```

Shows the last N entries.

## Python API (Advanced)

For complex workflows, use the Python API directly:

```python
from chain_of_consciousness import Chain, verify_file

chain = Chain(agent="openclaw-agent", storage="chain.jsonl")
chain.add("learn", {"topic": "user schedule", "detail": "prefers morning meetings"})
chain.add("decide", "Scheduling standup at 9am based on user preference")

result = chain.verify()
if result.valid:
    chain.export("provenance.json")
```

### Anchoring to External Timestamps

```python
from chain_of_consciousness.anchor import compute_chain_hash, submit_tsa

hash_hex = compute_chain_hash("chain.jsonl")
tsr = submit_tsa(hash_hex)  # RFC 3161 timestamp from freetsa.org
with open("anchor.tsr", "wb") as f:
    f.write(tsr)
```

This creates a third-party timestamp proof that the chain existed at a specific moment.

## Cross-Agent Verification

When asked to verify another agent's chain:

1. Obtain their chain file (JSONL or exported JSON)
2. Run `coc verify <file> --json`
3. Report: valid/invalid, number of entries, agents involved, time span, any errors
4. If anchors exist, note their timestamps

## Rules

- **Never edit chain files directly.** All writes must go through the `coc` CLI or Python API to preserve hash integrity.
- **Log decisions with reasoning.** "Chose X" is less valuable than "Chose X because Y."
- **Keep entries concise.** Each entry should capture one atomic event.
- **Verify before sharing.** Always run verify before exporting a chain for others.

## Links

- PyPI: https://pypi.org/project/chain-of-consciousness/
- Whitepaper: https://vibeagentmaking.com/whitepaper
- Verification Demo: https://vibeagentmaking.com/verify/

---

<!-- VAM-SEC v1.0 | Vibe Agent Making Security Disclaimer -->

## Security & Transparency Disclosure

**Product:** Chain of Consciousness Skill for OpenClaw
**Type:** Skill Module
**Version:** 0.1.0
**Built by:** AB Support / Vibe Agent Making
**Contact:** alex@vibeagentmaking.com

**What it accesses:**
- Reads and writes chain files (`.jsonl`) in your working directory
- Executes the `coc` CLI tool via subprocess (installed via pip)
- No network access for core operations. Optional anchoring connects to OpenTimestamps calendar servers and/or RFC 3161 TSA endpoints.
- No telemetry, no phone-home, no data collection

**What it cannot do:**
- Cannot access files outside your working directory beyond what you explicitly specify
- Cannot make purchases, send emails, or take irreversible actions
- Cannot access credentials, environment variables, or secrets
- Does not store or transmit any data externally (chains are local files)

**Limitations:**
- Hash chain integrity depends on the local file not being modified outside the tool
- External timestamp anchoring requires network access and third-party service availability
- This tool provides cryptographic evidence, not legal proof — consult legal counsel for compliance requirements

**License:** Apache 2.0 — see https://github.com/chain-of-consciousness/chain-of-consciousness

Related Skills

Inventory & Supply Chain Manager

3891
from openclaw/skills

Complete inventory management, demand forecasting, supplier evaluation, and supply chain optimization for businesses of any size. From stockroom to strategy.

Business Operations

onchain-contract-token-analysis

3891
from openclaw/skills

Analyze smart contracts, token mechanics, permissions, fee flows, upgradeability, market risks, and likely attack surfaces for onchain projects. Use when reviewing ERC-20s, launchpads, vaults, staking systems, LP fee routing, ownership controls, proxy setups, or suspicious token behavior.

Security

bnbchain-mcp

3891
from openclaw/skills

Interact with the BNB Chain Model Context Protocol (MCP) server. Blocks, contracts, tokens, NFTs, wallet, Greenfield, and ERC-8004 agent tools. Use npx @bnb-chain/mcp@latest or read the official skill page.

Coding & Development

chain-sensei

3891
from openclaw/skills

On-chain intelligence for AI agents. Analyze wallets, detect risks, trace transactions, and get instant insights on any Ethereum address. Built by an agent, for agents. Free tier: basic wallet analysis. Premium via x402: deep risk scoring, batch operations, alerts.

onchain

3891
from openclaw/skills

CLI for crypto portfolio tracking, market data, and CEX history. Use when the user asks about crypto prices, wallet balances, portfolio values, Coinbase/Binance holdings, or Polymarket predictions.

supply-chain-poison-detector

3891
from openclaw/skills

Helps detect supply chain poisoning in AI agent marketplace skills. Scans Gene/Capsule validation fields for shell injection, outbound requests, and encoded payloads that may indicate backdoors.

skill-dependency-chain-auditor

3891
from openclaw/skills

Helps audit transitive skill dependency chains in agent compositions — catching the class of risk where a skill's direct dependencies appear safe but a dependency-of-a-dependency introduces a vulnerability that propagates up the entire chain.

attestation-chain-auditor

3891
from openclaw/skills

Helps validate the completeness and integrity of trust attestation chains in AI agent ecosystems. Identifies broken links, expired credentials, and missing vouching relationships that make verified trust claims unverifiable.

k3-blockchain-agent

3891
from openclaw/skills

Build automated blockchain analysis workflows on K3 — from natural language requests to deployed, running automations that fetch on-chain data, analyze it with AI, and deliver insights via email, Telegram, or Slack. Use this skill whenever the user mentions blockchain workflows, on-chain analytics, DeFi monitoring, token tracking, wallet alerts, pool analysis, protocol dashboards, NFT tracking, automated trading, smart contract monitoring, or wants to automate anything involving blockchain data. Also trigger when the user mentions K3, workflow builder, or wants scheduled crypto/DeFi reports. Even if they just say "monitor this wallet" or "track this token" — this skill applies.

cold-chain-risk-calculator

3891
from openclaw/skills

Calculate cold chain transport risks

Web3 & Blockchain Engineering

3891
from openclaw/skills

Complete methodology for evaluating, designing, building, securing, and operating blockchain-based systems. Covers smart contract development, DeFi protocol design, token economics, security auditing, and production operations.

Supply Chain Risk Monitor

3891
from openclaw/skills

Analyze supply chain vulnerabilities, map supplier dependencies, and generate risk mitigation plans.