Repository navigation
Open
Description
Motivation
The Boltz swap service has been shut down, so the boltz module can no longer complete a swap. Remove it from bitkit-core completely: the Rust code, the UniFFI surface, the boltz-client dependency, the generated iOS interface, and the docs.
Current behavior (verified on master at 98b0791)
src/modules/boltz/holds about 3,100 lines across 14 files:api.rs,claim.rs,client.rs,db.rs,errors.rs,guard.rs,listener.rs,models.rs,refund.rs,tests.rs,types.rs,validation.rs,mod.rsandREADME.md. It is registered insrc/modules/mod.rs:3.src/lib.rs:- Imports at lines 41-44.
- Public re-export
pub use modules::boltz as boltz_swaps;at line 93. boltz_db: Option<Arc<BoltzDB>>field onAsyncDatabaseConnectionsat line 121.init_dbcreates{base_path}/boltz.dband stores the handle (lines 506, 516, 530).- The "Boltz swaps" section (about lines 3476-3741) holds the helpers
get_boltz_dbandboltz_runtime_err, plus 11#[uniffi::export]functions:boltz_get_submarine_limits,boltz_get_reverse_limits,boltz_create_submarine_swap,boltz_create_reverse_swap,boltz_list_swaps,boltz_list_pending_swaps,boltz_get_swap,boltz_claim_reverse_swap,boltz_refund_submarine_swap,boltz_start_swap_updates,boltz_stop_swap_updates.
src/modules/activity/types.rsimportsBoltzError(line 3).DbErrorhas aDbBoltzError { error_details: BoltzError }variant (lines 311-312) and animpl From<BoltzError> for DbError(lines 334-340). TheFromimpl exists soinit_dbcan use?onBoltzDB::new.- Exported UniFFI types:
BoltzNetwork,BoltzSwapType,BoltzSwapStatus,BoltzPairInfo,SubmarineSwapResponse,ReverseSwapResponse,BoltzSwap,BoltzSwapEvent,BoltzError, and the foreign traitBoltzEventListener. Cargo.toml:41depends onboltz-client = { version = "0.4.1", ... }. No code outsidesrc/modules/boltz/usesboltz_client.bindings/ios/bitkitcore.swiftandbindings/ios/bitkitcoreFFI.hare committed, and both contain the Boltz API. The Android Kotlin bindings are not tracked (they are generated bygradle-publish.yml), and no other tracked binding or test references Boltz.CLAUDE.mdandAGENTS.md(lines 23 and 38) listboltzamong the modules.CHANGELOG.mdhas Boltz entries under 0.5.0 through 0.5.4.
Requested change
Delete the module and everything that exists only to serve it. Behavior of every other module stays the same.
In scope
- Delete
src/modules/boltz/and itspub mod boltz;line insrc/modules/mod.rs. - In
src/lib.rs, remove the Boltz imports, theboltz_swapsre-export, theboltz_dbfield, the Boltz lines ininit_db, and the whole "Boltz swaps" section. - In
src/modules/activity/types.rs, remove theBoltzErrorimport, theDbError::DbBoltzErrorvariant, andimpl From<BoltzError> for DbError. - Remove
boltz-clientfromCargo.toml. Rebuild soCargo.lockdrops it and its now-unused transitive crates. CI runscargo metadata --locked, so the lockfile must be committed in sync. - Regenerate the iOS interface with
./build_ios.sh(or./build.sh ios) and commitbindings/ios/bitkitcore.swiftandbindings/ios/bitkitcoreFFI.h. RestorePackage.swiftunless this is a release, as theios-bindgen.ymlstale-files check expects. - Remove
boltzfrom the module lists inCLAUDE.mdandAGENTS.md. - Add an
## Unreleasedentry toCHANGELOG.md. It should say the Boltz module and allboltz*functions and types are removed. It should also say that removing theDbError.DbBoltzErrorcase is source-breaking for exhaustive Swiftswitchand KotlinwhenoverDbError(the 0.5.15 Jade entry is the precedent for this wording). Leave the historical 0.5.x entries as they are.
Out of scope
- Deleting
boltz.dbfrom existing installs (see open questions). - Other remote branches that build on Boltz (
origin/feat/pubky-swap-boltz,origin/feat/pubky-swaps-route). They will need to be rebased or closed separately. - Unrelated dependency or module cleanup.
- Version bump and release. If the maintainer wants it in the same PR, use
./build.sh -rsoCargo.toml,Package.swiftandbindings/android/gradle.propertiesstay in sync.
Implementation notes
- After the
boltz_dbfield is gone,AsyncDatabaseConnectionsholds onlyblocktank_db. Keep the struct rather than restructuringASYNC_DB. init_dbshould stop creatingboltz.db. It should also not open, migrate or delete an existing one.- The
boltz.dbschema (src/modules/boltz/models.rs) storesswap_indexandcreate_response_jsonfor each swap. Combined with the wallet seed, that is what a manual script-path refund of a locked submarine swap would need. This is why the issue recommends leaving the file on disk.
Acceptance criteria
-
src/modules/boltz/no longer exists, andsrc/modules/mod.rsdoes not declare it. -
grep -rni boltz src Cargo.toml bindings CLAUDE.md AGENTS.mdreturns nothing. -
Cargo.lockhas noboltz-clientorboltz-client-macrosentries, andcargo metadata --locked --format-version 1succeeds. -
DbErrorhas noDbBoltzErrorvariant, and noFrom<BoltzError>impl remains. -
init_dbcreates onlyactivity.dbandblocktank.db. An existingboltz.dbinbase_pathis left untouched, andinit_dbstill succeeds. - The committed
bindings/ios/bitkitcore.swiftandbitkitcoreFFI.hmatch a fresh./build_ios.shrun and contain no Boltz symbols. -
CHANGELOG.mdhas an Unreleased entry covering the removal and theDbErrorsource break. -
cargo build,cargo clippyandcargo testpass with no new warnings.
Test plan
- Run
cargo build,cargo clippyandcargo test. The Boltz tests are deleted along with the module. Every other module's tests must still pass, includingtest_exported_scoped_getters_preserve_wallet_idinsrc/lib.rs, which callsinit_db. - Add a small test (or extend the
src/lib.rstest above) covering bothinit_dbcases:- On a fresh temp directory, no
boltz.dbis created. - On a directory with a pre-existing
boltz.db,init_dbsucceeds and the file's bytes are unchanged.
- On a fresh temp directory, no
- Run
./build_ios.shand confirmgit diffis clean for the three files inbindings/ios/. Check that theiOS BindgenandBindgen Validationworkflows pass on the PR. - Optionally run
./build.sh androidlocally (not alongside another build, since it editsCargo.tomlin place). Check that the generated Kotlin has no Boltz symbols. Otherwise rely ongradle-publish.yml.
Assumptions and open questions
- Assumption: the Boltz service shutdown comes from the request. I have not checked it independently.
- Open: has any shipped Bitkit release called the
boltz*functions, and could users still have pending swaps on disk? If so, the app needs a plan for them before it adopts this build, because bitkit-core will no longer be able to readboltz.db. - Open: should a later change delete leftover
boltz.dbfiles? This issue recommends leaving them, since deleting user data cannot be undone. - Open: which version should ship the removal? It is a breaking change for Swift and Kotlin consumers.
Metadata
Metadata
Assignees
Labels
No labels
Activity