How to Sweep a Lynx Wallet
Published: January 2025 | Last updated: January 2025
Understanding Wallet Sweeping
When managing cryptocurrency, there are times when you need to completely empty a wallet by transferring all funds to another address. This process is called "sweeping" the wallet. Sweeping is accomplished through a special transaction technique that ensures no unspent transaction outputs (UTXOs) remain in the source wallet.
The Challenge of Sweeping
Normally, when sending cryptocurrency, the transaction fee is deducted from the sending wallet. This creates a challenge when trying to send exactly all funds, as you need to subtract the fee from the total amount. Depending on the complexity of the transaction, the fee can be difficult to calculate prior to execution. However, Lynx provides a solution to this problem by allowing the recipient to pay the transaction fee instead.
How to Sweep a Lynx Wallet
Step 1: Check Your Balance
First, you need to know exactly how many coins are in your wallet. Use the getbalances RPC command:
The response will look something like this:
The "trusted" value shows your available balance. Be sure the untrusted_pending and immature amounts equal zero. Make note of this exact number.
Step 2: Send All Funds
Use the sendtoaddress RPC command with these specific parameters:
For example:
Let's break down the parameters:
The recipient's Lynx address
The exact balance from Step 1
Empty comment ("")
Empty comment-to ("")
true
to specify that the recipient pays the fee
Understanding How It Works
This technique works because:
The
true
parameter at the end tells the network that the recipient will pay the transaction feeSince the sender isn't paying the fee, you can specify the exact amount in your wallet
The network processes this as a special type of transaction where the fee is deducted from the receiving end
This ensures that every UTXO in the sending wallet is included in the transaction
Important Considerations
Always double-check the recipient address before sending
Verify your balance immediately before sending to ensure accuracy
Make sure your untrusted_pending and immature coins are zero
Once completed, the sending wallet will have a balance of exactly zero
This operation cannot be undone, so proceed with caution
Before deleting your source wallet, be sure to wait for a few block confirmations
After the Sweep
After successfully sweeping your wallet:
The entire balance will be transferred to the recipient address
The transaction fee will be paid by the recipient
Your source wallet will show a zero balance
All UTXOs from your source wallet will be consumed
Verifying the Sweep
To confirm the sweep was successful:
Check your wallet balance again using getbalances after a few blocks have passed
Look for the transaction in a blockchain explorer
Verify the receiving address shows the correct balance minus the transaction fee
Remember that sweeping a wallet is a powerful operation that should be used carefully and only when you truly need to transfer all funds from one wallet to another. Always double-check your work and make sure you understand the implications before proceeding.
Last updated