Spark and Lightning

Spark is a Bitcoin L2 that enables instant, low-cost BTC transfers and Lightning Network payments. It's the payment backbone of the Xverse Agentic Wallet — your agent's primary rail for programmatic commerce.

Why Spark matters for agents

Lightning via Spark is the fastest and cheapest way for an agent to send and receive BTC. Sub-cent fees, sub-second settlement, and native support for creating and paying invoices — making it ideal for machine-to-machine payments, micropayments, and paid API access.

Check balance

xverse-wallet spark balance --json

Note: spark balance automatically claims any pending incoming Spark transfers. Always run it before operations that need Spark BTC.

To check across multiple accounts:

xverse-wallet spark balance --accounts 0-4 --json

Receive on Spark

xverse-wallet spark receive --json

Returns your Spark address for receiving BTC transfers on the Spark network.

Send on Spark

Send BTC or tokens instantly on Spark:

# Preview
xverse-wallet spark send --token BTC --to <spark-address> --amount 0.001 --json

# Execute
xverse-wallet spark send --token BTC --to <spark-address> --amount 0.001 --yes --json

Options

Option
Description

--token <name>

Token to send (e.g. BTC, USDB)

--to <address>

Destination Spark address

--amount <value>

Amount to send

--yes

Execute (omit for dry run)

Deposit BTC from L1 to Spark

Move BTC from Bitcoin L1 into Spark. Requires 3 block confirmations (~30 minutes).

Withdraw BTC from Spark to L1

Option
Description

--amount <btc>

Amount to withdraw

--to <address>

L1 destination (defaults to your native address)

--speed

slow, medium, or fast

--yes

Execute

Transaction history


⚡ Lightning Network

Lightning payments are powered by Spark. You need BTC on Spark to pay or create Lightning invoices.

Create a Lightning invoice (receive payments)

Returns an encoded BOLT11 invoice string. Give this to the payer.

Option
Description

--amount <sats>

Invoice amount in satoshis (required)

--memo

Optional memo/description

Estimate a Lightning payment fee

For zero-amount invoices, specify the amount:

Pay a Lightning invoice

Option
Description

--invoice <bolt11>

BOLT11 invoice to pay (required)

--max-fee <sats>

Maximum routing fee in sats (default: 5)

--amount <sats>

Amount for zero-amount invoices

--yes

Execute payment

Lightning funding tips

  • You need enough Spark BTC for the payment amount + routing fee. A 1-sat payment with --max-fee 10 needs at least 11 sats on Spark.

  • spark balance auto-claims incoming transfers — always run it before paying.

  • Check all accounts for Spark BTC: xverse-wallet portfolio --accounts 0-4 --json

  • If needed, consolidate from another account: xverse-wallet -a 2 spark send --token BTC --to <account-0-spark-addr> --amount 0.0001 --yes --json

Last updated