
Setup: Run the CLI
Clone and launch the Spark CLI, powered by the Spark SDK:
CLI
Initialize Your Wallet
Create your first wallet on Spark:Example output:To recover an existing wallet:
CLI
CLI
Important: Keep your mnemonic securely stored offline. Anyone with access to it can take full control of your funds.
CLI
Deposit Bitcoin
Generate a static deposit address:You’ll get a static Bitcoin L1 deposit address linked to your wallet, it can’t be changed. Try it out in our Regtest environment using some monopoly money from the faucet.After depositing Bitcoin from the faucet, get the associated transaction hash:Once the transaction is confirmed on-chain, you can claim it. To claim your Bitcoin on Spark, start by requesting a quote:With the quote info ready, you can now claim your Bitcoin.Verify that your balance has increased:
CLI
CLI
CLI
CLI
CLI
Send Bitcoin on Spark
Create a new wallet and fetch its Spark Address. The Spark Address is a static address that can be shared with payers to receive Bitcoin.Now send from Wallet 1:That’s it. The transfer’s complete. Run
CLI
CLI
getbalance on each wallet to confirm the Bitcoin moved.Send and Receive Bitcoin from and to Lightning
Spark is fully compatible with Lightning. Let’s test it by sending a Lightning payment between our 2 wallets.The payer specifies the maximum fee they’re willing to pay for the invoice (in sats). The SDK then finds the route with the lowest possible fees but it will never exceed that limit.Use
CLI
getbalance on each wallet to verify the payment.Withdraw to L1
You can withdraw Bitcoin from Spark to Bitcoin by sending them to an L1 address. In this example, we’ll withdraw Bitcoin from Wallet 1 and send it to Wallet 2’s L1 address.Check withdrawal fee:If it’s acceptable:Once the transaction is confirmed, use the same claim process described above to claim your Bicoin on Spark.
CLI
CLI
CLI
