Commit graph

288 commits

Author SHA1 Message Date
Ilya Kitaev 2dacb193d0 wallet2: wallet2::get_daemon_blockchain_height() clean error message on
success
2016-09-28 00:39:06 +03:00
moneromooo-monero bba6af9064
wallet: cold wallet transaction signing
This change adds the ability to create a new unsigned transaction
from a watch only wallet, and save it to a file. This file can
then be moved to another computer/VM where a cold wallet may load
it, sign it, and save it. That cold wallet does not need to have
a blockchain nor daemon. The signed transaction file can then be
moved back to the watch only wallet, which can load it and send
it to the daemon.

Two new simplewallet commands to use it:
sign_transfer (on the cold wallet)
submit_transfer (on the watch only wallet)

The transfer command used on a watch only wallet now writes an
unsigned transaction set in a file called 'unsigned_monero_tx'
instead of submitting the tx to the daemon as a normal wallet does.
The signed tx file is called 'signed_monero_tx'.
2016-09-27 07:46:39 +01:00
moneromooo-monero 9872dcbbe3
wallet: fix log confusion between bytes and kilobytes 2016-09-26 23:12:43 +01:00
Ilya Kitaev cda4cb969a formatting: 2-spaces indentation 2016-09-26 23:46:07 +03:00
Ilya Kitaev 545a48f098 formatting: 2-spaces indentation 2016-09-26 23:29:53 +03:00
Ilya Kitaev 7b4a85b309 wallet2_api: added Wallet::daemonBlockChainHeight() 2016-09-26 23:19:25 +03:00
moneromooo-monero 7b09e9ff77
wallet: update min mixin for sweep_unmixable on v4 2016-09-24 14:48:34 +01:00
Riccardo Spagni 6b744c349f
Merge pull request #1098
1dd5b0b wallet: keep change dest separate from other dests (moneromooo-monero)
2016-09-18 17:42:32 +02:00
moneromooo-monero 1dd5b0b7df
wallet: keep change dest separate from other dests
This fixes misreporting of amount/fee in rct txes, as the rct
tx construction code was lumping all dests (whether change or
not) in the same dests vector, while the pre-rct code was
keeping it separate.
2016-09-18 12:04:23 +01:00
moneromooo-monero 5f5d7279b6
wallet: fix empty tx in corner case sending nothing 2016-09-18 10:44:32 +01:00
moneromooo-monero 9c7b0cb28e
wallet: change priority/fee to ArticMine's recommendation
We keep 1, 2, 3 multipliers till the fee decrase from 0.01/kB
to 0.002/kB, where we start using 1, 20, 166 multipliers.
This ensures the higher multiplier will compensate for the
block reward penalty when pushing past 100% of the past median.

The fee-multiplier wallet setting is now rename to priority,
since it keeps its [0..3] range, but maps to different multiplier
values.
2016-09-16 11:50:52 +01:00
Riccardo Spagni 7c899ec33a
Merge pull request #1074
cd01bae Decrease minimum fee from 0.01/kB to 0.002/kB (moneromooo-monero)
2016-09-15 15:23:49 +02:00
moneromooo-monero cd01bae735
Decrease minimum fee from 0.01/kB to 0.002/kB
The wallet will start using that fee about two weeks after hard
fork 3, when most people will likely have updated their daemons.
2016-09-15 09:28:33 +01:00
moneromooo-monero 70b78bb2c8
wallet: fix misdetection of duplicates 2016-09-14 20:23:28 +01:00
luigi1111 34bb78956f
Re-add s to rangesigs
Whoops.
2016-09-01 13:53:53 -05:00
luigi1111 dbf017a5f7
Fix some rct tx size calculations
Some variance is still expected
2016-09-01 13:14:31 -05:00
Riccardo Spagni 27c8713f56
Merge pull request #1027
85dc0ce wallet: sanity check on histogram response (moneromooo-monero)
2016-09-01 11:31:58 +02:00
moneromooo-monero 85dc0ce3a5
wallet: sanity check on histogram response 2016-09-01 09:04:45 +01:00
moneromooo-monero 3112e24aa7
wallet: interpret 0 fee multiplier as default for sweep_all too 2016-08-30 13:19:20 +01:00
moneromooo-monero 73b9b4ba34
wallet: fix not finding enough rct fake outputs
If picking coinbase outputs, those are locked for a longer time
than other outputs, so we ask for more of those
2016-08-29 20:51:21 +01:00
moneromooo-monero fbd7c359ee
wallet: fix some "may be used uninitialized" warnings
The compiler can't always work out the _found booleans are
set iff the value is initialized.
2016-08-28 21:30:44 +01:00
moneromooo-monero 4a41dd4068
wallet: do not generate 0 change 2016-08-28 21:30:42 +01:00
moneromooo-monero 45349b6f7c
wallet: do not ask for duplicate histograms 2016-08-28 21:30:36 +01:00
moneromooo-monero b951bc8780
wallet: transfer_selected_rct now also selects fake outs 2016-08-28 21:30:34 +01:00
moneromooo-monero c3b3260ae5
New "Halfway RingCT" outputs for coinbase transactions
When RingCT is enabled, outputs from coinbase transactions
are created as a single output, and stored as RingCT output,
with a fake mask. Their amount is not hidden on the blockchain
itself, but they are then able to be used as fake inputs in
a RingCT ring. Since the output amounts are hidden, their
"dustiness" is not an obstacle anymore to mixing, and this
makes the coinbase transactions a lot smaller, as well as
helping the TXO set to grow more slowly.

Also add a new "Null" type of rct signature, which decreases
the size required when no signatures are to be stored, as
in a coinbase tx.
2016-08-28 21:30:26 +01:00
moneromooo-monero d4b62a1e29
rct amount key modified as per luigi1111's recommendations
This allows the key to be not the same for two outputs sent to
the same address (eg, if you pay yourself, and also get change
back). Also remove the key amounts lists and return parameters
since we don't actually generate random ones, so we don't need
to save them as we can recalculate them when needed if we have
the correct keys.
2016-08-28 21:30:19 +01:00
moneromooo-monero 3ab2ab3e76
rct: change the simple flag to a type
for future expansion
2016-08-28 21:30:14 +01:00
moneromooo-monero a47ceee83b
wallet: do not store signatures in the wallet cache
Saves some substantial space.
Also avoid calculating tx hashes we don't need.
2016-08-28 21:30:10 +01:00
moneromooo-monero 2c9d9519f1
wallet2: factor m_spent changes
Makes it easier to track what is going on.
2016-08-28 21:30:04 +01:00
moneromooo-monero 230fca2d56
wallet: use the prefered rct case only when enough rct outs exist 2016-08-28 21:29:55 +01:00
moneromooo-monero c27194a444
wallet: do not try to use rct txes a few blocks before the fork 2016-08-28 21:29:53 +01:00
moneromooo-monero 37bdf6ebe3
change fork settings to allow pre-rct txes for one more fork cycle 2016-08-28 21:29:50 +01:00
moneromooo-monero 9b70856ccb
rct: make the amount key derivable by a third party with the tx key
Scheme design from luigi1114.
2016-08-28 21:29:46 +01:00
moneromooo-monero cf33e1a52a
rct: do not serialize public keys in outPk
They can be reconstructed from vout
2016-08-28 21:29:43 +01:00
moneromooo-monero 3cb2edec66
rpc: send global indices along with blocks/transacions on refresh
This plugs a privacy leak, where the wallet tells the daemon
which transactions contain outputs for the wallet by asking
for additional information for that particular transaction.

