Monero: How to actually sweep_all?

Created on 14 Dec 2019  路  10Comments  路  Source: monero-project/monero

Sounds like I have to do sweep_all (every single index I have). Is there a way to do all used indexes? I'd like a literal sweep_all command that sweeps the entire wallet.

All 10 comments

Sweep the entire wallet would link your different accounts, which would defeat the purpose of accounts, at least the privacy purpose. So no. For subaddresses, it should sweep all of them, so if it doesn't it looks like a bug in practice. Can you confirm whether you're asking about accounts or subaddresses within an account ?

Thanks for getting back to me. I think it's just subaddresses, but maybe I'm mistaken.

This is what I'm doing for payments.

https://github.com/teran-mckinney/bitcoinacceptor-python/blob/master/bitcoinacceptor/__init__.py#L110

That line points at something that's unrelated AFAICT.

For your comments on the linked function, 64 bits is way too much indeed. 80 bytes per subaddress in RAM. The 200 is a default, and many people don't seem to get that it grows automatically as addresses are used.

I don't think it's unrelated. I'm showing that it's using subaddresses and the same account index of 0.

https://monero-python.readthedocs.io/en/latest/wallet.html#monero.wallet.Wallet.get_address

I ended up using 200 as that was the default.

Either way, do you know there a way to sweep all of the subaddresses under the same account? Or is this not working how I think it is?

I appreciate your help, thank you.

Ah. Then it should sweep all I think. Are you using a simple "sweep_all ADDRESSHERE" command in monero-wallet-cli while account 0 is selected ? If not, give exact details.

No, it just picks one of the subaccounts. And show_transfers has different account IDs.

Wonder if there's a bug in the code and it's giving different accounts and not different subaddresses?

@teran-mckinney

No, it just picks one of the subaccounts. And show_transfers has different account IDs.

That behavior is intentional; it's best privacy-wise to not spend outputs received by different subaddresses together, so the wallet randomly picks one index when sweeping all with the subaddr_indices field left unspecified:

https://github.com/monero-project/monero/blob/b4e1dc83d275f8ee9a8c12615cf952f05161c7a3/src/wallet/wallet2.cpp#L10038

6241 adds an option to enable sweeping outputs received by all subaddresses within the same account for the wallet CLI and RPC.

Thank you! I appreciate you writing a patch for this. Just confused by the name sweep_all.

Sounds like your patch will do the trick. I hope it makes it in.

I see now I had misread the code, sorry :)

That patch is now in master, closing.

Was this page helpful?
0 / 5 - 0 ratings