Skip to content

Boltz swap : offline receive#609

Open
louisinger wants to merge 3 commits into
masterfrom
swap-offline-receive
Open

Boltz swap : offline receive#609
louisinger wants to merge 3 commits into
masterfrom
swap-offline-receive

Conversation

@louisinger
Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Warning

Rate limit exceeded

@louisinger has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 9 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 64049131-5799-4cc1-9035-673f7c1b0aa5

📥 Commits

Reviewing files that changed from the base of the PR and between 7066839 and 81f2545.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • package.json
  • src/lib/logs.ts
  • src/providers/swaps.tsx
  • src/vite-env.d.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch swap-offline-receive

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread src/providers/swaps.tsx
testnet: null,
}

const BANCOD_URL = import.meta.env.VITE_BANCOD_URL
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this used for?

Copy link
Copy Markdown

@arkanaai arkanaai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Boltz swap — offline receive (wallet#609)

This PR wires the offline-receive feature from boltz-swap#141 into the wallet UI. The wallet-side changes are thin — pass-through of offlineReceiveOptions to two swap creation calls. The protocol-critical logic lives in boltz-swap, which I already reviewed with changes requested (boltz-swap#141).


🔴 Blocking: Dependency pinned to unmerged branch

package.json:7

"@arkade-os/boltz-swap": "github:arkade-os/boltz-swap#offline-receive"

This pins to a moving branch target that has outstanding changes requested on boltz-swap#141 (orphaned swap on registerOfflineReceive failure, missing claimAddress validation, Buffer usage in browser context). This wallet PR inherits all those bugs.

This PR must not merge until boltz-swap#141 is merged and published as a proper semver release. The dependency should then be pinned to that version, not a git branch.


🟡 Medium: No validation of VITE_BOLTZ_INTROSPECTOR_PUBKEY format

src/providers/swaps.tsx:34-38

const BANCOD_URL = import.meta.env.VITE_BANCOD_URL
const BOLTZ_INTROSPECTOR_PUBKEY = import.meta.env.VITE_BOLTZ_INTROSPECTOR_PUBKEY
const offlineReceiveOptions =
  BANCOD_URL && BOLTZ_INTROSPECTOR_PUBKEY
    ? { bancodUrl: BANCOD_URL, introspectorPubkey: BOLTZ_INTROSPECTOR_PUBKEY }
    : undefined

introspectorPubkey is a hex-encoded secp256k1 public key that directly controls who can claim VHTLCs. A malformed value (wrong length, non-hex, invalid point) will produce a confusing error deep in the swap flow rather than failing fast at init.

Add basic validation:

if (BOLTZ_INTROSPECTOR_PUBKEY && !/^[0-9a-fA-F]{64,66}$/.test(BOLTZ_INTROSPECTOR_PUBKEY)) {
  console.error('Invalid VITE_BOLTZ_INTROSPECTOR_PUBKEY — expected 32 or 33 byte hex pubkey')
}

🟡 Medium: Offline receive silently changes custody model with no user signal

src/providers/swaps.tsx:222, :271-274

When offlineReceiveOptions is defined (env vars are set), every BTC→ARK and reverse swap silently delegates VHTLC claiming to bancod. The user has no visibility or opt-in. This is a significant trust change — the user is now trusting a third-party solver with preimage custody.

Consider:

  • Making this opt-in per swap, or at least surfacing it in the UI
  • At minimum, logging when offline receive mode is active

🟢 Minor: console.error change is good

src/lib/logs.ts:50 — Adding the raw error object to console.error improves debuggability. No issues.


🟢 Minor: Type declarations are correct

src/vite-env.d.ts:10-11 — Both new env vars correctly typed as string | undefined. Fine.


Summary

The wallet-side integration is straightforward — it's a thin pass-through. The real risk is in the dependency:

  1. boltz-swap#141 must merge first with the critical fixes I flagged there (orphaned swap on registration failure, claimAddress validation)
  2. Pin to a published version, not a git branch
  3. Validate the introspector pubkey at init time
  4. Consider user consent for the changed custody model

🏷️ Protocol-critical — this delegates VHTLC claiming to a third-party solver. Human review required.

Comment thread src/lib/logs.ts
const str = (msg ? `${msg}: ` : '') + extractError(err)
addLog(LogLevel.Error, [str])
console.error(str)
console.error(str, err)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems better to have dedciate PR for this?

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 7, 2026

Deploying wallet-bitcoin with  Cloudflare Pages  Cloudflare Pages

Latest commit: 81f2545
Status: ✅  Deploy successful!
Preview URL: https://4e77d19c.wallet-bitcoin.pages.dev
Branch Preview URL: https://swap-offline-receive.wallet-bitcoin.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 7, 2026

Deploying tmp-boltz-upstream-mainnet-arkade-wallet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 81f2545
Status: ✅  Deploy successful!
Preview URL: https://3864390a.tmp-boltz-upstream-mainnet-arkade-wallet.pages.dev
Branch Preview URL: https://swap-offline-receive.tmp-boltz-upstream-mainnet-arkade-wallet.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 7, 2026

Deploying wallet-mutinynet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 81f2545
Status: ✅  Deploy successful!
Preview URL: https://5547e075.arkade-wallet.pages.dev
Branch Preview URL: https://swap-offline-receive.arkade-wallet.pages.dev

View logs

Copy link
Copy Markdown

@arkanaai arkanaai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up review: merge commit 81f2545

Reviewed the new commit — it's a routine merge of origin/master into the feature branch. The merge brings in a TailwindCSS/Sonner UI refactor, SDK bump to 0.4.25, and VITE_DEV_NSEC env var. None of the swap-related feature files (src/providers/swaps.tsx, src/lib/logs.ts) were modified.

All my previous findings still stand:

  1. 🔴 Blocking: boltz-swap#141 is still open with changes requested — this PR must not merge until that dependency ships as a versioned release
  2. 🟡 Validate VITE_BOLTZ_INTROSPECTOR_PUBKEY at init
  3. 🟡 User consent for changed custody model

No new issues introduced by this merge commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants