From 09921d3c1292b8927924b3a25d460096a0d5f89a Mon Sep 17 00:00:00 2001 From: Torkel Rogstad Date: Tue, 9 Jun 2026 19:58:42 +0200 Subject: [PATCH] Add sidechain activation data, hash fetching script --- scripts/fetch-sidechain-hashes.sh | 70 +++++++++++++++++++++++++++++++ sidechains/02-bitnames.json | 15 +++++++ sidechains/04-bitassets.json | 15 +++++++ sidechains/09-thunder.json | 15 +++++++ sidechains/13-truthcoin.json | 15 +++++++ sidechains/255-coinshift.json | 15 +++++++ sidechains/98-zside.json | 15 +++++++ sidechains/99-photon.json | 15 +++++++ 8 files changed, 175 insertions(+) create mode 100755 scripts/fetch-sidechain-hashes.sh create mode 100644 sidechains/02-bitnames.json create mode 100644 sidechains/04-bitassets.json create mode 100644 sidechains/09-thunder.json create mode 100644 sidechains/13-truthcoin.json create mode 100644 sidechains/255-coinshift.json create mode 100644 sidechains/98-zside.json create mode 100644 sidechains/99-photon.json diff --git a/scripts/fetch-sidechain-hashes.sh b/scripts/fetch-sidechain-hashes.sh new file mode 100755 index 0000000..6749198 --- /dev/null +++ b/scripts/fetch-sidechain-hashes.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +# +# Populate the BIP300 hash_id_1 / hash_id_2 fields of the sidechains/*.json +# proposal requests from each sidechain's most recent GitHub release. + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +SIDECHAIN_DIR="$REPO_ROOT/sidechains" + +# slot -> github owner/repo of the canonical node software. +declare -A REPOS=( + [2]="LayerTwo-Labs/plain-bitnames" + [4]="LayerTwo-Labs/plain-bitassets" + [9]="LayerTwo-Labs/thunder-rust" + [13]="LayerTwo-Labs/truthcoin-dc" + [98]="iwakura-rein/thunder-orchard" + [99]="LayerTwo-Labs/photon" + [255]="LayerTwo-Labs/coinshift-rs" +) + +command -v gh >/dev/null || { echo "❌ gh (GitHub CLI) is required" >&2; exit 1; } + +shopt -s nullglob +files=("$SIDECHAIN_DIR"/*.json) +shopt -u nullglob +[ ${#files[@]} -gt 0 ] || { echo "❌ no request files in $SIDECHAIN_DIR" >&2; exit 1; } + +for f in "${files[@]}"; do + slot="$(jq -r '.sidechain_id' "$f")" + repo="${REPOS[$slot]:-}" + if [ -z "$repo" ]; then + echo "❌ slot $slot ($(basename "$f")): no repo mapping" >&2 + exit 1 + fi + + # Most recent published release (excludes drafts and pre-releases). + tag="$(gh api "repos/$repo/releases/latest" --jq '.tag_name' 2>/dev/null || true)" + if [ -z "$tag" ]; then + echo "❌ slot $slot ($repo): no published release" >&2 + exit 1 + fi + + # hash_id_2: the 20-byte (40 hex) commit the release tag resolves to. + commit="$(gh api "repos/$repo/commits/$tag" --jq '.sha' 2>/dev/null || true)" + if ! [[ "$commit" =~ ^[0-9a-f]{40}$ ]]; then + echo "❌ slot $slot ($repo@$tag): could not resolve commit" >&2 + exit 1 + fi + + # hash_id_1: sha256 of the release's source tarball. + tarball="$(mktemp)" + if ! curl -fsSL "https://github.com/$repo/archive/refs/tags/$tag.tar.gz" -o "$tarball"; then + echo "❌ slot $slot ($repo@$tag): tarball download failed" >&2 + rm -f "$tarball" + exit 1 + fi + h1="$(shasum -a 256 "$tarball" | cut -d' ' -f1)" + rm -f "$tarball" + + tmp="$(mktemp)" + jq --arg h1 "$h1" --arg h2 "$commit" \ + '.declaration.v0.hash_id_1.hex = $h1 | .declaration.v0.hash_id_2.hex = $h2' \ + "$f" > "$tmp" && mv "$tmp" "$f" + + echo "✅ slot $slot $repo $tag" + echo " hash_id_1 $h1" + echo " hash_id_2 $commit" +done diff --git a/sidechains/02-bitnames.json b/sidechains/02-bitnames.json new file mode 100644 index 0000000..8f2daaa --- /dev/null +++ b/sidechains/02-bitnames.json @@ -0,0 +1,15 @@ +{ + "sidechain_id": 2, + "declaration": { + "v0": { + "title": "BitNames", + "description": "A variant of Namecoin/BitDNS that aims to replace ICANN", + "hash_id_1": { + "hex": "2b4dfd7a97c94502ed88441e917b13533a30929a028568231eacccc6c25daf23" + }, + "hash_id_2": { + "hex": "67a981fe0f2ea78126e7ad94d4f233c5bfdc1575" + } + } + } +} diff --git a/sidechains/04-bitassets.json b/sidechains/04-bitassets.json new file mode 100644 index 0000000..0f95271 --- /dev/null +++ b/sidechains/04-bitassets.json @@ -0,0 +1,15 @@ +{ + "sidechain_id": 4, + "declaration": { + "v0": { + "title": "BitAssets", + "description": "A sidechain for digital assets", + "hash_id_1": { + "hex": "45ae898ac83b47bb4d62b3ea509d2fd0275ebe31ef93da6e32dacd72f8a0912a" + }, + "hash_id_2": { + "hex": "664d418f3523f96e8222999f9fec6686b7a0642d" + } + } + } +} diff --git a/sidechains/09-thunder.json b/sidechains/09-thunder.json new file mode 100644 index 0000000..e594e2d --- /dev/null +++ b/sidechains/09-thunder.json @@ -0,0 +1,15 @@ +{ + "sidechain_id": 9, + "declaration": { + "v0": { + "title": "Thunder", + "description": "A sidechain with a large & growing blocksize, plus fraud proofs", + "hash_id_1": { + "hex": "c46e3297057b396024798ccfe05c4d1488dbc9f14f47af5858f1a81479e3d742" + }, + "hash_id_2": { + "hex": "2559908bfe6e0542edb80078e9c2316c59a0ba30" + } + } + } +} diff --git a/sidechains/13-truthcoin.json b/sidechains/13-truthcoin.json new file mode 100644 index 0000000..93a5563 --- /dev/null +++ b/sidechains/13-truthcoin.json @@ -0,0 +1,15 @@ +{ + "sidechain_id": 13, + "declaration": { + "v0": { + "title": "Truthcoin", + "description": "A sidechain for decentralized prediction markets and oracle data", + "hash_id_1": { + "hex": "3e9f805a57ada7ad062b413c532e268343ee0514fdb65762dcea549de38078ce" + }, + "hash_id_2": { + "hex": "435ce0d2e24196de240db92c27ffd0753bd14b80" + } + } + } +} diff --git a/sidechains/255-coinshift.json b/sidechains/255-coinshift.json new file mode 100644 index 0000000..1b4a525 --- /dev/null +++ b/sidechains/255-coinshift.json @@ -0,0 +1,15 @@ +{ + "sidechain_id": 255, + "declaration": { + "v0": { + "title": "Coinshift", + "description": "Sidechain with a P2P, trustless L2-L1 swap system", + "hash_id_1": { + "hex": "eaef35566f8849b13bd1efeb33f94b00118a549bf3decafcf3e3a64f3a78db5a" + }, + "hash_id_2": { + "hex": "74f7ea60255aeb974c71eb18b2072ddb0215350f" + } + } + } +} diff --git a/sidechains/98-zside.json b/sidechains/98-zside.json new file mode 100644 index 0000000..297c04b --- /dev/null +++ b/sidechains/98-zside.json @@ -0,0 +1,15 @@ +{ + "sidechain_id": 98, + "declaration": { + "v0": { + "title": "zSide", + "description": "Sidechain with private transactions", + "hash_id_1": { + "hex": "ca96e7f0b9d29bae32cce839a7f4792319f98a6dafabd866da786247ad9d14d4" + }, + "hash_id_2": { + "hex": "7be59b90c7c099dc732e3ad82cd77b2abee3c6de" + } + } + } +} diff --git a/sidechains/99-photon.json b/sidechains/99-photon.json new file mode 100644 index 0000000..0cd5016 --- /dev/null +++ b/sidechains/99-photon.json @@ -0,0 +1,15 @@ +{ + "sidechain_id": 99, + "declaration": { + "v0": { + "title": "Photon", + "description": "Sidechain using post-quantum cryptography", + "hash_id_1": { + "hex": "e924266aeaee69e861f0f40ae4108790c32102fdc9005c3a642e0b418c768569" + }, + "hash_id_2": { + "hex": "470285933cd504336a1be30ff929d5dc48296e32" + } + } + } +}