As a nice bonus, this actually makes refresh slightly faster.
2016-08-28 21:29:38 +01:00
moneromooo-monero 84c82cd775
wallet: better tx input selection
We try to avoid related inputs, when possible
2016-08-28 21:29:32 +01:00
moneromooo-monero 07d353dfc6
wallet: handle 0 change properly
With RCT, we allow 0 size outputs, to try and encourage txes
with two inputs and two outputs. Consolidation would then
have two non zero inputs, one zero output, and one larger
output.
2016-08-28 21:29:27 +01:00
moneromooo-monero e81a2b2cfa
port get_tx_key/check_tx_key to rct 2016-08-28 21:29:24 +01:00
moneromooo-monero a4d4d6194b
integrate simple rct api 2016-08-28 21:29:20 +01:00
moneromooo-monero 37c895e5e3
wallet: rct specific output selection
Before the normal selection, we attempt to find either one or two
suitable outputs to use as inputs to the rct tx. The intent is that
most rct txes will have one or two inputs, and we want all to look
the same if possible.
When two outputs are needed, we try to find a pair which are not
related (ie, by being from the same or similar block height).
2016-08-28 21:29:11 +01:00
moneromooo-monero 1181c57967
wallet: make sweep_all work with rct txes too 2016-08-28 21:29:09 +01:00
moneromooo-monero 1017a75460
wallet: factor transfer_rct code with transfer code
The "transfer" simplewallet command is renamed to "transfer_original".
"transfer_new" is renamed "transfer", "transfer_rct" is removed,
and the new "transfer" now selects rct or non rct transactions
based on the current block height.
2016-08-28 21:29:05 +01:00
moneromooo-monero 20e50ec7f7
ringct: do not serialize what can be reconstructed
The mixRing (output keys and commitments) and II fields (key images)
can be reconstructed from vin data.
This saves some modest amount of space in the tx.
2016-08-28 21:28:55 +01:00
moneromooo-monero acbe06d8e9
wallet: update spent status when an accepted tx disappears 2016-08-28 21:28:49 +01:00
moneromooo-monero 089df4af83
wallet: reset output spent status on blockchain reorg
If the blockchain gets reorganized, all outputs spent in the part
of the blockchain that's blown away need to be reset to unspent
(they may end up spent again on the blocks that replace the blocks
that are removed, however).
2016-08-28 21:28:47 +01:00
moneromooo-monero dc4aad7eb5
add rct to the protocol
It is not yet constrained to a fork, so don't use on the real network
or you'll be orphaned or rejected.
2016-08-28 21:28:37 +01:00
Riccardo Spagni 79cdedb90c
Merge pull request #970
25f529a wallet: store key images after importing them (moneromooo-monero)
2016-08-22 22:55:24 +02:00
moneromooo-monero 25f529aa67
wallet: store key images after importing them
It avoids rescan_spent resetting spent status, for example.
2016-08-17 08:37:56 +01:00
moneromooo-monero 9cca53ac29
wallet: fix build on Mac and Windows (missing include)
Reported by RaskaRuby, tested by iDunk5400.
2016-08-17 08:08:49 +01:00
Riccardo Spagni 0faf572db8
Merge pull request #948
11dc091 Fake outs set is now decided by the wallet (moneromooo-monero)
1593553 new unlocked parameter to output_histogram (moneromooo-monero)
2016-08-11 22:43:14 +02:00
moneromooo-monero 11dc091464
Fake outs set is now decided by the wallet
This plugs a privacy leak from the wallet to the daemon,
as the daemon could previously see what input is included
as a transaction input, which the daemon hadn't previously
supplied. Now, the wallet requests a particular set of
outputs, including the real one.

