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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Setup Node.js 22
uses: actions/setup-node@v7
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: "22"

- name: Setup Python 3
uses: actions/setup-python@v7
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
with:
python-version: "3.12"

Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
 · 
<a href="SHA256SUMS.txt"><strong>Verify SHA-256</strong></a>
&nbsp;·&nbsp;
<a href="SHA256SUMS.txt.ots"><strong>Bitcoin Timestamp (.ots)</strong></a>
<a href="release-proofs/v1.0/SHA256SUMS.txt.ots"><strong>Bitcoin Timestamp (.ots)</strong></a>
</p>

<p align="center">
<code>SegWit v0 P2WSH</code> · <code>BIP-68 CSV</code> · <code>BIP-174 PSBT</code> · <code>BIP-380 Miniscript</code> · <code>BBQr Airgap</code> · <code>OpenTimestamps</code> · <code>Zero Custody</code>
</p>

> **Timestamped in Bitcoin ([OpenTimestamps](https://opentimestamps.org)):** Clawback v1.0 release checksums at commit [`69b9035`](https://github.com/Random21m/clawback/commit/69b9035fa7ee427f7fc0616c471bb4e7a316d787) ([`SHA256SUMS.txt`](SHA256SUMS.txt), SHA-256 `e44e7a8dd2fe70567b7151e616fb6fe5c63cc70ec2bd29820e8b922523131fc1` — covering standalone `clawback.html` `3b0a5dd8…687c7607`, `index.html`, `sw.js`, and `manifest.webmanifest`) are cryptographically anchored in **Bitcoin Block [`978,244`](https://mempool.space/block/000000000000000000019db39c8d2b067d0611b036c3ff9fa5a026bdbcc88dde)** (**30 November 2026 at 21:39:19 UTC**, Merkle root `76d264f2…a09222c9`). The upgraded, complete proof is committed in [`SHA256SUMS.txt.ots`](SHA256SUMS.txt.ots) — verify locally with `git show 69b9035:SHA256SUMS.txt > SHA256SUMS.txt && ots verify SHA256SUMS.txt.ots` (later commits rebuild the files and carry newer checksums; the proof attests the checksum file as of that commit) or online at [opentimestamps.org](https://opentimestamps.org).
> **Timestamped in Bitcoin ([OpenTimestamps](https://opentimestamps.org)):** the v1.0 release checksums at commit [`69b9035`](https://github.com/Random21m/clawback/commit/69b9035fa7ee427f7fc0616c471bb4e7a316d787) ([`release-proofs/v1.0/SHA256SUMS.txt`](release-proofs/v1.0/SHA256SUMS.txt), SHA-256 `e44e7a8dd2fe70567b7151e616fb6fe5c63cc70ec2bd29820e8b922523131fc1`) are cryptographically anchored in **Bitcoin Block [`978,244`](https://mempool.space/block/000000000000000000019db39c8d2b067d0611b036c3ff9fa5a026bdbcc88dde)** (**30 November 2026 at 21:39:19 UTC**, Merkle root `76d264f2…a09222c9`). The complete proof is [`release-proofs/v1.0/SHA256SUMS.txt.ots`](release-proofs/v1.0/SHA256SUMS.txt.ots) — verify with `cd release-proofs/v1.0 && ots verify SHA256SUMS.txt.ots` or online at [opentimestamps.org](https://opentimestamps.org). The root [`SHA256SUMS.txt`](SHA256SUMS.txt) tracks the current build and is **not yet timestamped** (only the v1.0 release is); stamp it with `ots stamp SHA256SUMS.txt`, then `ots upgrade SHA256SUMS.txt.ots` once a Bitcoin block confirms it.

<p align="center">
<a href="https://random21m.github.io/clawback/">
Expand Down Expand Up @@ -143,13 +143,15 @@ Audit any Vault Package completely offline (re-verifying every script hash, BIP-
[`clawback.html`](clawback.html) is a **single, completely self-contained ≈539 KB HTML file** with all cryptography, PSBT codecs, QR encoder/decoder, and UI inlined—zero external CDNs, zero telemetry.

```bash
# 1. Download clawback.html, SHA256SUMS.txt, and its OpenTimestamps proof
# 1. Download clawback.html and the current build checksums, then verify integrity
curl -LO https://raw.githubusercontent.com/Random21m/clawback/main/clawback.html
curl -LO https://raw.githubusercontent.com/Random21m/clawback/main/SHA256SUMS.txt
curl -LO https://raw.githubusercontent.com/Random21m/clawback/main/SHA256SUMS.txt.ots

# 2. Verify cryptographic integrity & Bitcoin timestamp proof
sha256sum -c --ignore-missing SHA256SUMS.txt

# 2. (Optional) Verify the v1.0 release's Bitcoin timestamp proof, kept in its own folder
mkdir -p v1.0 && cd v1.0
curl -LO https://raw.githubusercontent.com/Random21m/clawback/main/release-proofs/v1.0/SHA256SUMS.txt
curl -LO https://raw.githubusercontent.com/Random21m/clawback/main/release-proofs/v1.0/SHA256SUMS.txt.ots
ots verify SHA256SUMS.txt.ots # (or verify online at https://opentimestamps.org)
```

Expand Down Expand Up @@ -200,7 +202,7 @@ Clawback's transaction engine has been verified against both our strict consensu

* **[`TUTORIAL.md`](TUTORIAL.md)** — **The Complete 12-Chapter Engineering & Operations Manual**: Deep dive into the July 2026 Coldcard incident, full script execution traces, airgapped Tails setup, step-by-step Signet rehearsal, Coldcard + SeedSigner production setup, Umbrel/Start9 Watchtower configuration, 60-second Emergency Clawback Playbook, Sparrow/Bitcoin Core disaster recovery, and full threat model matrix.
* **[`SECURITY.md`](SECURITY.md)** — Core operational invariants and safety rules.
* **[`SHA256SUMS.txt`](SHA256SUMS.txt)** & **[`SHA256SUMS.txt.ots`](SHA256SUMS.txt.ots)** — Reproducible build hashes + Bitcoin OpenTimestamps proof.
* **[`SHA256SUMS.txt`](SHA256SUMS.txt)** — Reproducible build hashes. **[`release-proofs/v1.0/`](release-proofs/v1.0/)** — the v1.0 checksums with their Bitcoin OpenTimestamps proof.

---

Expand Down
8 changes: 4 additions & 4 deletions SHA256SUMS.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
30ae80944a6de5672d896466f6644fb7e91ca0cafdcb36e76f0d81579cee70cc clawback.html
9370eb86a94de6d39b041daa9bf501319c8441890903e75e14de54f84b23ab41 index.html
b1a3be025e82e661f659c54a85e048ac7fc5db049163d434defe8bbf879ebeb6 sw.js
fa0318c50581e62ac668c861532aa17ea8c620b6cb62e257bf2e262b638f1e53 manifest.webmanifest
5b0fef270ce36f5cb720f77621773dae03835a0ee6ecd8aafe5e22458bdb44ce clawback.html
171ebf82767bcf27e5a14f5080636a7359b610265b2f98c01b696b0d0fef5d10 index.html
5f5a42775e2f68f91a43331c39ab81086c992b182335ab9d5372cd678edd2ae6 sw.js
c9fcf82f9f7e980a5fb67ef7cd68db644911d72cf745851a004f98d6516138a1 manifest.webmanifest
Binary file added assets/icon-maskable-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,27 @@ def render_canvas(opaque_square=False):
opaque_img.resize((180, 180), Image.Resampling.LANCZOS).save(ASSETS / "apple-touch-icon.png", "PNG", optimize=True)


def make_maskable_icon():
"""Maskable PWA icon: the existing icon centred on a full-bleed background inside the 80% safe zone."""
try:
from PIL import Image
except ImportError:
print("Pillow not installed — skipping maskable icon.")
return
src = Image.open(ASSETS / "icon-512.png").convert("RGBA")
size = 512
canvas = Image.new("RGBA", (size, size), (28, 33, 43, 255)) # same slate as the icon background
inner = int(size * 0.66)
glyph = src.resize((inner, inner), Image.Resampling.LANCZOS)
canvas.alpha_composite(glyph, ((size - inner) // 2, (size - inner) // 2))
canvas.convert("RGB").save(ASSETS / "icon-maskable-512.png", "PNG", optimize=True)


def build(regenerate_icons=False):
# PNG output depends on the Pillow version, so icons are only regenerated on request (--icons)
if regenerate_icons:
generate_crab_icons()
make_maskable_icon()

html = (SRC / "index.html").read_text(encoding="utf-8")
css = (SRC / "styles.css").read_text(encoding="utf-8")
Expand Down Expand Up @@ -222,6 +239,7 @@ def build(regenerate_icons=False):
ASSETS / "icon-32.png",
ASSETS / "icon-192.png",
ASSETS / "icon-512.png",
ASSETS / "icon-maskable-512.png",
ASSETS / "apple-touch-icon.png",
):
sw_hash.update(p.read_bytes())
Expand Down
7 changes: 5 additions & 2 deletions clawback.html
Original file line number Diff line number Diff line change
Expand Up @@ -15641,11 +15641,14 @@ <h3 id="support-modal-title" class="card-title">Support Clawback</h3>
}
}

async function apiGetJson(url, retries = 1) {
async function apiGetJson(url, retries = 3) {
for (let attempt = 0; attempt <= retries; attempt++) {
const res = await fetchWithTimeout(url, { method: "GET" });
if ((res.status === 429 || res.status >= 500) && attempt < retries) {
await new Promise((r) => setTimeout(r, 600 * (attempt + 1)));
// Exponential backoff, honouring Retry-After (seconds) when the server sends it, capped at 10 s
const ra = Number(res.headers && res.headers.get && res.headers.get("retry-after"));
const wait = Number.isFinite(ra) && ra > 0 ? ra * 1000 : 600 * Math.pow(2, attempt);
await new Promise((r) => setTimeout(r, Math.min(wait, 10000)));
continue;
}
const body = await res.text().catch(() => "");
Expand Down
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15644,11 +15644,14 @@ <h3 id="support-modal-title" class="card-title">Support Clawback</h3>
}
}

async function apiGetJson(url, retries = 1) {
async function apiGetJson(url, retries = 3) {
for (let attempt = 0; attempt <= retries; attempt++) {
const res = await fetchWithTimeout(url, { method: "GET" });
if ((res.status === 429 || res.status >= 500) && attempt < retries) {
await new Promise((r) => setTimeout(r, 600 * (attempt + 1)));
// Exponential backoff, honouring Retry-After (seconds) when the server sends it, capped at 10 s
const ra = Number(res.headers && res.headers.get && res.headers.get("retry-after"));
const wait = Number.isFinite(ra) && ra > 0 ? ra * 1000 : 600 * Math.pow(2, attempt);
await new Promise((r) => setTimeout(r, Math.min(wait, 10000)));
continue;
}
const body = await res.text().catch(() => "");
Expand Down
6 changes: 6 additions & 0 deletions manifest.webmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
"type": "image/png",
"purpose": "any"
},
{
"src": "assets/icon-maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "assets/apple-touch-icon.png?v=2",
"sizes": "180x180",
Expand Down
4 changes: 4 additions & 0 deletions release-proofs/v1.0/SHA256SUMS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
3b0a5dd8d41a8abe7ca7cf35bb5ab4c5c90364bd3c5f123708e6088a687c7607 clawback.html
0fd1cd3e152bfe1808b045d2544ec35216c464df6e72439ef9e3be7457f3b99b index.html
2d4644df6a41a9afdf48dd4dc93263c2c945cb82fd2ba561ac70e4b971a5c32f sw.js
c98a5d9112489acd8d72a90b9227883d757384ecc971b75f877becd3417fcbf9 manifest.webmanifest
File renamed without changes.
7 changes: 5 additions & 2 deletions src/watchtower.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,14 @@
}
}

async function apiGetJson(url, retries = 1) {
async function apiGetJson(url, retries = 3) {
for (let attempt = 0; attempt <= retries; attempt++) {
const res = await fetchWithTimeout(url, { method: "GET" });
if ((res.status === 429 || res.status >= 500) && attempt < retries) {
await new Promise((r) => setTimeout(r, 600 * (attempt + 1)));
// Exponential backoff, honouring Retry-After (seconds) when the server sends it, capped at 10 s
const ra = Number(res.headers && res.headers.get && res.headers.get("retry-after"));
const wait = Number.isFinite(ra) && ra > 0 ? ra * 1000 : 600 * Math.pow(2, attempt);
await new Promise((r) => setTimeout(r, Math.min(wait, 10000)));
continue;
}
const body = await res.text().catch(() => "");
Expand Down
3 changes: 2 additions & 1 deletion sw.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const CACHE_NAME = "clawback-pwa-ea2f9cb4";
const CACHE_NAME = "clawback-pwa-e3e6b7b2";
const STATIC_ASSETS = [
"./manifest.webmanifest",
"./assets/logo.svg",
"./assets/icon-32.png",
"./assets/icon-192.png",
"./assets/icon-512.png",
"./assets/icon-maskable-512.png",
"./assets/apple-touch-icon.png",
];
const PRECACHE = ["./", "./index.html", ...STATIC_ASSETS];
Expand Down