Receiving Payments
Learn how to receive Bitcoin payments with your Arkade wallet
Overview
Receiving payments with Arkade is simple and efficient. Your wallet can generate addresses for both onchain and offchain (Ark) payments, allowing your users to send Bitcoin to you through either method.
Getting Your Wallet Address
To receive payments, you first need to generate an address:
Ark Addresses
Ark addresses start with ark1
on Bitcoin mainnet or tark1
on testnet and regtest.
Understanding Ark Addresses
Learn about the technical structure of Ark addresses, how they’re generated, and the security guarantees they provide.
Monitoring for Incoming Payments
To detect when payments are received, you can use the subscription API to monitor your address for incoming transactions in real-time.
Setting Up a Subscription
Processing Payment Updates
When a payment is received, you’ll want to process the update and take appropriate actions:
Cleaning Up Subscriptions
When your application no longer needs to listen for updates, make sure to clean up the subscription:
This is important to prevent memory leaks and unnecessary network traffic, especially when your application is closing or navigating away from the payment screen.
Best Practices
Error Handling
Error Handling
Always implement proper error handling for your subscription to ensure your application remains stable even if there are network issues.
Reconnection Logic
Reconnection Logic
Consider implementing reconnection logic if the subscription is interrupted due to network issues.
Deduplication
Deduplication
Implement deduplication logic to ensure you don’t process the same payment multiple times, especially if your application restarts.
Next Steps
- Check Balances - Learn how to verify your wallet balance after receiving payments
- Send Payments - Learn how to send payments to others
- Payment History - Track all your received and sent payments