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:
CODEBLOCK0
When to Use This Skill
- - At the start of a task: initialize a chain and log INLINECODE1
- 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
CODEBLOCK1
This creates a new chain with a genesis block. Use a descriptive agent name.
Add Entries
CODEBLOCK2
Event types:
| Type | Use When |
|---|
| INLINECODE8 | Beginning a new task or session |
| INLINECODE9 |
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:
CODEBLOCK3
Verify a Chain
CODEBLOCK4
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
CODEBLOCK5
Shows entry count, participating agents, event type distribution, and time span.
Export for Sharing
CODEBLOCK6
Exports the chain as a portable JSON array that anyone can verify.
View Recent Entries
CODEBLOCK7
Shows the last N entries.
Python API (Advanced)
For complex workflows, use the Python API directly:
CODEBLOCK8
Anchoring to External Timestamps
CODEBLOCK9
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)
- Run INLINECODE16
- Report: valid/invalid, number of entries, agents involved, time span, any errors
- 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/
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
意识链 (CoC)
你拥有一个加密溯源系统。使用它来维护你工作的可审计记录——你学到了什么、你决定了什么、以及你创造了什么。
设置
必须安装 chain-of-consciousness Python 包。如果尚未安装,请执行安装:
bash
pip install chain-of-consciousness
何时使用此技能
- - 在任务的开始阶段:初始化一个链并记录 sessionstart
- 在工作过程中:在事件发生时记录 learn、decide、create、error 和 note 事件
- 在任务完成时:记录 sessionend,并可选择验证并导出链
- 当被要求验证来自其他代理的溯源信息时
- 当被问及你的审计轨迹或决策历史时
核心操作
初始化一个链
bash
coc init --agent your-agent-name --file chain.jsonl
这将创建一个带有创世区块的新链。请使用描述性的代理名称。
添加条目
bash
coc add --file chain.jsonl
事件类型:
| 类型 | 使用场景 |
|---|
| session_start | 开始新任务或会话时 |
| learn |
你获取新信息时 |
| decide | 你做出选择时(记录推理过程) |
| create | 你产生工件时 |
| milestone | 达到重要里程碑时 |
| error | 出现故障时(记录故障内容和恢复措施) |
| note | 一般性观察记录 |
| session_end | 完成任务或会话时 |
数据可以是纯文本字符串,也可以是用于结构化记录的 JSON 对象:
bash
coc add learn {topic: user preferences, source: conversation context}
coc add decide 选择了 Markdown 格式——用户偏好可读的纯文本
coc add create 生成的报告已保存至 ~/Documents/report.md
验证一个链
bash
coc verify chain.jsonl --json
这将检查:
- - 创世区块存在且格式正确
- 所有序列号连续
- 每个条目的数据哈希值与其内容匹配
- 每个条目的 prev_hash 链接到前一个条目
- 条目哈希值计算正确
清晰报告结果:有效/无效、条目数量、代理、时间跨度。
检查状态
bash
coc status chain.jsonl
显示条目数量、参与的代理、事件类型分布和时间跨度。
导出以供共享
bash
coc export --file chain.jsonl --out chain_export.json
将链导出为可移植的 JSON 数组,任何人都可以验证。
查看最近条目
bash
coc tail chain.jsonl -n 5
显示最后 N 个条目。
Python API(高级)
对于复杂的工作流程,可以直接使用 Python API:
python
from chainofconsciousness 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, 根据用户偏好将每日站会安排在上午9点)
result = chain.verify()
if result.valid:
chain.export(provenance.json)
锚定到外部时间戳
python
from chainofconsciousness.anchor import computechainhash, submit_tsa
hashhex = computechain_hash(chain.jsonl)
tsr = submittsa(hashhex) # 来自 freetsa.org 的 RFC 3161 时间戳
with open(anchor.tsr, wb) as f:
f.write(tsr)
这将创建一个第三方时间戳证明,表明该链在特定时刻存在。
跨代理验证
当被要求验证其他代理的链时:
- 1. 获取他们的链文件(JSONL 或导出的 JSON)
- 运行 coc verify --json
- 报告:有效/无效、条目数量、涉及的代理、时间跨度、任何错误
- 如果存在锚点,记录其时间戳
规则
- - 切勿直接编辑链文件。 所有写入操作必须通过 coc CLI 或 Python API 进行,以保持哈希完整性。
- 记录决策及其推理过程。 选择了 X 的价值不如 因为 Y 而选择了 X。
- 保持条目简洁。 每个条目应记录一个原子事件。
- 共享前先验证。 在将链导出给他人之前,务必先运行验证。
链接
- - PyPI:https://pypi.org/project/chain-of-consciousness/
- 白皮书:https://vibeagentmaking.com/whitepaper
- 验证演示:https://vibeagentmaking.com/verify/
安全与透明度声明
产品: OpenClaw 的意识链技能
类型: 技能模块
版本: 0.1.0
构建者: AB Support / Vibe Agent Making
联系方式: alex@vibeagentmaking.com
其访问权限:
- - 读取和写入工作目录中的链文件(.jsonl)
- 通过子进程执行 coc CLI 工具(通过 pip 安装)
- 核心操作无需网络访问。可选的锚定功能会连接到 OpenTimestamps 日历服务器和/或 RFC 3161 TSA 端点。
- 无遥测、无回传、无数据收集
其不能执行的操作:
- - 无法访问你明确指定之外的工作目录中的文件
- 无法进行购买、发送电子邮件或执行不可逆操作
- 无法访问凭据、环境变量或机密信息
- 不会在外部存储或传输任何数据(链是本地文件)
限制:
- - 哈希链的完整性取决于本地文件未被工具外部修改
- 外部时间戳锚定需要网络访问和第三方服务的可用性
- 此工具提供加密证据,而非法律证明——请就合规要求咨询法律顾问
许可证: Apache 2.0——请参阅 https://github.com/chain-of-consciousness/chain-of-consciousness