This can result in transactions that can't be accepted if
the wallet happens to select too many outputs with non standard
unlock times. The daemon could know this and select another
output, but the wallet is blind to it. It's currently very
unlikely since I don't think anything uses non default
unlock times. The wallet requests more outputs than necessary
so it can use spares if any of the returns outputs are still
locked. If there are not enough spares to reach the desired
mixin, the transaction will fail.
2016-08-11 14:35:27 +01:00
moneromooo-monero 663fc32809
wallet2: if importing key images fails, print failure index 2016-08-04 08:19:29 +01:00
moneromooo-monero 1593553e03
new unlocked parameter to output_histogram
This constrains the number of instances of any amount
to the unlocked ones (as defined by the default unlock time
setting: outputs with non default unlock time are not
considered, so may be counted as unlocked even if they are
not actually unlocked).
2016-08-01 22:16:00 +01:00
moneromooo-monero ebf97d76f0
wallet: new {ex,im}port_key_images commands and RPC calls
They are used to export a signed set of key images from a wallet
with a private spend key, so an auditor with the matching view key
may see which of those are spent, and which are not.
2016-07-24 09:23:30 +01:00
moneromooo-monero b89b96394a
wallet: add unconfirmed incoming txes from the txpool
Shown in show_transfers simplewallet command, and get_transfers
RPC command, if req.pool is true.
2016-07-20 19:14:44 +01:00
Riccardo Spagni fc3e135b83
Merge pull request #902
014f3a0 Add a daemon RPC version, and make simplewallet check it (moneromooo-monero)
2016-07-20 13:55:59 +02:00
moneromooo-monero 89d9f382a0
wallet: add command and RPC to sign/verify data
Signing is done using the spend key, since the view key may
be shared. This could be extended later, to let the user choose
which key (even a per tx key).
simplewallet's sign/verify API uses a file. The RPC uses a
string (simplewallet can't easily do strings since commands
receive a tokenized set of arguments).
2016-07-19 20:39:03 +01:00
moneromooo-monero 014f3a0d39
Add a daemon RPC version, and make simplewallet check it
If the version is different, simplewallet will refuse to use that
daemon, unless --allow-mismatched-daemon-version is used.
2016-07-10 16:49:40 +01:00
Riccardo Spagni 3923cbddaf
Merge pull request #878
945c272 wallet: add a fee multiplier (moneromooo-monero)
2016-07-06 18:14:34 +02:00
Ilya Kitaev ab61ba0c9b Merge branch 'master' of https://github.com/mbg033/bitmonero 2016-06-23 16:23:09 +03:00
Ilya Kitaev 8df820b301 - testnet option added to api; 2016-06-23 15:49:07 +03:00
Ilya Kitaev 94eaeb50b2 wallet2::store() implemented within wallet2::store_to 2016-06-23 15:40:48 +03:00
moneromooo-monero 945c272f6c
wallet: add a fee multiplier
Fee can now be multiplied by 2 or 3, if users want to give
priority to their transactions. There are only three levels
to avoid too much fingerprinting. Default is 1 (minimum fee).
The default multiplier can be set by "set fee-multiplier X".
2016-06-22 22:21:30 +01:00
Ilya Kitaev bc4584c1ff Merge remote-tracking branch 'upstream/master' 2016-05-27 11:33:08 +03:00
Riccardo Spagni ae205020f6
Merge pull request #827
f1e70d1 Only log 1/N skipped blocks (Howard Chu)
cebb97c Move refresh height to keys file from cache file (Howard Chu)
590c439 Make fast_refresh interruptible (Howard Chu)
687855d Set refresh height earlier (Howard Chu)
2fb00c0 Fix 19fe8ae3ef (Howard Chu)
2016-05-17 19:04:41 +02:00
Ilya Kitaev 2d799097ca Merge remote-tracking branch 'upstream/master' 2016-05-12 15:14:30 +03:00
Howard Chu f1e70d15ca Only log 1/N skipped blocks 2016-04-29 16:50:51 +01:00
Howard Chu cebb97c913 Move refresh height to keys file from cache file 2016-04-29 15:33:28 +01:00
Howard Chu 590c43988c Make fast_refresh interruptible 2016-04-29 15:33:28 +01:00
moneromooo-monero 513a658c87
add a --max-concurrency flag
It sets the max number of threads to use for a parallel job.
This is different that the number of total threads, since monero
binaries typically start a lot of them.
2016-04-28 20:33:59 +01:00
moneromooo-monero 7baed9bd89
wallet: allow attaching notes to txids 2016-04-26 19:07:33 +01:00
moneromooo-monero ce6f8a6324
wallet: add GMT timestamps to transfers/payments 2016-04-26 19:07:25 +01:00
Riccardo Spagni 714dcc2866
Merge pull request #815
b0850a9 wallet: add a new sweep_all command and RPC command (moneromooo-monero)
2016-04-26 18:08:09 +02:00
Riccardo Spagni 7098ad6804
Merge pull request #814
68cbe15 	modified:   src/wallet/wallet2.cpp 	modified:   src/wallet/wallet2.h (awfulcrawler)
4b325bd 	modified:   src/simplewallet/simplewallet.cpp 	modified:   src/wallet/wallet2.cpp 	modified:   src/wallet/wallet2.h (awfulcrawler)
2016-04-26 18:04:00 +02:00
Ilya Kitaev dce5374660 Merge remote-tracking branch 'upstream/master' into develop 2016-04-26 11:08:40 +03:00
moneromooo-monero b0850a9bea
wallet: add a new sweep_all command and RPC command
This sends all outputs in a wallet to a given address, alleviating
the difficulty people have had trying to send all monero but
being left with some small amount left.
2016-04-19 21:20:27 +01:00
awfulcrawler 68cbe1579e modified: src/wallet/wallet2.cpp
modified:   src/wallet/wallet2.h

Removed working comments
2016-04-18 20:20:31 +12:00
awfulcrawler 4b325bdb66 modified: src/simplewallet/simplewallet.cpp
modified:   src/wallet/wallet2.cpp
	modified:   src/wallet/wallet2.h

