pub struct DustSweeper { /* private fields */ }Expand description
DustSweeper provides functionality to identify and clean up dust UTXOs from a Bitcoin wallet in a privacy-preserving way.
§Privacy Features
- Groups UTXOs by address to avoid linking different addresses
- Creates separate transactions for each address’s dust
§Example
use bitcoincore_rpc::{Auth, Client};
use dust_cleaner::DustSweeper;
let rpc_client = Client::new(
"http://localhost:18443",
Auth::UserPass("user".to_string(), "pass".to_string())
).unwrap();
let sweeper = DustSweeper::new(rpc_client, 1000);
let dust_utxos = sweeper.get_dust_utxos().unwrap();Implementations§
Source§impl DustSweeper
impl DustSweeper
Sourcepub fn new(rpc_client: Client, threshold: u64) -> Self
pub fn new(rpc_client: Client, threshold: u64) -> Self
Creates a new DustSweeper instance
§Arguments
rpc_client- Bitcoin Core RPC clientthreshold- Amount in satoshis below which UTXOs are considered dust
Sourcepub fn get_dust_utxos(&self) -> Result<Vec<ListUnspentResultEntry>, Error>
pub fn get_dust_utxos(&self) -> Result<Vec<ListUnspentResultEntry>, Error>
Retrieves all UTXOs below the dust threshold from the wallet
§Returns
Result<Vec<ListUnspentResultEntry>>- List of dust UTXOs or RPC error
Sourcepub fn build_psbts_burn(
&self,
dust_utxos: Vec<ListUnspentResultEntry>,
fee: u64,
burn_addr: &str,
) -> Result<Vec<Psbt>, Error>
pub fn build_psbts_burn( &self, dust_utxos: Vec<ListUnspentResultEntry>, fee: u64, burn_addr: &str, ) -> Result<Vec<Psbt>, Error>
Auto Trait Implementations§
impl !Freeze for DustSweeper
impl !RefUnwindSafe for DustSweeper
impl Send for DustSweeper
impl Sync for DustSweeper
impl Unpin for DustSweeper
impl !UnwindSafe for DustSweeper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more