Skip to content

Host a Spark regtest network in the staging deployment #42

Todo

Description

@jvsena42

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, our bitcoind) can't fund a Spark wallet. Only Lightspark's faucet can, at most 50,000 sats per deposit, or scripts/spark-regtest-fund.py with SPARK_REGTEST_MNEMONIC or Lightspark credentials.
  • A dev build's Savings has to move to Lightspark's chain through scripts/spark-regtest-esplora.py and ESPLORA_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@b54845c with operator-status-filter.patch), the SSP and Alice (breez/spark-sdk@7b6124227 with sspd-silent-payment-proof.patch), data-sync, the LNURL server and mempool.space.
  • Chain: staging's bitcoind is btcpayserver/bitcoin:26.0, which relays none of Spark's v3 packages with P2A anchors. Either peer a spark-bitcoind (Core 31.0) with it over P2P, as the local profile does, or move staging's bitcoind to Core 31 and drop spark-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_HOST set to match.
  • Funding: Spark actions on the staging faucet, behind the same FAUCET_AUTH and rate limits as /regtest/chain/deposit and mine: paying a Spark invoice from Alice (./spark pay) and an invoice of Alice's to pay (./spark invoice). The faucet's deposit already covers ./spark send. Mining has to include Spark's packages; with Core 31 on staging's bitcoind, the existing mine does.
  • Apps: staging regtest builds read the Spark config and chain URL from staging, like SPARK_LOCAL_CONFIG_B64 and SPARK_LOCAL_CHAIN_URL today, and their on-chain wallet stays on staging's Electrum. ESPLORA_URL and Lightspark's faucet are no longer needed there.

Open questions

  • Upgrade staging's bitcoind to Core 31, or run spark-bitcoind beside it?
  • Add Spark to the first staging deploy, or after the migration in docs/staging.md is 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_B64 and SPARK_LOCAL_CHAIN_URL connects 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.md lists the Spark endpoints and settings, and docs/spark-regtest.md and the Bitkit spark-regtest skill (docs: add spark-regtest skill bitkit-android#2008) describe the hosted instance.

Refs

Activity

  1. self-assigned this
    on Nov 24, 2026
  2. changed the title [-]Host a Spark regtest network peered with our staging regtest[/-] [+]Host a Spark regtest network in the staging deployment[/+] on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions