Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 91 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,40 @@ This is a working ZeroClaw + Solana use case for the Superteam Brasil
stock ZeroClaw release and its built-in `shell` tool: the problem is a T1
composition problem, not a reason to add unnecessary WASM.

![ClawLedger architecture](docs/architecture.png)

## Final evidence

- **Demo:** [2:46 narrated evidence video](docs/clawledger-demo.mp4)
- **Real Telegram validation:** [sanitized 200-event channel record](docs/CHANNEL_VALIDATION.md)
- **Finalized devnet transaction:** [Solana Explorer](https://explorer.solana.com/tx/N3mzTr1YAWw84b2irzd9Cr4cmPd9JHZSmZaUq3PPTr9xYPLfbJZZEqCMP417164U6exTiBA9kjXZ7pf4PHSQviU?cluster=devnet)
- **Reproduction and tests:** [validation evidence](docs/VALIDATION.md)

## Judge it in 90 seconds

- **Real channel:** a bound Telegram operator drove stock ZeroClaw v0.8.3 to
create and independently verify a 200-event checkpoint; see
[the sanitized channel record](docs/CHANNEL_VALIDATION.md).
- **Safety:** the agent never receives a wallet key. The local signer decodes
the unsigned transaction and refuses anything except the expected wallet,
fee payer, and one account-free Memo instruction; see
[the threat model](docs/THREAT_MODEL.md).
- **Reproducibility:** Python 3.11+ is the only runtime dependency. The public
suite has 17 tests and CI covers Python 3.11 and 3.14; see
[the validation guide](docs/VALIDATION.md).
- **Live proof:** the exact Memo for the real Telegram run is finalized on
Solana devnet and independently verified; see
[the public anchor evidence](docs/FINALIZED_ANCHOR.json) and
[the anchor handoff](docs/ANCHOR_HANDOFF.md).

The submission-ready narrative and the under-three-minute capture details are
in [the submission brief](docs/SUBMISSION.md) and
[the demo runbook](docs/DEMO.md).

[Watch the 2:46 narrated evidence demo](docs/clawledger-demo.mp4), covering the
real Telegram checkpoint, trust boundary, finalized devnet proof, and
reproduction path without exposing private channel data.

## The gap it closes

ZeroClaw already emits structured events to
Expand Down Expand Up @@ -46,6 +80,8 @@ for a seed phrase or private key.

Python 3.11+ is the only dependency.

### Windows PowerShell

```powershell
git clone https://github.com/leafwithered/clawledger.git
```
Expand All @@ -67,18 +103,44 @@ python -m clawledger proof `
--event-id 22222222-2222-4222-8222-222222222222
```

### macOS/Linux Bash

```bash
git clone https://github.com/leafwithered/clawledger.git
cd clawledger
export PYTHONPATH=src

python -m clawledger checkpoint \
--input fixtures/runtime-trace.sample.jsonl \
--output checkpoint.json

python -m clawledger verify \
--input fixtures/runtime-trace.sample.jsonl \
--manifest checkpoint.json

python -m clawledger proof \
--manifest checkpoint.json \
--event-id 22222222-2222-4222-8222-222222222222
```

Serve the Solana Action:

```powershell
python -m clawledger serve-action --manifest checkpoint.json
```

The Action is available at:
The server exposes a local Phantom signer and the raw Action endpoint:

```text
http://127.0.0.1:8787/anchor
http://127.0.0.1:8787/api/actions/anchor
```

The signer re-decodes the returned transaction in the browser and refuses to
open Phantom unless it contains the expected wallet signer, exactly one
account-free Memo instruction, and the manifest-derived Memo. Phantom remains
the only component that can sign or broadcast.

After the wallet broadcasts the transaction, verify the finalized Memo and
record the signature in the manifest:

Expand All @@ -91,11 +153,20 @@ python -m clawledger verify-anchor `

## Run the test suite

Windows PowerShell:

```powershell
$env:PYTHONPATH = "src"
python -m unittest discover -s tests -v
```

macOS/Linux Bash:

```bash
export PYTHONPATH=src
python -m unittest discover -s tests -v
```

With an official ZeroClaw binary available, run the complete reproducibility
check in one command:

Expand All @@ -104,6 +175,12 @@ powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\validate_all.ps1 `
-ZeroClawExe <PATH_TO_ZEROCLAW_EXE>
```

On macOS/Linux, run the equivalent Bash validation:

```bash
bash scripts/validate_all.sh --zero-claw /path/to/zeroclaw
```

The tests cover:

- deterministic canonicalization and checkpoint verification;
Expand Down Expand Up @@ -149,8 +226,11 @@ See [the ZeroClaw integration](zeroclaw/README.md),
[the demo runbook](docs/DEMO.md). The live bounty requirements and scoring
evidence are mapped in [the bounty alignment](docs/BOUNTY_ALIGNMENT.md).
The repository also includes a safe
[ZeroClaw configuration template](zeroclaw/config.example.toml) and a sanitized
[real-runtime validation record](docs/REAL_RUNTIME_VALIDATION.md).
[ZeroClaw configuration template](zeroclaw/config.example.toml), a sanitized
[real-runtime validation record](docs/REAL_RUNTIME_VALIDATION.md), and the
[real Telegram channel validation](docs/CHANNEL_VALIDATION.md). The completed
wallet boundary and finalized proof are specified in the
[devnet anchor handoff](docs/ANCHOR_HANDOFF.md).

## Why Solana

Expand All @@ -167,15 +247,20 @@ neither the log nor an encryption key—only a one-way Merkle root and a count.
- Official ZeroClaw v0.8.3 Skill install/audit and SOP validation: passed.
- Real ZeroClaw model turns created and independently verified a 64-event
checkpoint through the reviewed Skill script and tool-receipt path.
- A bound Telegram operator drove a real ZeroClaw turn that created and
verified a stable 200-event checkpoint; the bot returned the independently
reproduced root `df25687e...4447e29`.
- Bounty fit and judging rubric: mapped to concrete evidence.
- Public deployment and operator-signed devnet anchor: pending demo operator action.
- The 200-event Memo is finalized on Solana devnet and the strict verifier
returned `valid: true` at slot `481112918`.
- A 2:46 English-narrated evidence demo is published in
`docs/clawledger-demo.mp4`; `docs/DEMO.md` records its contents and the
privacy-safe live-capture checklist.

## License

MIT

![ClawLedger architecture](docs/architecture.png)

## Primary references

- [ZeroClaw structured logs and JSONL schema](https://github.com/zeroclaw-labs/zeroclaw/blob/master/docs/book/src/ops/observability.md)
Expand Down
80 changes: 80 additions & 0 deletions docs/ANCHOR_HANDOFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Devnet anchor handoff

The validated Telegram checkpoint was finalized on Solana devnet on
2026-08-04. This document preserves the operator review procedure and the
public proof.
Never provide a private key, seed phrase, keystore, wallet export, or signing
token to ClawLedger, ZeroClaw, an agent, or a submission form.

## Fixed checkpoint

```text
event_count = 200
root = df25687ed19a6ec87a4ee025ce8d0d9b03e4809d6257a215865e0f17a4447e29
memo = clawledger:v1:df25687ed19a6ec87a4ee025ce8d0d9b03e4809d6257a215865e0f17a4447e29:200
cluster = devnet
```

## Finalized proof

```text
signature = N3mzTr1YAWw84b2irzd9Cr4cmPd9JHZSmZaUq3PPTr9xYPLfbJZZEqCMP417164U6exTiBA9kjXZ7pf4PHSQviU
slot = 481112918
block time = 2026-08-04T08:35:24Z
verifier = valid: true, reason: ok
```

[Open the finalized transaction in Solana Explorer](https://explorer.solana.com/tx/N3mzTr1YAWw84b2irzd9Cr4cmPd9JHZSmZaUq3PPTr9xYPLfbJZZEqCMP417164U6exTiBA9kjXZ7pf4PHSQviU?cluster=devnet).
The machine-readable public record is in `docs/FINALIZED_ANCHOR.json`.

The local manifest was independently verified before the Action was served.
If any of these values differ in the wallet preview, reject the transaction.

## Wallet review gate

1. Use a disposable wallet set to Solana devnet with devnet SOL only.
2. Open the local `/anchor` signer in a browser with Phantom, or open
`/api/actions/anchor` through a compatible Action client.
Phantom must be installed and unlocked in the same Chrome profile that opens
the signer, with permission to read and change site data. Phantom officially
supports provider injection on `localhost` and `127.0.0.1`; if the signer
still reports that Phantom is unavailable, quit and reopen Chrome before
retrying. Never paste a recovery phrase into the signer page.
3. Confirm the transaction has exactly one instruction for Solana's Memo
program.
4. Confirm the instruction data is the exact Memo above.
5. Confirm there is no SOL transfer, token transfer, account creation, extra
signer, or additional instruction.
6. Only then approve signing and broadcasting in the wallet.

ClawLedger constructs the unsigned transaction but cannot sign or broadcast
it. The wallet remains the sole signer.

Phantom references:

- [Detect the provider](https://docs.phantom.com/solana/detecting-the-provider)
- [Connect Phantom to an app or site](https://help.phantom.com/hc/en-us/articles/29995498642195-Connect-Phantom-to-an-app-or-site)

## Finalized verification

Copy only the public devnet transaction signature and run:

```powershell
$env:PYTHONPATH = "src"
python -m clawledger verify-anchor `
--manifest <LOCAL_200_EVENT_MANIFEST> `
--signature <DEVNET_SIGNATURE> `
--rpc https://api.devnet.solana.com `
--write-signature
```

`--write-signature` is allowed only when the command first reports
`"valid": true`. The public explorer URL is:

```text
https://explorer.solana.com/tx/<DEVNET_SIGNATURE>?cluster=devnet
```

Capture the wallet preview, success state, verifier output, and Explorer page
for the final video. Do not show the wallet recovery phrase, browser extension
vault, Telegram token, model authentication, or raw audit trace.
16 changes: 9 additions & 7 deletions docs/BOUNTY_ALIGNMENT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Bounty alignment

Checked against the live Superteam listing on 2026-08-01.
Checked against the live Superteam listing on 2026-08-04. The listing still
shows a 5,000 USDG pool: 1,800 first, 1,200 second, 1,000 third, and four 250
USDG bonus awards.

## Eligibility

Expand All @@ -15,13 +17,13 @@ anchor the commitment from a wallet. The agent never sees a signing key.

## Rubric map

| Criterion | Weight | Evidence | Remaining gap |
| Criterion | Weight | Evidence | Final status |
|---|---:|---|---|
| Use case | 30% | Daily SOP, durable incident evidence, real ZeroClaw model run, real privacy problem | Run it through Telegram/Discord and show the recurring workflow |
| Safety | 25% | T1 custody, exact one-instruction Memo enforcement, fail-closed verification, no key input | Capture wallet preview and finalized devnet signature |
| Craft | 20% | Canonical JSON, domain-separated Merkle tree, proofs, Action serializer, 17 tests, stock-binary Skill/SOP validation, real tool receipt | Capture the validation output in the demo |
| Reproducibility | 15% | Dependency-free Python, fixtures, safe config template, runbooks, operator checklist | Re-run from a public clean clone |
| Showcase | 10% | Three-minute no-slides script and architecture graphic | Record phone + terminal video |
| Use case | 30% | Daily SOP, durable incident evidence, real ZeroClaw model run, bound Telegram run, real privacy problem | Completed: the 200-event Telegram workflow and independently reproduced root are documented in `CHANNEL_VALIDATION.md` |
| Safety | 25% | T1 custody, exact one-instruction Memo enforcement, fail-closed verification, no key input | Completed: the finalized transaction contains one account-free Memo, no transfer, and no account creation |
| Craft | 20% | Canonical JSON, domain-separated Merkle tree, proofs, Action serializer, 17 tests, stock-binary Skill/SOP validation, real tool receipt | Completed: tests, CI, strict verifier, and narrated demo are public |
| Reproducibility | 15% | Dependency-free Python, fixtures, safe config template, runbooks, operator checklist, clean-clone pass | Completed: Windows and macOS/Linux commands plus full validation scripts are included |
| Showcase | 10% | Under-three-minute English-narrated demo and architecture graphic | Technical artifact completed; public Discord and X URLs are added after publication |

## Required submission artifacts

Expand Down
30 changes: 28 additions & 2 deletions docs/BUILD_LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,31 @@ Local verification now also binds every manifest leaf field, source timestamp,
and canonical Memo back to the recomputed event range instead of validating the
root alone.

Next: one operator-signed devnet anchor and the real three-minute phone-channel
demo.
This milestone was followed by the bound Telegram run, finalized devnet anchor,
and under-three-minute evidence demo documented below.

## Post 5 — real Telegram channel

A bound Telegram operator now drives the stock ZeroClaw v0.8.3 daemon end to
end. The first attempt exposed an important operational edge case: the rolling
trace changed between checkpoint and verification, so ClawLedger failed
closed. Repeating against a stable local snapshot produced a verified
200-event checkpoint with root `df25687e...4447e29`; the Telegram bot returned
the same count and root.

The Action now also advertises the Solana devnet CAIP-2 identifier and Action
v2.4 response header. The subsequent milestone finalized the exact Memo and
published the under-three-minute recording.

## Post 6 — finalized public proof

The fixed 200-event checkpoint is now finalized on Solana devnet at slot
`481112918`. The transaction contains exactly one account-free Memo
instruction, no transfer, and no account creation. ClawLedger's independent
verifier returned `valid: true` for signature
`N3mzTr1Y...PHSQviU`.

A privacy-safe 2:46 narrated evidence demo is included in the repository. It
shows the real channel result, trust boundary, finalized proof, test matrix,
and reproduction path without exposing the Telegram identity, bot token,
wallet key, or raw audit trace.
56 changes: 56 additions & 0 deletions docs/CHANNEL_VALIDATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Real Telegram channel validation

Validation date: 2026-08-02 (Asia/Shanghai)

This was a real Telegram-to-ZeroClaw run, not a mocked transcript. A Telegram
bot was configured through ZeroClaw's encrypted configuration surface, the
operator identity was explicitly bound, and the official ZeroClaw v0.8.3
daemon reported the channel healthy.

## Checkpoint result

The operator asked the agent to checkpoint an exact local trace path using the
reviewed ClawLedger Skill. Each shell tool call contained one explicit Python
command: no variables, discovery, pipes, redirection, or chaining.

The first attempt used the live rolling trace. New runtime events displaced
the original range before verification, so verification failed closed. This
is the intended behavior; the root is never reported as valid for a changed
source range.

The operator then named an exact stable snapshot path. ZeroClaw created and
verified the checkpoint, and Telegram returned:

```text
event_count: 200
root: df25687ed19a6ec87a4ee025ce8d0d9b03e4809d6257a215865e0f17a4447e29
```

An independent local process verified the same manifest against the same
snapshot:

```json
{
"valid": true,
"reason": "ok",
"expected_root": "df25687ed19a6ec87a4ee025ce8d0d9b03e4809d6257a215865e0f17a4447e29",
"actual_root": "df25687ed19a6ec87a4ee025ce8d0d9b03e4809d6257a215865e0f17a4447e29",
"event_count": 200
}
```

## Credential and daemon health

After rotating the Telegram credential, the new value was validated with
Telegram's read-only bot identity endpoint, written through ZeroClaw's
encrypted config command, and removed from the clipboard. `channel doctor`
reported one healthy Telegram channel and zero unhealthy channels. A fresh
Telegram message then traversed the restarted daemon and returned the unique
reply `ROTATION_HEALTHY_3`.

## Privacy boundary

The bot token, Telegram account identifiers, model authentication, raw trace,
and screenshots are not committed. They remain under the ignored local tools
directory. The only publishable channel evidence is the non-secret event
count, Merkle root, validation outcome, and health result.
16 changes: 12 additions & 4 deletions docs/DEMO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Three-minute demo runbook

The demo uses a real ZeroClaw trace, a real Telegram or Discord turn, and a
wallet-signed Solana devnet Memo. No slides are used. The preferred story is a
nightly operational control: the agent reports that yesterday's private audit
history has been checkpointed and asks whether the operator wants to anchor it.
A 2:46 English-narrated evidence presentation is published at
`docs/clawledger-demo.mp4`. It shows the real Telegram workflow result, local
verification, wallet approval boundary, finalized Solana proof, test matrix,
and reproduction path without exposing private channel data. The runbook below
documents the privacy-safe live-screen capture sequence for a stronger
supplemental recording.

The live-screen capture should use a real ZeroClaw trace, a real Telegram or
Discord turn, and a wallet-signed Solana devnet Memo. It should not use slides.
The preferred story is a nightly operational control: the agent reports that
yesterday's private audit history has been checkpointed and asks whether the
operator wants to anchor it.

## 0:00–0:25 — The problem

Expand Down
Loading