Funding a wallet
The user will need to fund their wallet with some bitcoin to begin using it. When the user funds a wallet for the first time, they are likely to be introduced to new concepts that need to be clearly explained. The design flows around funding a wallet can range from simple to complex, depending on your wallets target audience and which services you offer to streamline the process.
This section covers a basic mobile Lightning wallet funding flow that does not make use of any Lightning or other third-party services. This expands on what we covered in the previous page covering the user’s first use.
⚡ Lightning services
Lightning services greatly simplify the UX of funding and using a Lightning wallet. We have highlighted the sections of funding a wallet with tip boxes like these that can benefit from using Lightning services.
We have a dedicated page that covers funding a wallet using the outlined services.
Does the user own bitcoin? #
The first step in funding a wallet is asking the user if they currently own any bitcoin.
If your user does not own bitcoin, your wallet should provide practical tips to securely acquire bitcoin from trustworthy exchanges. Alternatively, you could offer the option to buy directly within your wallet, which greatly simplifies the funding process.
If the user wants to fund their wallet at a later time they should have the option to skip this funding flow and go straight into the wallet.
Funding the wallet #
Once the user has some bitcoin, the next step is for them to fund their wallet.
For users to fund their wallet they will need an on-chain payment request to send to. This should be presented with an easily scannable QR code, alongside having the option to copy and share the address. The payment request screen should be skippable for users who want to manually fund their wallet at a later time.
⚡ On-demand channels
Offering a on-demand channels Lightning service allows users to fund their wallet with a Lightning payment.
Once the user has sent their bitcoin, the next screen should show the wallet UI with the status of the funding transaction. Once this transaction is confirmed the wallet balance should be updated to indicate the user has funds on-chain.
Network sync #
If your wallet uses a bitcoin network sync method like compact block filters (BIP157/158) that may initially take some time to sync, it should be clear to the user that funds will not appear until this sync is complete. Starting the network sync as soon as the user opens your wallet will limit wait times.
Opening a channel #
At this stage the wallet is ready to be used as a standard on-chain bitcoin wallet. However, mobile wallets are more suited for Lightning payments which are often smaller, done more frequently and have different threat models. To enable Lightning payments within the wallet, the user will need to open a payment channel.
Instant open #
Having it possible for the user to instantly open a channel without having to manually find peers offers a much simpler user experience.
If your application offers instant channel opens the channel should be opened unannounced to a Lightning node ran by your service. Mobile Lightning nodes have inconsistent uptimes and a random peer may close a channel performing like this. Having the channel open unannounced has some privacy benefits for users and avoids payments being routed through the users wallet, which may confuse some users.
Manual open #
Manually opening a channel involves finding a suitable peer to open a channel with. This flow should be targeted to more advanced users who want more control of their wallet. To simplify the process your application should guide users as to where to find high quality peers.
The wallet has been funded #
Once the wallet is funded and a channel has been opened the user is ready to make payments.
Initially, the user will only have a payment channel with outbound liquidity meaning they will only be able to send via Lightning until they make some payments and have some inbound liquidity. This should be clearly communicated to the user with an explanation as to why.
⚡ On-demand channels
Offering on-demand channels as a Lightning service allows users to receive Lightning payments, giving them both inbound and outbound liquidity.
Now that your wallet has some bitcoin, it’s time to consider how backups & recovery work.