Repository navigation
Description
Problem
Shared Spark testing runs on Lightspark's hosted regtest. That is its own chain, separate from our staging regtest (stag0.blocktank.to), and nothing links the two:
- Coins from staging (
/regtest/chain/deposit, ourbitcoind) can't fund a Spark wallet. Only Lightspark's faucet can, at most 50,000 sats per deposit, orscripts/spark-regtest-fund.pywithSPARK_REGTEST_MNEMONICor Lightspark credentials. - A dev build's Savings has to move to Lightspark's chain through
scripts/spark-regtest-esplora.pyandESPLORA_URL. Without it, Spark never sees a Transfer to Spending deposit. - Lightspark's regtest has no Lightning network, so our LND and LDK nodes can't pay a Spark invoice or be paid by one.
- We can't stop operators, mine to timelock maturity or reset state, so emergency-exit tests need the local stack.
The local ./spark profile in this repo (#37, docs/spark-regtest.md) solves all of this, but only on one machine. Physical test phones, other team members, QA and CI can't share it.
The new public staging in staging/ (docs/staging.md), which replaces stag0, leaves Spark out on purpose: "Spark is not hosted here". Its "Two regtest chains" section names the same gap: Spark deposits, exits and Transfer to Savings land on Lightspark's chain, which staging does not see, and which chain staging builds use for on-chain "is still an open call". Hosting Spark on that staging's chain answers it.
Proposal
Add the spark profile to the staging/ deployment, on staging's own regtest chain:
- Three operators (
breez/spark@b54845cwithoperator-status-filter.patch), the SSP and Alice (breez/spark-sdk@7b6124227withsspd-silent-payment-proof.patch), data-sync, the LNURL server and mempool.space. - Chain: staging's
bitcoindisbtcpayserver/bitcoin:26.0, which relays none of Spark's v3 packages with P2A anchors. Either peer aspark-bitcoind(Core 31.0) with it over P2P, as the local profile does, or move staging'sbitcoindto Core 31 and dropspark-bitcoind. Staging is a fresh build with no state to keep, so the upgrade is cheap now. Staging's mempool and electrs then show Spark's transactions too. - Routing: the operators, the SSP and the chain API behind staging's Caddy over TLS, on their own hostnames or paths, with
SPARK_PUBLIC_HOSTset to match. - Funding: Spark actions on the staging faucet, behind the same
FAUCET_AUTHand rate limits as/regtest/chain/depositandmine: paying a Spark invoice from Alice (./spark pay) and an invoice of Alice's to pay (./spark invoice). The faucet'sdepositalready covers./spark send. Mining has to include Spark's packages; with Core 31 on staging'sbitcoind, the existingminedoes. - Apps: staging regtest builds read the Spark config and chain URL from staging, like
SPARK_LOCAL_CONFIG_B64andSPARK_LOCAL_CHAIN_URLtoday, and their on-chain wallet stays on staging's Electrum.ESPLORA_URLand Lightspark's faucet are no longer needed there.
Open questions
- Upgrade staging's
bitcoindto Core 31, or runspark-bitcoindbeside it? - Add Spark to the first staging deploy, or after the migration in
docs/staging.mdis done? - Operator controls (
operators stop,mature) affect everyone on a shared instance. Keep exit tests on the local stack, or run a second instance for them? - The pinned operator is the last public commit; Breez's current operator image is private. Who tracks SDK upgrades that break it?
- Should CI move off Lightspark's hosted regtest once this is up?
Done when
- A dev build pointed at it with
SPARK_LOCAL_CONFIG_B64andSPARK_LOCAL_CHAIN_URLconnects from a physical phone. - Savings funded from staging moves to Spark through Transfer to Spending, and the deposit is claimed.
- A staging LND node pays a Spark invoice, and a Spark wallet pays an LND invoice.
docs/staging.mdlists the Spark endpoints and settings, anddocs/spark-regtest.mdand the Bitkitspark-regtestskill (docs: add spark-regtest skill bitkit-android#2008) describe the hosted instance.
Refs
- feat: local spark regtest network #37
staging/,docs/staging.md(e9a9b23)- docs: add spark-regtest skill bitkit-android#2008
- docs: update docs and agent skills for the Blocktank sunset and Spark bitkit-android#1814
- epic: Spark via Breez SDK bitkit-android#1946
- feat: add spark via breez sdk bitkit-android#1697
Activity
[-]Host a Spark regtest network peered with our staging regtest[/-][+]Host a Spark regtest network in the staging deployment[/+]