Skip to content

chore: remove the Boltz savings swap - #2214

Merged
coreyphillips merged 1 commit into
masterfrom
chore/remove-boltz-swap
Dec 1, 2026
Merged

coreyphillips merged 1 commit into
masterfrom
chore/remove-boltz-swap

Conversation

@coreyphillips

Copy link
Copy Markdown
Contributor

Closes #2213
Twin: synonymdev/bitkit-ios#1562

Unblocks the bitkit-core 0.8.0-rc16 bump (synonymdev/bitkit-core#230), which drops the Boltz API. bitkit-core stays on rc15 here.

Description

  • Removes the Boltz savings swap from feat: add boltz savings swap #1081: BoltzService, the swap path in TransferViewModel, SavingsConfirmScreen and SavingsProgressScreen, the swap updates stream in WalletViewModel, SwapsScreen and SwapsViewModel, the Dev Settings toggle and its setting, Env.isSwapSupported, and AmountSlider.
  • Drops the 7 swap only strings from every strings.xml.
  • No changelog fragment: nothing user-facing changes.

Out of Scope

  • Deleting an existing boltz.db. A stored isSavingsSwapEnabled is ignored on read.
  • LightningRepo.payInvoiceWithNode, now used only by tests.

Design

N/A: no user-facing change. The swap was a mainnet Dev Settings option, and transfer to savings closes the channel as it did with the toggle off.

Preview

N/A

QA Notes

Setup

A dev debug build of this branch with a channel open.

Journeys

N/A: no journey changes.

Manual Tests

  • 1. Transfer to savings → confirm → swipe: the channel closes, as on master with the toggle off.
  • 2. Dev Settings has no Swaps section.

Automated Checks

  • removed SwapsViewModelTest.kt, and the swap cases in TransferViewModelTest.kt and WalletViewModelTest.kt
  • updated SavingsConfirmScreenTest.kt

Evidence

  • fbd7145: compileDevDebugKotlin, testDevDebugUnitTest (7191 passed, 0 failed), detekt and lintDevDebug pass.

Gaps

  • Manual tests not run.

@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5 · Keep recovery for existing Boltz swaps before merging.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect the savings-transfer workflow and developer swap tools.

Keep recovery for existing Boltz swaps before merging.

Findings

  1. P1 Pending swaps lose recovery ▶

Summary

Removes the Boltz savings-swap service, screens, settings, routes, strings, and tests. Savings transfers now always use the existing channel-close path.

  • Savings transfers now use Spark withdrawals and channel closes instead of Boltz swaps.
  • Developer settings no longer offer Boltz swap history or controls.

Reviews (1) · Last reviewed commit: "chore: remove the Boltz savings swap" · Reviewed by Greptile

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No findings. Removes the Boltz savings swap (BoltzService, the quote and swap path in TransferViewModel, the updates stream in WalletViewModel, the Swaps screens, the Dev Settings toggle and its setting, AmountSlider), leaving transfer to savings on the channel-close path it already took with the toggle off. Reviewed fbd7145, full tier, statically: not built here, CI is the gate.

What I checked, and 5 candidates I ruled out

Read in full: the diff of TransferViewModel.kt, WalletViewModel.kt, SavingsConfirmScreen.kt, SavingsProgressScreen.kt, ContentView.kt, DevSettingsScreen.kt, SettingsViewModel.kt, SettingsStore.kt, Env.kt, the test changes
Dangling references at the head: none for Boltz*, SavingsSwap*, SavingsTransferMode, Routes.SwapsSettings / SwapDetail, TransferSettling, SavingsSwapToggle; Slider (Quickpay) survives the AmountSlider removal
CI: detect-changes green; build-and-test, lint, compose-ui / ui-tests and build-local still running at the time of review

Ruled out

  • Stored isSavingsSwapEnabled breaking settings decode: SettingsSerializer decodes with the shared json from JsonModule.kt, which sets ignoreUnknownKeys = true, so the stale key is dropped instead of falling back to defaults.
  • A swap in flight when a user upgrades: the reverse swap's preimage stays on the device, so without the claim Boltz cannot settle the hold invoice; the lockup times out and the HTLC fails back. Funds are held until the timeout, not lost, and only a mainnet build with the Dev Settings toggle on could have one.
  • Spark fee timeout: loadSparkWithdrawFee keeps its 15 s bound under the new SPARK_FEE_TIMEOUT, same value as the removed SWAP_QUOTE_TIMEOUT.
  • Strings still in use: none of the 7 removed keys is referenced from Kotlin; lightning__savings_confirm__amount_too_low, still used by SavingsConfirmScreen, is kept.
  • Lost coverage of the Spark fee pin: the removed "closing instead withdraws spark at the fee shown" case is covered by the swipe withdraws spark at the fee it confirmed when spark is priced again before the withdrawal, still in TransferViewModelTest.kt.

Merge confidence: 4/5, no findings, but build-and-test and lint had not finished on fbd7145 when this was written.

Reviewer model: claude-opus-5-5
Reasoning effort: not exposed (the review runner does not report it)

@coreyphillips

Copy link
Copy Markdown
Contributor Author

Not changing

  • @greptile-apps on app/src/main/java/to/bitkit/viewmodels/WalletViewModel.kt:819: The app only ever created reverse swaps (TransferViewModel's createReverseSwap is the sole create call in v3.2.0), and the client holds the preimage for those. If the claim is never broadcast, Boltz cannot settle the hold invoice. It refunds its lockup at timeout and the HTLC fails back, so the sats return to the user's Lightning balance. The worst case is funds held in flight until the swap times out, not funds stuck for good. A recovery path also cannot outlive the bitkit-core rc16 bump this PR unblocks, because rc16 drops the Boltz API. The exposure is mainnet users who turned on dev mode and the Dev Settings toggle and have a swap in flight at upgrade, which doesn't justify holding the bump back.

@github-actions

Copy link
Copy Markdown
Contributor

Regtest APK

Built from fbd7145 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: ✅ Approve

Review: full diff, 34 files.

Findings: None.

QA for fbd7145:

Built and tested a dev debug APK on an Android 16 Pixel 10 Pro emulator with a disposable regtest wallet.

Transfer to savings closes the selected channel ✅ Confirm and swipe initiate a cooperative close.

Manual case 1: transferred 500,000 regtest sats, saw Transfer Successful, and returned home with Spending at zero. The app logs identify a locally initiated cooperative close; LND independently confirmed COOPERATIVE_CLOSE after mining six blocks.

savings-transfer2x.2x.mp4

Dev Settings no longer offers Boltz swaps ✅ The full settings page has no Swaps section or toggle.

Manual case 2: opened and scrolled Dev Settings. The Swaps section, Swaps row and Enable Savings Swap toggle are absent. Separately checked that a stored isSavingsSwapEnabled=true is ignored on read.

dev-settings2x.2x.mp4

No mainnet Boltz swap or Spark withdrawal was driven. Spark fee and selection behavior was checked through the retained unit tests; the two opt-in live Spark exit probes were skipped.

Reviewed the full base-to-head change. Removed swap code and translations, settings decoding, and lifecycle cleanup received static review; the two manual cases cover channel closure and Dev Settings. The earlier recovery concern was withdrawn.

Twin: synonymdev/bitkit-ios#1562 at f50eda7 matches the Boltz removal and preserved channel-close behavior; iOS was compared statically.


Reviewed by gpt-6.1-sol-high

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utAck

@coreyphillips
coreyphillips merged commit b14d333 into master Dec 1, 2026
25 checks passed
@coreyphillips
coreyphillips deleted the chore/remove-boltz-swap branch December 1, 2026 03:24
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.

chore: remove the Boltz savings swap

3 participants