Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wallet: add sweep_single command #2634

Merged
merged 1 commit into from Nov 15, 2017

Conversation

Projects
None yet
4 participants
@stoffu
Copy link
Contributor

commented Oct 11, 2017

This patch adds a new command sweep_single <key_image> <address> which sweeps exactly one output specified by the given key image to the destination address with no change. This may be useful for a few purposes:

  • Cold signing: After exporting the set of correct key images from the offline full wallet to the online watch-only wallet, this command can be used to spend each one of output in the cold wallet without generating a new change output, which simplifies the process of moving funds from a cold wallet to a hot wallet by making it unnecessary to export/import outputs/key-images every time moving funds.

  • Manual churning

  • Defense against potential privacy leak when spending many outputs from the same entity (e.g. an exchange)

[wallet A1PbM6]: incoming_transfers available verbose
               amount   spent    unlocked  ringct    global index                                                               tx id                                                              pubkey                                                           key image
       1.750732960000       F    unlocked  RingCT          289557  <1a49403c7c718d517edd7856060fce96d01d602242f67bb3081e9ed73ad20243>  <0ff2f2309ff0bd58150ded6b844edb195efe5a9ebbb1701ec6df4433b958efc3>    f2e713dc54a9b1ec9c4925793ee1f35636234c8b99b7dd168791677e51e704df
[wallet A1PbM6]: sweep_single unimportant 5 f2e713dc54a9b1ec9c4925793ee1f35636234c8b99b7dd168791677e51e704df 9vfmz4q7LGQYMisHnLZzUCW1kjG35394sK14D3EfRK9xabR2VouaNSDYdTE5EeSvTe5WV2e6tFUFrEbC8gaHk85oCM4uz8g

Transaction 1/1: txid=<bf29fb9516072b8674f6edf83ea29346248ac8959bf08a1104c809b95731b304>
Input 1/1: amount=1.750732960000
Originating block heights:  965548 *1012065 1014813 1015188 1015378
|___________________________________________________________________________o__*|

Sweeping 1.750732960000 for a total fee of 0.004783740000.  Is this okay?  (Y/Yes/N/No)

@stoffu stoffu force-pushed the stoffu:sweep-single branch 3 times, most recently from f3f762c to 9c41164 Oct 11, 2017

@iamsmooth

This comment has been minimized.

Copy link
Contributor

commented Oct 29, 2017

This will create transactions with one output. Does the issue raised in #1375 apply?

#1375 (comment)

@stoffu

This comment has been minimized.

Copy link
Contributor Author

commented Oct 29, 2017

No, this command is identical to sweep_all except that there's always only one input. The tx will always have two outputs, one to the destination and the other to a random address (with zero amount).

@iamsmooth

This comment has been minimized.

Copy link
Contributor

commented Oct 30, 2017

@stoffu Thanks for the explanation. The phrase "with no change" was not clear to me.

Is it better to send to a random address rather than send it back to the same wallet as change (change of zero)? In the latter case we could choose to spend them at some point. That would incur some tx fee, but would avoid the (perhaps insignificant, I'm not sure) reduction of privacy from the fact that these outputs will statistically have one less spend on average than others. (Same applies to sweep_all)

@stoffu stoffu force-pushed the stoffu:sweep-single branch 4 times, most recently from 3ad2c08 to 0504108 Nov 3, 2017

@stoffu stoffu force-pushed the stoffu:sweep-single branch from 0504108 to be43e3a Nov 14, 2017

@fluffypony

This comment has been minimized.

Copy link
Collaborator

commented Nov 14, 2017

@stoffu plz see feedback from smooth

@stoffu

This comment has been minimized.

Copy link
Contributor Author

commented Nov 14, 2017

@iamsmooth @fluffypony
Sorry, I forgot to reply.

That would incur some tx fee, but would avoid the (perhaps insignificant, I'm not sure) reduction of privacy from the fact that these outputs will statistically have one less spend on average than others. (Same applies to sweep_all)

I don't know for sure, but I intuitively feel that the statistical difference is too small to be detected by blockchain analysis. Also, as stated, this point applies to the current sweep_all command, so I think it should be discussed separately from this PR (maybe open a new issue)?

CC: @moneromooo-monero @luigi1111

@moneromooo-monero

This comment has been minimized.

Copy link
Contributor

commented Nov 14, 2017

I agree that discussion needs not delay that PR since it's already the case elsewhere.

@stoffu stoffu force-pushed the stoffu:sweep-single branch 2 times, most recently from dbdf376 to f4224d6 Nov 14, 2017

@iamsmooth

This comment has been minimized.

Copy link
Contributor

commented Nov 15, 2017

I agree it isn't specific to this feature (in particular, sweep_all is similar, though in that case the intent may often be to retire the wallet, so slightly different), so I agree it should not delay this PR at all. I was mostly raising the issue for awareness.

@stoffu

This comment has been minimized.

Copy link
Contributor Author

commented Nov 15, 2017

@iamsmooth I appreciate if you could open an issue on this for later discussion.

@stoffu stoffu force-pushed the stoffu:sweep-single branch from f4224d6 to ab4d78b Nov 15, 2017

@stoffu stoffu force-pushed the stoffu:sweep-single branch from ab4d78b to b738f4b Nov 15, 2017

@fluffypony
Copy link
Collaborator

left a comment

Reviewed

@fluffypony fluffypony merged commit b738f4b into monero-project:master Nov 15, 2017

0 of 5 checks passed

buildbot/monero-android-armv7 Build done.
Details
buildbot/monero-static-alpine-3.5-x86_64 Build done.
Details
buildbot/monero-static-openbsd-amd64 Build done.
Details
buildbot/monero-static-win32 Build done.
Details
buildbot/monero-static-win64 Build done.
Details

fluffypony added a commit that referenced this pull request Nov 15, 2017

Merge pull request #2634
b738f4b wallet: add sweep_single command (stoffu)

@stoffu stoffu deleted the stoffu:sweep-single branch Nov 15, 2017

stoffu added a commit to stoffu/monero that referenced this pull request Nov 15, 2017

stoffu added a commit to stoffu/monero that referenced this pull request Nov 15, 2017

fluffypony added a commit that referenced this pull request Nov 15, 2017

Merge pull request #2818
c4587e8 simplewallet: wrong ns for input_line in sweep_single (fix #2634) (stoffu)

moneromooo-monero added a commit to moneromooo-monero/bitmonero that referenced this pull request Nov 15, 2017

TheCharlatan added a commit to TheCharlatan/monero that referenced this pull request Feb 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.