Repository navigation
Conversation
bf469f4 to
ef7130e
Compare
01334a9 to
4ed36e0
Compare
a1412d5 to
a1c333c
Compare
9982a55 to
d964a5f
Compare
eab67dd to
567e1a8
Compare
|
QA: 🟢 Restore Spark exit dataExit data backs up as its own category. After a wipe and restore, the Pixel's Spark balance and claimed deposits came back, but the log counted 0 imported leaves because the exit data was restored after Spark had already synced. Ran on 567e1a8; the order is fixed in f96bae9, and a rerun is pending.
🟢 Claim a depositTransfer to Spending: Spark claimed each deposit after 3 confirmations, keeping 297 sats of 15,000 and 198 of 2,500. Ran on an earlier head of this PR, before the 27 Oct rebase. 🟢 Receive with zero balance, then payWith no channel and a 0 Spark balance, the Pixel received 1,024 sats over Lightning and paid 128 from them two minutes later: Lightning received into Spark is spendable at once. The send's activity showed a fee of 0, fixed in 972e5ec. Ran on 567e1a8.
🟢 Move Spending to SavingsTransfer to Savings withdrew 12,973 sats from Spark for a 1,470 sat fee; the withdrawal showed in Savings unconfirmed after 22 seconds and confirmed after 31 minutes. Ran on an earlier head of this PR, before the 27 Oct rebase; a later run on a build of #1710 lists the withdrawal as a Transfer from Spending.
🟢 Fees against BlocktankOn the same wallet, a 15,000 sat Transfer to Spending cost 907 sats in all through Spark (6.0%) and 1,584 through Blocktank (10.6%). Moving back to Savings cost 1,470 sats through Spark, where Blocktank channel closes cost 183 to 1,113. 🔴 Pay a Paykit request over SparkThe iPhone paid this Pixel's 204 sat Paykit request over Spark and it arrived at once, but the iPhone stayed on Payment Pending; fixed in 024b6bb and synonymdev/bitkit-ios@735e972e, not rerun on a device yet. An earlier attempt failed because this Pixel republished a private invoice already paid through Spark, fixed in 972e5ec.
|
901ecd8 to
2ba664e
Compare
|
Removed from the 3.1.0 milestone: this draft is the deliverable of a finished Spark experiment and does not ship in 3.1.0. |
024b6bb to
d7be600
Compare
|
Retargeted this draft to master before merging its base, #1696, so deleting that branch would not close it. |
There was a problem hiding this comment.
detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
|
Rebuilt this branch on master after the Blocktank sunset (#1696). Master removed the old Transfer to Spending flow, so Spark now has its own amount, confirm and deposit screens, reached from Funding and the transfer buttons while Spark is ready. The deposit screen offers Breez's early claim at the fee the provider quotes for that deposit. The history was rewritten into new commits, so the shas under Evidence predate the rebuild. This PR stays a draft. |
cab0f89 to
fa49b5a
Compare
fea5a92 to
171b250
Compare
|
I restored this branch to |
…ghtning # Conflicts: # app/src/test/java/to/bitkit/repositories/BackupRepoTest.kt # app/src/test/java/to/bitkit/repositories/PrivatePaykitRepoTest.kt # app/src/test/java/to/bitkit/repositories/WalletRepoTest.kt
…ghtning # Conflicts: # app/src/main/java/to/bitkit/repositories/LightningRepo.kt # app/src/main/java/to/bitkit/ui/settings/lightning/LightningConnectionsScreen.kt # app/src/main/java/to/bitkit/ui/settings/lightning/LightningConnectionsViewModel.kt
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |





Twin: synonymdev/bitkit-ios#1128
This PR keeps Lightning in Bitkit after Blocktank stopped selling channels: on top of the Blocktank sunset (#1696), Spark becomes the easy option where Transfer to Spending now leads to manual setup. Savings to Spending funds a Breez SDK on Spark wallet, and Lightning sends and receives fall back to it whenever no channel can carry the payment. Existing channels keep working until they close, and ldk-node keeps running the on-chain wallet.
Description
Brings back the Transfer to Spending flow the Blocktank sunset removed, wired to Spark: while Spark is ready, the Spending suggestion card opens the Spending Balance intro (first time) and then Funding, which leads with Transfer from Savings and Use Other Wallet above Manual Setup; Transfer from Savings, and the Savings, Spending and hardware wallet transfer buttons, open the Transfer to Spending intro (first time), then the restored amount, confirm and setting-up screens. Without Spark, the entry points keep showing the Transfer Unavailable sheet. The Spark-only amount, confirm and deposit screens are gone, and one view model drives the restored screens.
Keeps the old amount screen: number pad, 25%, Max and Available, where Max is the most Savings can send to the Spark deposit address after the network fee. The pad and presets stay disabled with no Savings, Continue refuses an amount that does not cover the Instant fee or that Savings no longer cover, with their own copy, and the offline and node-sync states show as before. Funding shows the old No Available Funds dialog when Savings is empty.
Keeps the old confirm screen and copy, with the swipe and its rotating coin stack and Learn more. The four tiles become Network fees, Spending fee (the Spark claim fee for the chosen speed), To spending (the amount less that fee) and Total (what leaves Savings). Between the tiles and Learn more, two rows pick the speed: Instant, ready in a few minutes, up to the Instant ceiling; Later, after 3 confirmations, about 30 minutes, at the claim at 3 confirmations priced at the half-hour fee rate. Instant is the default. Advanced, the channel bar and the background-setup toggle are dropped, since Spark has no LSP balance and sends no setup push.
Prices the confirm screen when it appears, when the speed changes and again at swipe, and sends the transaction at the fee rates it showed. When the total rose or To spending fell since it was shown, the swipe pays nothing, the tiles refresh, and the old Fees changed toast asks for another swipe.
Brings back the setting-up screen with its animation and steps, driven by the Spark deposit. Instant polls the deposit every 5 s for up to 5 minutes: within the ceiling it claims early at once and says Spark is adding it, then shows the old success screen once the deposit is in the balance; above the ceiling, or when the provider reprices it, it shows what Instant costs now with Pay and Wait, never swapping the fee silently; with no early option, or a declined claim, it says Instant isn't available and Spark adds it after 3 confirmations; when Spark never lists the deposit, it says so and that the user can leave. Later makes no claim call. The poll runs in the app scope, so leaving the screen does not drop an Instant claim within the ceiling.
Restores the Liquidity screen's layout as the Learn more screen, since the Instant or Later choice is real decision information under Spark: it explains the two speeds, repeats the Spark trust note and shows the spending balance bar after this transfer, with Understood.
Keeps the SDK from claiming early on its own: the wallet-wide claim cap stays at the recommended fee plus 2 sat/vB and drops the 0.2% share. Lowering it below the spread keeps the deposit from being claimed early, and does not hold back its claim at maturity. The Instant ceiling keeps the old formula with the 0.2% share.
Brings back Transfer to Spending from a hardware wallet: master signs and broadcasts an on-chain send from the hardware wallet to any address (
HwSendViewModel.signAndBroadcasttakes the address from its caller), so the restored intro, amount, sign and signed screens send to the Spark deposit address, priced from the device's account, with the same speed choice and setting-up screen. The hardware amount step reuses the restored amount screen with its old test tags, instead of a second copy of it. The send is recorded as a transfer.Restores
hasSeenTransferIntroandhasSeenSpendingIntroin settings and their migration from the React Native app, removed by the sunset.Adds the Breez SDK on Spark (
breez_sdk_spark:bindings-android:0.27.2) withSparkServiceandSparkRepo, so that a Spark wallet starts beside the node from the same recovery phrase and passphrase. Spark derives its own keys onm/8797555', so there is no new phrase to back up.Routes Lightning receives to Spark when no ready channel has the inbound capacity, so the receive sheet shows a Lightning invoice again without channels.
Routes Lightning sends and their fee estimates to Spark when no channel has the outbound capacity and the Spark balance covers the amount, so users without channels can pay invoices.
Raises Spark payments as the node's own payment events and records them as Lightning activity, so the received sheet, send success screen and activity list work for both rails.
Adds the Spark balance to the Spending balance; the most a payment can send is the larger of the channel and Spark balances, since one payment cannot split across rails. Deposits Spark has seen but not yet claimed show as in transfer to Spending.
Withdraws the whole Spark balance to an on-chain address in Spending to Savings before closing channels, so that the transfer works for users with only a Spark balance.
Reads a
BREEZ_API_KEYbuild property, so that mainnet builds without a key keep Spark off; regtest builds use Lightspark's hosted regtest, which needs no key.Shows Spark at the top of Lightning Connections like a channel: its balance and each deposit in progress with its confirmations and a link to the transaction. Its detail screen shows the provider with a short trust note, pending and claimed deposits with the claim fee, and Transfer to Savings.
Pays a Lightning invoice from another Spark wallet as a Spark transfer on regtest, where Spark has no Lightning network, so two dev builds can pay each other's invoices; dev builds also show Spark's deposit address on the Spark screen, to fund it from Lightspark's regtest faucet.
Adds an
ESPLORA_URLbuild property for regtest builds, which puts the node's chain source on an Esplora endpoint, plusscripts/spark-regtest-esplora.pyandscripts/spark-regtest-fund.py, so a dev build runs on Spark's regtest chain and QA can fund it and test Savings to Spending and the claim without mainnet.Lists a Transfer to Spending deposit as pending in Lightning Connections and the Spending balance as soon as the app broadcasts it, from the txid it already has, and asks Spark to sync at once; Spark's own deposit state takes over when the SDK lists it. Before, the deposit showed only after the SDK's next background sync, up to 60 seconds later.
Draws Spark's balance bar as one full-width spending bar and shows receiving as No limit in the Lightning Connections header, in the same style and with the same arrow as the spending figure, whenever Spark is ready, whatever its balance or channels, because Spark receives without inbound liquidity; Receive's amount check no longer asks for more liquidity or a CJIT while Spark can receive.
Publishes the Spark invoice as Bitkit's Paykit Lightning endpoint when no channel can receive, so a Spark-only wallet still lists a Lightning endpoint; Paykit requests paid over Lightning already go through Spark when no channel can carry them.
Reads
BREEZ_API_KEYfrom thereleaseenvironment in the release workflow and fails the release when it is missing, so Spark can't ship switched off; internal release builds pass it through when therelease-internalenvironment has it. A repo admin has to addBREEZ_API_KEYto thereleaseenvironment (and torelease-internalfor internal builds with Spark).Backs up Spark's unilateral exit data to VSS as its own category,
SPARK_EXIT, encrypted like the other backups. It is exported again when Spark connects and whenever the SDK reportsUnilateralExitStateChanged, and on restore it is imported right after Spark connects, without contacting the operators, so a wallet restored on a new device can still exit on-chain while the operators are unreachable. The category shows in Backup settings only where Spark runs.Refuses Spark sends while a wallet restore is still pending, before and after the payment is authorized, as master already does for channel sends, so no payment leaves before the restored wallet is in place.
Returns a Spark Lightning send as soon as it starts, like ldk-node, so its completion event reaches the send screen's watcher, which starts after the send returns, instead of firing before it.
Counts Spark's Lightning payments in Paykit's private invoice checks, so an invoice a contact already paid through Spark is replaced instead of published again, and an invoice this wallet already paid through Spark isn't paid twice. Before, a contact who had paid the Spark invoice once found no Lightning option on later requests.
Records a Spark send's fee when Spark's next sync reports it, since its completion event carries a fee of 0, and keeps the activity's contact and seen state when re-recording it.
Shows a Spark withdrawal's arrival in Savings as a transfer from Spending, not a plain received payment, and lists each withdrawal with the fee Spark kept on the Spark screen. The Spark bar reads as empty at a 0 balance.
Finishes a Transfer to Savings that only withdraws Spark without waiting for a Lightning peer or a fixed pause, so the success screen shows as soon as the withdrawal is sent.
Settles a Spark send that finished inside the send call, as Spark-to-Spark payments do, by checking Spark's payment list once the send screen starts watching, so a paid Paykit request no longer stays on Payment Pending.
Keeps plain Paykit working on Spark. Recovery reads Spark's payments, so a Paykit request or allowance payment whose Spark completion event was missed settles from Spark's record and its proof reaches the payee, and an allowance attempt is never recorded as failed while Spark cannot list its payments yet. The Paykit endpoints are republished when Spark becomes ready, so a Spark-only wallet offers Lightning to contacts after a cold start. A Spark send refused before it leaves (Spark not connected, the payment not preparable, or its fee over the limit) ends a request as failed with its proof removed and records the allowance attempt as failed; a failure inside the send stays pending. Spark sends keep a request's deadline and an allowance's 1% fee cap, a Spark receive recorded while the app was closed gets its contact, and the Lightning send limit leaves room for Spark's 0.25% service fee.
Stops loading a payment request the user opened when its payment details fail to resolve, and shows that the contact's payment details aren't ready yet, instead of spinning through 14 retries.
Adds the Spark emergency exit, so Spending can still reach Savings on-chain if the Spark operators stop working, which is what Spark's trust model rests on. Lightning Connections › Spark shows Emergency exit under Transfer to Savings while Spark holds funds or has recoverable funds, and leads to the exit's progress while one runs. The flow is an explainer, a quote from the SDK's
prepareRecoverFundsfor every leaf at its fastest fee rate to a fresh Savings address (amount to exit, network fees, you receive about, fee funding needed, what stays on Spark; Continue is blocked when nothing can be exited or the fees exceed the value), fee funding (pay from Savings when it covers the funding and its fee, or fund a shown address from another wallet), a swipe that writes the exit record and the transfer before any payment, and a progress screen with the steps, the timelock countdown, rejections, a top-up address when more fees are needed, and the result.Pays the exit's CPFP fees from a key on its own account,
m/84'/{coin}'/7797'/0/0, derived from the wallet seed with bitkit-core, so ldk-node never spends the funding UTXO or the CPFP change chained back to it; only the path index is kept, never the key.Drives the exit with a state machine that builds once the funding confirms, saves every build before broadcasting, broadcasts ready steps as packages (
/v1/txs/package) or single transactions to the SDK's own chain hosts (mempool.space then blockstream.info on mainnet, Spark's mempool on regtest), rebuilds a diverged recovery as a new generation that never sends the old hex again, asks for a top-up when a rebuild needs more fees, and ends with leftover funding shown. Without the SDK (operators down at connect, or a background start) it still broadcasts the stored, signed steps whose parents confirmed and whose timelock matured.Keeps the exit going across restarts: the record (
spark-exit.json, the same JSON as iOS, with the recovery in spark-sdk's serde shape) is reloaded on launch, the exit ticks every minute while Bitkit is open, and WorkManager drives it every 15 minutes while it is closed, with a reminder notification when a timelock matures or more fees are needed.Records the fee funding paid from Savings as an ordinary payment in Activity, not a transfer to Spending, and says the exit takes up to 4 weeks.
Takes Spark off Lightning during an exit: no sends, receives or deposits on Spark, its balance shows as in transfer to Savings with the countdown on Home and Savings, and Spark reconnects with leaf optimization off until the exit ends, so no optimization swap hands an exiting leaf to someone else.
Out of Scope
Risks for review
SPARK_EXIT; upstream VSS accepts request bodies up to 1 GiB by default, but a large wallet's upload against Synonym's VSS is untested.250 × sat/vB + 750sats.CLAIM_TX_SIZE_VBYTES,deposits.rs), so it is a flat cost that weighs heavily on small transfers. The confirm screen shows it as Spending fee, with To spending after it, for the speed the user picks.libbreez_sdk_spark_bindings.soadds about 11 MB per ABI (arm64, uncompressed).Design
Restored transfer screens, on the latest
Bitkit - Handoffpage of the Bitkit Figma file (frame names fromdocs/screens-map.md; the Spark speed rows, Spending fee and setting-up states have no frame yet):The emergency exit screens have no design yet; they follow the Transfer to Savings screens (
docs/screens-map.mdlists them astodo).Figma has no Spark or unlimited-receiving state for the Lightning Connections header, so No limit uses the same style and arrow as the spending figure beside it; @aldertnl, a design for this state is still open.
Preview
Cases 1 and 2 on a dev build without channels: the Spending invoice comes from Spark, and Transfer to Spending funds the Spark deposit address.
r1-receive2x.mp4
r3-transfer2x.mp4
Case 10 on a dev build, staged with a local hook (not in this PR) for the balance and the claimed deposit; the pending deposit is a real 35,000 sats transfer with its real confirmations.
r72x.mp4
A new dev wallet with no Spark balance: Spark shows in Lightning Connections on regtest, and its screen shows the deposit address to copy for Lightspark's regtest faucet.
r8-regtest-address2x.mp4
Case 2 confirm on a dev build: the 20,000 sat transfer shows a 99 sat claim fee (1 sat/vB × 99 on regtest) and 19,901 sats to Spending.
On a dev build with a staged 14,703 sat Spark balance: Lightning Connections and the Spark detail with the full-width bar and receiving shown as No limit, and the Spark confirm screen without the background toggle and Learn More.
QA Notes
Setup
BREEZ_API_KEY=<key>inlocal.properties, and small amounts.python3 scripts/spark-regtest-esplora.py --port 3999. It fronts Spark's regtest mempool API (the SDK's own regtest default,sdk_builder.rs) and adds the two Esplora calls it lacks and ldk-node needs:/fee-estimatesat start and/block/<hash>/statusfor Lightning sync.ESPLORA_URL=http://10.0.2.2:3999 ./gradlew assembleDevDebug, so the node's chain source is Esplora on Spark's chain instead of Electrum on Blocktank's staging chain. For a phone, run the proxy with--bind 0.0.0.0and use the host's address.FAUCET_USERNAME=… FAUCET_PASSWORD=… python3 scripts/spark-regtest-fund.py <Savings address> 100000, through Lightspark's API faucet (credentials issued by Lightspark; Breez's CI uses the same,faucet.rs). Without credentials, use the web faucet by hand.ESPLORA_URLstays on Blocktank's staging chain: Spark start-up, invoices and screens work, but its Savings to Spending deposit is never seen by Spark.Journeys
transfer/spark-transfer-to-spending.xml— with Spark ready, the suggestion card opens the Spending Balance intro and Funding, Transfer from Savings opens the Transfer to Spending intro and the amount screen; 25% and Max fill the amount, confirm shows the four tiles with Instant and Later, Later updates the tiles, Learn more opens and returns; the intros show once.transfer/transfer-unavailable-sheet.xml— now needs Spark not running, since a ready Spark replaces the sheet.amount-limits/transfer-spending-over-max.xml— the amount pad caps at Max with the Spending Balance Maximum toast.amount-limits/transfer-spending-preset-delete.xml— after 25%, Max or a unit switch, each delete removes one digit.transfer/spending-confirm-amount-change.xml— a lower price at swipe pays at once; a higher one asks for another swipe.hardware-wallet/transfer-to-spending.xml— a paired Trezor transfers into Spark through amount, sign and signed to the setting-up screen.hardware-wallet/passphrase-transfer-to-spending.xml— a hidden wallet signs with its live session, re-prompts after the session drops, and refuses a wrong passphrase.hardware-wallet/transfer-to-spending-node-warmup.xml— a hardware transfer started during node warm-up reaches the sign screen.transfer/spark-emergency-exit.xml— with a Spark balance, Emergency exit opens the explainer, the quote lists amount, fees and what arrives, and funding shows Pay from savings and a funding address from another wallet; stops before the swipe.Manual Tests
ESPLORA_URLon Spark's regtest chain, Savings funded withspark-regtest-fund.py→ Transfer to Spending; after 1 confirmation Spark claims the deposit and Spending shows it; Lightning Connections lists it as claimed — faucet credentials.Imported Spark exit databefore Spark is used, and Spark's balance and deposits match — needs two installs.Automated Checks
SparkExitRecordTest.kt— the record round trips with every phase and status, the recovery keeps spark-sdk's serde shape, a recovery written by the Breez CLI and a record written by Bitkit iOS are read, an unknown version is refused, and the store saves atomically and sets an unreadable record asideSparkExitDriverTest.kt— waits for confirmed funding, builds and saves before broadcasting, Valid broadcasts ready steps once until due, rejections surface after 3, Done ends with leftover funding, Redo rebuilds as a new generation that never sends the old hex (also without the SDK), a rebuild short of fees asks for a top-up that ignores CPFP change, cooperative failures retry, an unverified leaf waits, a restart mid-exit resumes from the file without repeating broadcasts, and the keyless pass broadcasts only steps whose parents confirmed and timelocks maturedSparkExitFundingTest.kt— what arrives, the fees and the fee funding of a quote, the uneconomic gate, the funding shortfall, the countdown height, the funding UTXO choice, whether Savings can pay, the ETA per network, the funding path, WIF decoding and CPFP child txidsSparkExitChainTest.kt— packages go out as a raw JSON array and single steps as plain hex, the unversioned path and the next host are tried, a node's refusal wins over an unavailable host, tip and UTXOs are read, and node answers are classifiedSparkExitRepoTest.kt— loading settles exit transfers no running exit owns, including the transfer of a record set aside as unreadableSparkExitRegtestTest.kt(unit, opt-in withSPARK_EXIT_REGTEST=1) — Spark's regtest mempool answers the tip and a funding address, and its node's per-transaction answer to a package is read as retry laterSparkExitRegtestTest.kt(instrumented, opt-in with-e sparkExitRegtest true) — on a device against Spark's regtest, a new wallet's quote has nothing to exit, and the funding key derives with bitkit-core into a working CPFP signerSparkRepoTest.ktclaim cases — Instant claims early within the ceiling and reaches Claimed, asks above it, shows the repriced fee from a repriced claim, pays a repriced claim at the new fee, is unavailable with only the standard claim or a declined claim, says Spark has not seen a deposit never listed, and Later makes no claim call; the claim step follows the offer and ceilingSparkFundingViewModelTest.kt— Max is Savings less the network fee and 25% a quarter of it, Max is 0 without Savings, Continue refuses an amount under the Instant fee, prices and opens confirm, the swipe asks again when the fee rose and refuses when Savings no longer cover it, sends at the quoted fee rates and follows the claim at the chosen speed, and a hardware transfer prices from the device and hands signing a transfer requestSparkServiceTest.kt— the Later fee prices the mature claim at the half-hour rate (198 sats at 2 sat/vB)ContentViewTest.kt— the spending start route shows the intro until seen, for Savings and hardware wallets, and setting up drops the confirm screen from the back stackSparkClaimOfferTest.kt— a quote maps to the standard claim, an automatic early claim within the cap, or a choice above the cap or with automatic claiming off, and each claim outcome maps to claimed, waiting, repriced or declinedSparkServiceTest.kt— Lightning sends return before completionSparkRepoTest.ktcases — a restored exit backup is imported once Spark connects, one from another network is skipped, a send recorded with fee 0 is re-recorded with the fee a later sync reports, and a withdrawal is listed with its fee and its arrival marked as a transferPrivatePaykitRepoTest.kt— a private invoice paid through Spark is replaced on the next refreshBackupRepoTest.kt—SPARK_EXITuploads the exported state and restores it, uploads nothing while Spark is not connected, and uploads when Spark was ready before observing startedEditInvoiceVMTest.kt— Receive asks for no liquidity or CJIT while Spark can receiveDeriveBalanceStateUseCaseTest.kt— Spark balance counts toward Spending, caps max send, and pending deposits count as in transferTransferViewModelTest.kt— Transfer to Savings with only Spark doesn't wait for a Lightning peerLightningRepoTest.kt— a Spark send is refused while a wallet restore is pending, or when one begins during authorizationLightningRepoTest.kt,WalletRepoTest.kt,WalletViewModelTest.kt— construct the new Spark dependency, idle, so existing channel paths are unchangedEvidence
cb59453ce(f7836bea4), no rebase, so stacked branches keep their ancestry: unit tests for backup, Paykit, wallet and Spark, and detekt pass locally; detekt and lint pass in CI (run). Draft CI skips the build and unit suite.fa49b5afd, keeping master's restore guards and connection recovery beside Spark: the build and unit suite pass in CI (run), and detekt and lint pass; the rebuilt flow and early claims (18 to 21) are not yet driven. Results below ran on the earlier flow before the rebuild; their revisions are kept as run.Dev build of
7aa44f6(before the rebase:a9cc9a3), Android 15 emulator, Spark's regtest:1: new wallet without channels; Spark connected on regtest from the wallet's seed. Receive shows Auto and Spending; the Spending invoice's payee is
02fe4b…, not the node03401e…, with a Spark route hint.2: funded Savings with 100,000 sats from Blocktank's staging regtest; Transfer to Spending offered 99,671 sats, confirm showed 458 sats network fee and 0 service fee without Advanced, and the swipe broadcast 50,000 sats to the Spark deposit address. No Blocktank order was created.
10 on
07a1df7(now2126254): Lightning Connections listed Spark with 20,000 sats and the 35,000 sats deposit at 1/3 confirmations read from the wallet's own transaction; the detail showed provider, trust note, pending and claimed deposits with a 312 sat claim fee, and Transfer to Savings opened the savings transfer. The Home total counted the Spark balance and the pending deposit.3 passed on mainnet (a phone,
ef7130e): 15,000 sats broadcast to the Spark deposit address showed as in transfer to Spending within a minute; Spark claimed it with the standard claim after 3 confirmations (no early claim at 1 confirmation under this PR's claim fee cap), and the Spending balance then showed the Spark funds.Regtest address on
be8df34: a new wallet with no Spark balance listed Spark in Lightning Connections, and its screen showed the deposit addressbcrt1peqm25…z0uj.Spark's chain on
5f88733(now01334a9): a dev build withESPLORA_URLthrough the proxy started its node on Spark's regtest (Esplora chain source logged), synced the on-chain and Lightning wallets to height 3,658,177 with no failed calls at the proxy, and Spark connected beside it.2 on
9a9ba8c(now4ed36e08c): confirm showed network fee 458, Claim fee 99, To spending 19,901, Total 20,458 for 20,000 sats.10 and 2 on
9383434(now60e079f): the Spark row and detail drew a full purple bar for 14,703 sats with no receiving side, the header read Receiving capacity No limit, and the Spark confirm showed Claim fee 99 and To spending 19,901 with no background toggle or Learn More.10 and 2 on
a93f3dc88(Android 15 emulator, Blocktank's staging regtest, where Spark never sees the deposit): 26 seconds after the swipe, Lightning Connections listed the 10,000 sat deposit as pending at 1/3 confirmations from the app's own broadcast, and the header showed No limit (since restyled to match the spending figure).Transfer flow restore on
1196c954d:just compile, the unit suite, detekt and Android lint pass locally. The screens were not driven on a device: the states after the swipe are shown by theSpendingConfirmScreen(Instant, Later, loading, small screen) andSettingUpScreen(looking, adding, repriced, unavailable, later, not seen, success) previews.Emergency exit on
e79929c8a:just compile, the unit suite, detekt and Android lint pass locally. Against Spark's live regtest mempool, the chain client read the tip and a funding address, and a fake parent with its child sent as a package came back per transaction asbad-txns-inputs-missingorspent, which the client reads as retry later.Emergency exit on regtest, Android 16 emulator, Spark's regtest (
326a6aac6): a new wallet funded Spark with 100,000 sats from Lightspark's web faucet (99,901 after the claim). Emergency exit quoted 90,112 sats to exit, 8,923 network fees, about 81,189 to receive, 9,211 fee funding and 9,789 staying on Spark as dust. The funding address shown by Fund from another wallet got 10,000 sats from the faucet, the screen said Payment seen, and the swipe built 30 transactions (1 fan-out, 24 node, 4 refund, 1 sweep). The fan-out and 20 node packages (TRUC parent with CPFP child) were accepted by Spark's mempool and confirmed, with no rejection, across three app restarts that resumed from the saved record without sending a step twice. It then waited for the leaf nodes' 1,900–2,000 block timelocks (about 17 hours on regtest); the refunds and sweep were not reached. Home showed the 90,400 sats in transfer with Spending at 0. The run found three bugs, fixed in326a6aac6: the SDK's check never saw the fan-out confirm on Spark's regtest, whose mempool reports no spender for an outpoint, so the driver now marks steps the chain shows in a block before each check; the foreground loop never started, since Android Bitkit removes the startup providerProcessLifecycleOwnerneeds, soContentViewdrives it; and the timelock step showed done while the refunds still waited.Emergency exit on
e79929c8a, Android 16 emulator, Spark's regtest: the instrumentedSparkExitRegtestTest.ktconnected a new wallet with leaf optimization off, quoted it withprepareRecoverFunds(nothing to exit), derived the funding key atm/84'/1'/7797'/0/0with bitkit-core into abcrt1qaddress and a working CPFP signer, and read the funding address on Spark's mempool. The app launched without errors.Gaps
4771ead5d:just compileand the exit unit tests pass.2695c93af: unit tests only (upload, restore, Spark ready before observing, staged import on connect); not yet driven on a device.Models used
claude-opus-5-5(reasoning:low)claude-opus-5-5(reasoning:low)