From 28f915dc031abd917601447e796864103ad2fc7c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 27 Jul 2026 08:28:19 +0000 Subject: [PATCH 1/4] Update Liquid mainnet fedpegscript Update MAINNET_FED_SCRIPT to the newly proposed federation script (proposed on-chain in block fe936658c04c22dba2f1df606b6f11041814f95c87e8ca302c62641d3da5b750). Compared to the previous script, the structure is unchanged (11-of-15 federation multisig with a 2-of-3 emergency fallback and identical emergency keys): 4 of the 15 federation pubkeys are rotated and the CSV emergency timeout is raised from 4032 to 8064 blocks. Regenerate the derived test fixtures accordingly: - expectedContract: pegin contract (HMAC-tweaked fedpegscript) for the fixture claim script, computed with the Elements contract-tweak algorithm and cross-checked against the previous fixture values - expected mainchain P2SH address, verified through the go-elements WASM MainChainAddress code path Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01CQrBTWWVTXJCZHhDDeqzVL --- src/index.ts | 2 +- test/fixtures/fixtures.ts | 2 +- test/peginaddress.spec.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index f08b2e7..4c2a9da 100644 --- a/src/index.ts +++ b/src/index.ts @@ -227,7 +227,7 @@ export default class ElementsPegin implements ElementsPeginInterface { '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'; public static MAINNET_FED_SCRIPT = - '5b21020e0338c96a8870479f2396c373cc7696ba124e8635d41b0ea581112b678172612102675333a4e4b8fb51d9d4e22fa5a8eaced3fdac8a8cbf9be8c030f75712e6af992102896807d54bc55c24981f24a453c60ad3e8993d693732288068a23df3d9f50d4821029e51a5ef5db3137051de8323b001749932f2ff0d34c82e96a2c2461de96ae56c2102a4e1a9638d46923272c266631d94d36bdb03a64ee0e14c7518e49d2f29bc401021031c41fdbcebe17bec8d49816e00ca1b5ac34766b91c9f2ac37d39c63e5e008afb2103079e252e85abffd3c401a69b087e590a9b86f33f574f08129ccbd3521ecf516b2103111cf405b627e22135b3b3733a4a34aa5723fb0f58379a16d32861bf576b0ec2210318f331b3e5d38156da6633b31929c5b220349859cc9ca3d33fb4e68aa08401742103230dae6b4ac93480aeab26d000841298e3b8f6157028e47b0897c1e025165de121035abff4281ff00660f99ab27bb53e6b33689c2cd8dcd364bc3c90ca5aea0d71a62103bd45cddfacf2083b14310ae4a84e25de61e451637346325222747b157446614c2103cc297026b06c71cbfa52089149157b5ff23de027ac5ab781800a578192d175462103d3bde5d63bdb3a6379b461be64dad45eabff42f758543a9645afd42f6d4248282103ed1e8d5109c9ed66f7941bc53cc71137baa76d50d274bda8d5e8ffbd6e61fe9a5fae736402c00fb269522103aab896d53a8e7d6433137bbba940f9c521e085dd07e60994579b64a6d992cf79210291b7d0b1b692f8f524516ed950872e5da10fb1b808b5a526dedc6fed1cf29807210386aa9372fbab374593466bc5451dc59954e90787f08060964d95c87ef34ca5bb53ae68'; + '5b21020e0338c96a8870479f2396c373cc7696ba124e8635d41b0ea581112b678172612103101440dac1411f7561dbcabedf1827b6517b4a78127c78fa5bc0f28d7f80c35821021fad939f956beae2e6765b450552f1a75236c8b7314ec30474d8f4978b252ab22103db6f3d90f9820cb7aa1c58f0ed84cca7a84bfe166e68061af1063834342c4c9d2102a4e1a9638d46923272c266631d94d36bdb03a64ee0e14c7518e49d2f29bc401021031c41fdbcebe17bec8d49816e00ca1b5ac34766b91c9f2ac37d39c63e5e008afb2102e323a079079582cf6bb68583df94bd68c9590e5904062b503ef5476109ad739e2103111cf405b627e22135b3b3733a4a34aa5723fb0f58379a16d32861bf576b0ec2210318f331b3e5d38156da6633b31929c5b220349859cc9ca3d33fb4e68aa08401742103230dae6b4ac93480aeab26d000841298e3b8f6157028e47b0897c1e025165de121035abff4281ff00660f99ab27bb53e6b33689c2cd8dcd364bc3c90ca5aea0d71a62103bd45cddfacf2083b14310ae4a84e25de61e451637346325222747b157446614c2103cc297026b06c71cbfa52089149157b5ff23de027ac5ab781800a578192d175462103d3bde5d63bdb3a6379b461be64dad45eabff42f758543a9645afd42f6d4248282103ed1e8d5109c9ed66f7941bc53cc71137baa76d50d274bda8d5e8ffbd6e61fe9a5fae736402801fb269522103aab896d53a8e7d6433137bbba940f9c521e085dd07e60994579b64a6d992cf79210291b7d0b1b692f8f524516ed950872e5da10fb1b808b5a526dedc6fed1cf29807210386aa9372fbab374593466bc5451dc59954e90787f08060964d95c87ef34ca5bb53ae68'; } async function runGoWASMinstance() { diff --git a/test/fixtures/fixtures.ts b/test/fixtures/fixtures.ts index 58d524b..221b3ab 100644 --- a/test/fixtures/fixtures.ts +++ b/test/fixtures/fixtures.ts @@ -4,7 +4,7 @@ export const peginContractFixture = { redeemScript: ElementsPegin.MAINNET_FED_SCRIPT, script: '001415d1f6d9c9cc4e048f856af3b2f2e50dc384cbcc', expectedContract: - '5b210206fe07cb2591f0bd1f7ec13bafb8d3bf1da915dcd727060572379782d115422121027ecf5980215bb62114a7b3dbaa42d4695a3ee37867943a04291b5232a05285012103c159f4a203fddd977ec2dd1ec80bcfaecf1c5ca66fc1b54c3a58e9ab639cc66c2102cef9f9e7946da156b2048ef0ac5e4a1bc965322567ad662fb1474413bc67b77e21033f622c9ce087d35f4cd59d34addf9c28cc478de3a0ed7015fe12c8e012d279ee21022d2e5404b279abc5920d92640306349630b7d2254a5de6099ca14354f04104f72103f7d158cd860ff5138373954ae3466f8c3e68f2016011bef403385130204f4de52103f82f342379cbd40c889c3e64e32f347d4b4a5d844a75a976a75d9a9fcb88058f2102595bcae222be9e6df738a35ad9b896412ff5b13f5d970058fab760fe56c3180d2103d22869557e1a2fc075b0b237eb78617333e4e2a820e2bf51e8ae7fce7eace6512102fca45e9193a4b2cb135fab5407de3fa89220a6c358ec2e1af9c03c3819ff0114210215d93d98f2e57308317d843ffc7a8b665793a4f58634e4ace72d9f8cd4a2bc852103a716c3246bbf0c74a502e7893d2c8327bc466797e28785fea153b78ff9b63df0210334af6ebc5d342a031bec4a3c3af58f6856296996b2dbd09de84d5f7434599dca21025577978f899ac66e9003c85b5ae47afebd8ef0c1b1ec076833d08bdd53fd416c5fae736402c00fb269522102d2e45406042c1e29b3caa49b4240c78d5d384a56176ddcc781689d010180069e210354015629edfa5c6c59237a7be02700c03c968d6328203b70a76cf9b329f1fd8e21020dd33753c1fa0a6e42ba761bd9969c6a250879f7bf40e232ebc708bf07da2e6153ae68', + '5b210206fe07cb2591f0bd1f7ec13bafb8d3bf1da915dcd727060572379782d1154221210242bd9c09b5c8fd7bf4c21e9bd37303e72a5c340c7f18c717d53affbfa3467665210290fc7c72f3cbdbf846758114f699a75b6a458af3e68b92b9b0104095b8c10a2b2102fb796fc451f7ab1b5299e0700f359be354bf23f5aa21f3ee2d1018db421f358b21033f622c9ce087d35f4cd59d34addf9c28cc478de3a0ed7015fe12c8e012d279ee21022d2e5404b279abc5920d92640306349630b7d2254a5de6099ca14354f04104f721033c72d8614016436d2801c2c8120b5ad96a45c53848ebaeaaf6de4b9ce6349d3c2103f82f342379cbd40c889c3e64e32f347d4b4a5d844a75a976a75d9a9fcb88058f2102595bcae222be9e6df738a35ad9b896412ff5b13f5d970058fab760fe56c3180d2103d22869557e1a2fc075b0b237eb78617333e4e2a820e2bf51e8ae7fce7eace6512102fca45e9193a4b2cb135fab5407de3fa89220a6c358ec2e1af9c03c3819ff0114210215d93d98f2e57308317d843ffc7a8b665793a4f58634e4ace72d9f8cd4a2bc852103a716c3246bbf0c74a502e7893d2c8327bc466797e28785fea153b78ff9b63df0210334af6ebc5d342a031bec4a3c3af58f6856296996b2dbd09de84d5f7434599dca21025577978f899ac66e9003c85b5ae47afebd8ef0c1b1ec076833d08bdd53fd416c5fae736402801fb269522102d2e45406042c1e29b3caa49b4240c78d5d384a56176ddcc781689d010180069e210354015629edfa5c6c59237a7be02700c03c968d6328203b70a76cf9b329f1fd8e21020dd33753c1fa0a6e42ba761bd9969c6a250879f7bf40e232ebc708bf07da2e6153ae68', }; export const claimTxFixture = { diff --git a/test/peginaddress.spec.ts b/test/peginaddress.spec.ts index e858248..71b43a2 100644 --- a/test/peginaddress.spec.ts +++ b/test/peginaddress.spec.ts @@ -21,7 +21,7 @@ describe('getpeginaddress', () => { const address = await peginModule.getMainchainAddress( peginContractFixture.script ); - assert.strictEqual(address, '3AV836ASdCs6k25KjFweWxXNKyJdNx2tFh'); + assert.strictEqual(address, '3HfF9gFpqZPxfGe4rtwWD7nxFpvrL6xZq5'); }); it('should return pegin address (P2WSH with dynafed = true)', async () => { From 3beece84bb10867409b38f7c7a3c9fd1a234e3a2 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 27 Jul 2026 12:08:10 +0000 Subject: [PATCH 2/4] Fix and modernize CI The libwally Docker build broke because Debian buster reached EOL and its apt repositories moved to archive.debian.org, so every CI run failed at `make build` before running any tests. Point the buster image's apt sources at the archive (with Check-Valid-Until disabled, as the archived Release files are past their validity window) and drop the no-longer-served buster-updates entry. Also modernize the workflow: - Node 14.x/16.x matrix -> Node 22.x - actions/checkout@v2 -> v4, actions/setup-node@v1 -> v4 (both old versions run on a deprecated Node runtime) - replace bahmutov/npm-install with `npm ci` + setup-node's built-in npm cache Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01CQrBTWWVTXJCZHhDDeqzVL --- .github/workflows/main.yml | 13 +++++++------ scripts/buster_deps.sh | 9 ++++++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5250b65..fb83aab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,26 +11,27 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: ["14.x", "16.x"] + node: ["22.x"] steps: - name: Reconfigure git to use HTTP authentication - run: > + run: > git config --global url."https://github.com/".insteadOf ssh://git@github.com/ - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: persist-credentials: false - name: Use Node ${{ matrix.node }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} + cache: npm - - name: Install deps and build (with cache) - uses: bahmutov/npm-install@v1 + - name: Install deps + run: npm ci - name: Lint run: npm run lint diff --git a/scripts/buster_deps.sh b/scripts/buster_deps.sh index 0bdcb8c..d97c09d 100755 --- a/scripts/buster_deps.sh +++ b/scripts/buster_deps.sh @@ -3,7 +3,14 @@ set -e dpkg --add-architecture i386 -apt-get update -qq +# buster is EOL and its packages moved to archive.debian.org +sed -i \ + -e 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' \ + -e 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' \ + /etc/apt/sources.list +sed -i '/buster-updates/d' /etc/apt/sources.list + +apt-get -o Acquire::Check-Valid-Until=false update -qq apt-get upgrade -yqq apt-get install git uncrustify python{,3}-distutils-extra python{,3}-dev build-essential libffi-dev swig autoconf libtool pkg-config lib32z1 openjdk-11-jdk ca-certificates-java unzip curl libc6:i386 libc6-dev:i386 libncurses5:i386 libstdc++6:i386 lib32z1 virtualenv python{,3}-setuptools apt-transport-https -yqq update-java-alternatives -s java-1.11.0-openjdk-amd64 From 0b6d850a911102fac5bca1852c6978746da61131 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 27 Jul 2026 12:12:43 +0000 Subject: [PATCH 3/4] Fix npm ci on modern npm: mark tiny-secp256k1 install script in lockfile The lockfile entry for tiny-secp256k1 was missing the "hasInstallScript" flag, so npm >= 7 does not run the package's own guarded install script ("node-gyp rebuild || echo ..."), and instead injects the default `node-gyp rebuild` because the package ships a binding.gyp. The native build has always failed (nan 2.13 predates modern V8) and is designed to fall back to the pure JS implementation, but without the guard the failure aborts `npm ci`. Setting the flag makes npm run the package's actual install script again, restoring the non-fatal fallback behavior npm 6 had. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01CQrBTWWVTXJCZHhDDeqzVL --- package-lock.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package-lock.json b/package-lock.json index 6ee863c..f722daf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11990,6 +11990,7 @@ "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz", "integrity": "sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA==", "dev": true, + "hasInstallScript": true, "dependencies": { "bindings": "^1.3.0", "bn.js": "^4.11.8", From 5ac8701dc7ece69e717b1dbcfaa800a1e4adb973 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 27 Jul 2026 12:15:55 +0000 Subject: [PATCH 4/4] Pin emsdk clone to the 2.0.9 tag The libwally image installs emscripten 2.0.9 but cloned emsdk master, whose installer scripts now require python >= 3.10 while buster ships 3.7. Clone the emsdk 2.0.9 tag instead so the installer scripts match the era of the toolchain being installed. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01CQrBTWWVTXJCZHhDDeqzVL --- scripts/buster_deps.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/buster_deps.sh b/scripts/buster_deps.sh index d97c09d..8c74ef3 100755 --- a/scripts/buster_deps.sh +++ b/scripts/buster_deps.sh @@ -15,7 +15,9 @@ apt-get upgrade -yqq apt-get install git uncrustify python{,3}-distutils-extra python{,3}-dev build-essential libffi-dev swig autoconf libtool pkg-config lib32z1 openjdk-11-jdk ca-certificates-java unzip curl libc6:i386 libc6-dev:i386 libncurses5:i386 libstdc++6:i386 lib32z1 virtualenv python{,3}-setuptools apt-transport-https -yqq update-java-alternatives -s java-1.11.0-openjdk-amd64 -git clone https://github.com/juj/emsdk.git +# pin emsdk to the same release we install: current emsdk requires +# python >= 3.10, newer than buster's python 3.7 +git clone --branch 2.0.9 --depth 1 https://github.com/emscripten-core/emsdk.git cd emsdk ./emsdk install 2.0.9 ./emsdk activate 2.0.9