Update to fix unconfirmed balance and give a slightly more verbose and informative confirmation message for transfers
2016-04-18 14:57:47 +12:00
Howard Chu b7140daea2 Add GET_HASHES_FAST rpc, use it in wallet
When m_refresh_from_block_height has been set, only hashes will be
retrieved up to that height, instead of full blocks. The same will
be done for "refresh <height>" when the specified height is beyond
the current local blockchain.
2016-04-17 15:25:46 +01:00
Riccardo Spagni 8f78f1407e
Merge pull request #784
087373e Fix potential race with parallel processing of txes/signatures/blocks (moneromooo-monero)
2016-04-14 16:25:53 +09:00
Riccardo Spagni 6bfb8799c3
Merge pull request #783
48d0747 wallet: better output selection for transfer/transfer_new (moneromooo-monero)
2016-04-14 16:25:38 +09:00
moneromooo-monero 5c9dd23b1c
rpc: add a do_not_relay boolean to tx submission
Just to make it easier
2016-04-05 20:15:54 +01:00
moneromooo-monero 087373eccf
Fix potential race with parallel processing of txes/signatures/blocks 2016-04-02 14:20:51 +01:00
moneromooo-monero 48d0747d00
wallet: better output selection for transfer/transfer_new
This now requests the set of outputs that can be mixed first,
to avoid trying non dust but unmixable outputs, which we know
will fail.
2016-04-02 14:17:02 +01:00
Riccardo Spagni 4ac6bdbb3f
Merge pull request #769
b4eada9 wallet: make load_keys check types when loading JSON (moneromooo-monero)
3e55725 wallet: make the JSON reading type safe (moneromooo-monero)
f8d05f3 common: new json_util.h (moneromooo-monero)
2016-04-02 12:02:49 +09:00
Riccardo Spagni a38ad63f8f
Merge pull request #767
24b3e90 Convey tx verification failure reasons to the RPC client (moneromooo-monero)
2016-04-02 12:02:07 +09:00
Ilya Kitaev df6026182a Merge remote-tracking branch 'upstream/master' 2016-03-31 12:01:19 +03:00
moneromooo-monero 878ab5d896
wallet: fix --generate-from-keys saving as watch only 2016-03-28 16:46:37 +01:00
moneromooo-monero b4eada907c
wallet: make load_keys check types when loading JSON 2016-03-27 23:39:34 +01:00
moneromooo-monero 24b3e9007a
Convey tx verification failure reasons to the RPC client
This allows appropriate action to be taken, like displaying
the reason to the user.

Do just that in simplewallet, which should help a lot in
determining why users fail to send.

Also make it so a tx which is accepted but not relayed is
seen as a success rather than a failure.
2016-03-27 12:37:18 +01:00
moneromooo-monero 25672d3f10
wallet: pass std::function by const ref, not value
Because we can.
2016-03-26 23:32:45 +00:00
moneromooo-monero 0be6e08dd0
wallet: do not leak owned amounts to the daemon unless --trusted-daemon
This will be slower, though more private.

New trusted_daemon parameter to the matching RPC call, false by default.
2016-03-26 23:29:29 +00:00
moneromooo-monero 12146daeed
wallet: change sweep_dust to sweep_unmixable
With the change in mixin rules for v2, the "annoying" outputs are
slightly changed. There is high correlation between dust and
unmixable, but no equivalence.
2016-03-26 21:15:47 +00:00
moneromooo-monero f9a2fd2ff5
wallet: handle rare case where fee adjustment can bump to the next kB
It resulted in a tx being sent with too low a fee, and thus rejected.
2016-03-26 11:51:58 +00:00
moneromooo-monero f26651ab8a
wallet: factor fee calculation 2016-03-26 11:44:43 +00:00
Ilya Kitaev 8790904cf9 - testnet option added to api; 2016-03-25 17:06:30 +03:00
moneromooo-monero a2e378b91b
wallet: add a --generate-from-json flag
It takes a filename containing JSON data to generate a wallet.
The following fields are valid:

  version: integer, should be 1
  filename: string, path/filename for the newly created wallet
  scan_from_height: 64 bit unsigned integer, optional
  password: string, optional
  viewkey: string, hex representation
  spendkey: string, hex representation
  seed: string, optional, list of words separated by spaces

Either seed or private keys should be given. If using private
keys, the spend key may be omitted (the wallet will not be
able to spend, but will see incoming transactions).

If scan_from_height is given, blocks below this height will not
be checked for transactions as an optimization.
2016-03-25 00:56:11 +00:00
Ilya Kitaev 2cce32995b wallet2::store() implemented within wallet2::store_to 2016-03-21 16:17:03 +03:00
moneromooo-monero f7301c3563
Revert "Print stack trace upon exceptions"
Ain't nobody got time for link/cmake skullduggery.

This reverts commit fff238ec94.
2016-03-21 10:12:23 +00:00
moneromooo-monero fff238ec94
Print stack trace upon exceptions
Useful for debugging users' logs
2016-03-19 21:48:36 +00:00