From 68fd614f8cb404904e1939ab711f7c7ba4350c32 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 5 Aug 2026 12:24:03 -0700 Subject: hal speaks pver 5: preimages prove their size, and fees round up as one 0.6.0 servers require the new hashlock clauses (OP_SIZE 32 guard) for Lightning and rounds. New policies/transitions carry the v1 scripts and type bytes; _v0 variants keep old vtxos reconstructing and exiting. The retired third-party HTLC policy is dropped (upstream took 0x08). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01M5kFodm9azZJVTQxnkDdKe --- src/ark/validate.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ark/validate.js') diff --git a/src/ark/validate.js b/src/ark/validate.js index d09f6ec..fae3465 100644 --- a/src/ark/validate.js +++ b/src/ark/validate.js @@ -77,10 +77,11 @@ export async function validateVtxo(vtxo, { serverPubkey, chain, expectPubkeys, a const sig = hex.decode(t.signature); let msg, key; - if (t.type === 'hashLockedCosigned') { + if (t.type === 'hashLockedCosigned' || t.type === 'hashLockedCosigned_v0') { // script-spend through the unlock clause; signed by the raw agg key const hash = t.unlock.hash ? hex.decode(t.unlock.hash) : sha256(hex.decode(t.unlock.preimage)); - const tp = harkLeafTaproot(hex.decode(t.userPubkey), serverPubkey, vtxo.expiryHeight, hash); + const gen = t.type === 'hashLockedCosigned' ? 1 : 0; + const tp = harkLeafTaproot(hex.decode(t.userPubkey), serverPubkey, vtxo.expiryHeight, hash, gen); msg = taprootScriptSighash(tx, [prevout], tapLeafHash(tp.unlockScript)); key = tp.internalXOnly; if (!t.unlock.preimage) fail(`transition ${i} has no unlock preimage`); -- cgit v1.2.3