aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-30 20:01:37 -0700
committerAdam Soltys <[email protected]>2026-08-30 20:01:37 -0700
commit6383ead744d8f710cddba3953b21e08c52c73e69 (patch)
tree499e2535439003335669d96c91c158d0e8709b13 /src/features
parentb64eb328134503865500ccf8ab58741fea864452 (diff)
downloadcoinosv3-6383ead744d8f710cddba3953b21e08c52c73e69.tar.gz
coinosv3-6383ead744d8f710cddba3953b21e08c52c73e69.zip
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
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr
Diffstat (limited to 'src/features')
-rw-r--r--src/features/ark.js3
1 files changed, 2 insertions, 1 deletions
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 {