From 6383ead744d8f710cddba3953b21e08c52c73e69 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 30 Aug 2026 20:01:37 -0700 Subject: The Max sweep's stand-in taproot program takes the x-only 32 bytes — the compressed point's parity byte made an invalid witness program and Max fell to zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr --- src/features/ark.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/features') diff --git a/src/features/ark.js b/src/features/ark.js index 0e307b1..8d71ada 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -2331,7 +2331,8 @@ export function arkFeature(ctx) { try { const feeRate = (wallet.feeRates && wallet.feeRates.halfHourFee) || 5; const hrp = { bitcoin: 'bc', regtest: 'bcrt' }[ark && ark.info && ark.info.network] || 'tb'; - const dest = ark ? p2trAddress(ark._key(0).pubkey, hrp) : wallet.freshChange().address; + // _key() hands back a compressed point; the witness program is x-only + const dest = ark ? p2trAddress(ark._key(0).pubkey.slice(1), hrp) : wallet.freshChange().address; const draft = wallet.buildTx({ recipients: [{ address: dest, amount: 0 }], feeRate, sendMax: true }); return Math.max(0, (draft.outputs[0]?.amount || 0)); } catch { -- cgit v1.2.3