Deposit Funds from Bitcoin
Guide to transferring funds from the Bitcoin Mainnet to your Spark wallet
Depositing BTC into Your Wallet
-
Get Deposit Address
To transfer funds into Spark, you will first need to get a deposit address. This address is a regular P2TR address based on the network you are connected to. This function is exposed in the SDK as
initiateDeposit
.Please note that the response from
initiateDeposit()
is needed to complete the deposit. -
Send Funds to the Deposit Address
Send the requested amount of BTC to the deposit address. You can use any Bitcoin wallet to send the funds. For regtest, you can easily faucet the funds directly to your deposit address using the
faucetToAddress()
function. -
Complete the Deposit
Once the funds are sent to the deposit address, you can complete the deposit by calling
completeDeposit
with theinitiateDeposit
response and the txid of the transaction that sent the funds to the deposit address. For regtest, this txid is the same as the one returned from the faucet. Note that when using faucet, the wallet should sleep a few seconds before callingcompleteDeposit
to ensure the funds are confirmed.
Next Steps
Proceed to Send & Receive on Lightning to learn how to send and receive payments via the Lightning Network.