Commit Graph

6249 Commits

Author SHA1 Message Date
moneromooo-monero fd35e2304a
wallet: fix another facet of "did I get some monero" information leak
We get new pool txes before processing any tx, pool or not.
This ensures that if we're asked for a password, this does not
cause a measurable delay in the txpool query after the last
block query.
2019-11-01 18:59:38 +00:00
moneromooo-monero d5472bd87b
wallet2: do not send an unnecessary last getblocks.bin call on refresh
The "everything refreshed" state was detected when a refresh call did
not return any new blocks. This can be detected without that extra
"empty" call by comparing the claimed node height to the height of
the last block retrieved. Doing this avoids that last call, saves
some bandwidth, and makes the common refresh case use only one call
rather than two.

As a side effect, it prevents an information leak reported by
Tramèr et al: if the wallet retrieves a set of blocks which includes
an output sent to the refreshing wallet, the wallet will prompt the
user for the password to decode the amount and calculate the key
image for the new output, and this will delay subsequent calls to
getblocks.bin, allowing a passive adversary to note the delay and
deduce when the wallet receives at least one output.

This can still happen if the wallet downloads more than 1000 blocks,
since this will be split in several calls, but then the most the
adversary can tell is which 1000 block section the user received
some monero (the adversary can estimate the heights of the blocks
by calculating how many "large" transfers are done, which will be
sections of blocks, the last of which will usually be below 1000,
but the size of the data should allow the actual number of blocks
sent to be determined fairly accurately).

This timing trick still be used via the subsequent scan for incoming
txes in the txpool, which will be fixed later.
2019-11-01 18:59:37 +00:00
moneromooo-monero 97ae7bb5cb
wallet2: do not repeatedly ask for pool txes sent to us
This lets a passive attacker with access to the network link
between node and wallet perform traffic analysis to deduce
when an idle wallet receives a transaction.

Reported by Tramèr et al.
2019-11-01 10:42:01 +00:00
luigi1111 4c9fd8d86d
Merge pull request #6044
eb16755 blockchain: fix unwanted error when probing the pool for a tx (moneromooo-monero)
2019-10-27 16:28:33 -05:00
moneromooo-monero eb16755083
blockchain: fix unwanted error when probing the pool for a tx 2019-10-27 19:23:25 +00:00
moneromooo-monero e8964c26cc
wallet: do not warn if the rpc cost was free 2019-10-27 10:59:31 +00:00
luigi1111 ef8b3a15b4
Merge pull request #6017
5734686 rpc: Include tag in get_info version string (ndorf)
2019-10-25 20:48:04 -05:00
moneromooo-monero f7f7513ec3
rpc: fix PRIx64 build error on some systems 2019-10-26 00:05:21 +00:00
luigi1111 7caa2b0d3e
Merge pull request #6024
296ec7c device: bounds checking in Ledger send_secret/receive_secret (xiphon)
2019-10-25 16:06:37 -05:00
luigi1111 07c6789148
Merge pull request #5958
d25acd7 Add hmac over encrypted value during transaction (clashm)
34f28a7 Add display address (clashm)
235b94e Revert PR #5835 (export view key) (clashm)
32febd2 Fix debug feature (clashm)
2019-10-25 16:03:24 -05:00
luigi1111 86d085e988
Merge pull request #6028
174a6ac tx_pool: fix divide by 0 in log (moneromooo-monero)
2019-10-25 14:29:15 -05:00
luigi1111 f253bf3846
Merge pull request #6007
a4dc575 rpc: add a flush_cache RPC (moneromooo-monero)
2019-10-25 14:20:20 -05:00
luigi1111 9a995f338a
Merge pull request #6023
643dcb9 net: link with libzmq (moneromooo-monero)
2019-10-25 13:56:06 -05:00
luigi1111 68b03abdc5
Merge pull request #6021
65e8a89 Change monerod --proxy to --tx-proxy (vtnerd)
2019-10-25 13:52:19 -05:00
luigi1111 4a67bdbde4
Merge pull request #6019
d60c1b6 changed 'batttery' to 'battery' (jakehemmerle)
2019-10-25 13:45:59 -05:00
luigi1111 711625c467
Merge pull request #6014
93e7426 wallet2: error out when we need a daemon password but have no prompt function (moneromooo-monero)
2019-10-25 13:44:31 -05:00
luigi1111 59439f8113
Merge pull request #6013
635401b wallet2: fix the logged number of detached transfers (moneromooo-monero)
2019-10-25 13:43:00 -05:00
moneromooo-monero a4dc575ccb
rpc: add a flush_cache RPC
This allows flushing internal caches (for now, the bad tx cache,
which will allow debugging a stuck monerod after it has failed to
verify a transaction in a block, since it would otherwise not try
again, making subsequent log changes pointless)
2019-10-25 18:41:54 +00:00
luigi1111 960c215801
Merge pull request #5357
b3a9a4d add a quick early out to get_blocks.bin when up to date (moneromooo-monero)
2899379 daemon, wallet: new pay for RPC use system (moneromooo-monero)
ffa4602 simplewallet: add public_nodes command (moneromooo-monero)
2019-10-25 13:38:21 -05:00
moneromooo-monero 174a6ac9c5
tx_pool: fix divide by 0 in log
Coverity 205394
2019-10-25 16:56:55 +00:00
xiphon 296ec7c9bb device: bounds checking in Ledger send_secret/receive_secret 2019-10-25 13:13:23 +00:00
moneromooo-monero 643dcb9700
net: link with libzmq 2019-10-25 12:06:16 +00:00
moneromooo-monero ffa46026b5
simplewallet: add public_nodes command
Lists nodes exposing their RPC port for public use
2019-10-25 09:34:41 +00:00
moneromooo-monero 2899379791
daemon, wallet: new pay for RPC use system
Daemons intended for public use can be set up to require payment
in the form of hashes in exchange for RPC service. This enables
public daemons to receive payment for their work over a large
number of calls. This system behaves similarly to a pool, so
payment takes the form of valid blocks every so often, yielding
a large one off payment, rather than constant micropayments.

This system can also be used by third parties as a "paywall"
layer, where users of a service can pay for use by mining Monero
to the service provider's address. An example of this for web
site access is Primo, a Monero mining based website "paywall":
https://github.com/selene-kovri/primo

This has some advantages:
 - incentive to run a node providing RPC services, thereby promoting the availability of third party nodes for those who can't run their own
 - incentive to run your own node instead of using a third party's, thereby promoting decentralization
 - decentralized: payment is done between a client and server, with no third party needed
 - private: since the system is "pay as you go", you don't need to identify yourself to claim a long lived balance
 - no payment occurs on the blockchain, so there is no extra transactional load
 - one may mine with a beefy server, and use those credits from a phone, by reusing the client ID (at the cost of some privacy)
 - no barrier to entry: anyone may run a RPC node, and your expected revenue depends on how much work you do
 - Sybil resistant: if you run 1000 idle RPC nodes, you don't magically get more revenue
 - no large credit balance maintained on servers, so they have no incentive to exit scam
 - you can use any/many node(s), since there's little cost in switching servers
 - market based prices: competition between servers to lower costs
 - incentive for a distributed third party node system: if some public nodes are overused/slow, traffic can move to others
 - increases network security
 - helps counteract mining pools' share of the network hash rate
 - zero incentive for a payer to "double spend" since a reorg does not give any money back to the miner

And some disadvantages:
 - low power clients will have difficulty mining (but one can optionally mine in advance and/or with a faster machine)
 - payment is "random", so a server might go a long time without a block before getting one
 - a public node's overall expected payment may be small

Public nodes are expected to compete to find a suitable level for
cost of service.

The daemon can be set up this way to require payment for RPC services:

  monerod --rpc-payment-address 4xxxxxx \
    --rpc-payment-credits 250 --rpc-payment-difficulty 1000

These values are an example only.

The --rpc-payment-difficulty switch selects how hard each "share" should
be, similar to a mining pool. The higher the difficulty, the fewer
shares a client will find.
The --rpc-payment-credits switch selects how many credits are awarded
for each share a client finds.
Considering both options, clients will be awarded credits/difficulty
credits for every hash they calculate. For example, in the command line
above, 0.25 credits per hash. A client mining at 100 H/s will therefore
get an average of 25 credits per second.
For reference, in the current implementation, a credit is enough to
sync 20 blocks, so a 100 H/s client that's just starting to use Monero
and uses this daemon will be able to sync 500 blocks per second.

The wallet can be set to automatically mine if connected to a daemon
which requires payment for RPC usage. It will try to keep a balance
of 50000 credits, stopping mining when it's at this level, and starting
again as credits are spent. With the example above, a new client will
mine this much credits in about half an hour, and this target is enough
to sync 500000 blocks (currently about a third of the monero blockchain).

There are three new settings in the wallet:

 - credits-target: this is the amount of credits a wallet will try to
reach before stopping mining. The default of 0 means 50000 credits.

 - auto-mine-for-rpc-payment-threshold: this controls the minimum
credit rate which the wallet considers worth mining for. If the
daemon credits less than this ratio, the wallet will consider mining
to be not worth it. In the example above, the rate is 0.25

 - persistent-rpc-client-id: if set, this allows the wallet to reuse
a client id across runs. This means a public node can tell a wallet
that's connecting is the same as one that connected previously, but
allows a wallet to keep their credit balance from one run to the
other. Since the wallet only mines to keep a small credit balance,
this is not normally worth doing. However, someone may want to mine
on a fast server, and use that credit balance on a low power device
such as a phone. If left unset, a new client ID is generated at
each wallet start, for privacy reasons.

To mine and use a credit balance on two different devices, you can
use the --rpc-client-secret-key switch. A wallet's client secret key
can be found using the new rpc_payments command in the wallet.
Note: anyone knowing your RPC client secret key is able to use your
credit balance.

The wallet has a few new commands too:

 - start_mining_for_rpc: start mining to acquire more credits,
regardless of the auto mining settings
 - stop_mining_for_rpc: stop mining to acquire more credits
 - rpc_payments: display information about current credits with
the currently selected daemon

The node has an extra command:

 - rpc_payments: display information about clients and their
balances

The node will forget about any balance for clients which have
been inactive for 6 months. Balances carry over on node restart.
2019-10-25 09:34:38 +00:00
Lee Clagett 65e8a89e1c Change monerod --proxy to --tx-proxy 2019-10-24 21:06:31 -04:00
luigi1111 cc46f05f1f
Merge pull request #6002
0136bf7 v12 fork heights (tevador)
2019-10-24 18:57:05 -05:00
Jake Hemmerle d60c1b6312 changed 'batttery' to 'battery' 2019-10-24 19:55:28 -04:00
Nathan Dorfman 57346864a3 rpc: Include tag in get_info version string 2019-10-24 13:48:35 -06:00
luigi1111 81f6c3745e
Merge pull request #5495
28a627c gen_ssl_cert: new tool to generate SSL certs for Monero (moneromooo-monero)
2019-10-24 13:02:39 -05:00
moneromooo-monero 28a627c5ac
gen_ssl_cert: new tool to generate SSL certs for Monero 2019-10-24 17:47:52 +00:00
luigi1111 2200767963
Merge pull request #6004
951ceab daemon: print difficulty in decimal, as it used to be (moneromooo-monero)
2019-10-24 12:43:38 -05:00
luigi1111 87171916ee
Merge pull request #5998
0da09ed protocol: fix syncing from peers being too choosy about peers (moneromooo-monero)
2019-10-24 12:38:35 -05:00
moneromooo-monero 951ceab4f6
daemon: print difficulty in decimal, as it used to be
It got switched to hexadecimal when we went to 128 bit values
2019-10-24 17:37:05 +00:00
luigi1111 f9b5af85ea
Merge pull request #6001
705edd8 daemon: fix coinbase txes always being seen as pruned (moneromooo-monero)
2019-10-24 10:57:30 -05:00
luigi1111 8926829569
Merge pull request #6000
641c9cf daemon: add miner tx hash in print_block output (moneromooo-monero)
2019-10-24 10:56:20 -05:00
luigi1111 bef8d3e381
Merge pull request #5999
fbf8168 utils: Increase max block size for import/export (ndorf)
2019-10-24 10:53:53 -05:00
luigi1111 5f6a06e74c
Merge pull request #5997
37cccb8 db_lmdb: an empty prunable data record means the tx is not pruned (moneromooo-monero)
2019-10-24 10:52:04 -05:00
moneromooo-monero b3a9a4d99d
add a quick early out to get_blocks.bin when up to date 2019-10-24 11:30:54 +00:00
moneromooo-monero 93e74269b3
wallet2: error out when we need a daemon password but have no prompt function 2019-10-23 18:36:53 +00:00
moneromooo-monero 635401b077
wallet2: fix the logged number of detached transfers 2019-10-23 18:29:13 +00:00
luigi1111 4233d88341
Merge pull request #5973
abd3763 cryptonote: fill in tx weight when syncing from pruned blocks (moneromooo-monero)
2019-10-22 10:54:46 -05:00
luigi1111 bb2bcf3521
Merge pull request #5972
9447e72 cryptonote: add function to get weight from a pruned tx (moneromooo-monero)
2019-10-22 10:52:14 -05:00
luigi1111 2c497bc411
Merge pull request #5989
4f583d5 daemon: fix print_pl synopsis missing recent options (moneromooo-monero)
2019-10-22 10:24:09 -05:00
luigi1111 1e9b577f2a
Merge pull request #5985
6fdaaba node.inl, add xmrchain.net IP to hardcoded peers (Gingeropolous)
2019-10-22 10:22:02 -05:00
luigi1111 35da1ce307
Merge pull request #5983
32d6376 simplewallet: add --restore-from-seed alias (moneromooo-monero)
2019-10-22 10:20:46 -05:00
luigi1111 8a88d9186a
Merge pull request #5982
bba5bae implewallet: don't trigger idle lock right after a foreground refresh (moneromooo-monero)
2019-10-22 10:19:35 -05:00
luigi1111 426d2ac8ee
Merge pull request #5981
88c9d90 protocol: initialize block_weight in block_complete_entry ctor (moneromooo-monero)
fe443bb cryptonote: don't leave block_weight uninitialized (moneromooo-monero)
1ba9baf tx_pool: do not divide by 0 (moneromooo-monero)
2019-10-22 10:18:28 -05:00
luigi1111 3fb85857e0
Merge pull request #5980
ea813cf RandomX: update to v1.1.4 (tevador)
2019-10-22 10:16:39 -05:00
luigi1111 99e4c403cb
Merge pull request #5977
e85c838 simplewallet: do not print warning for locked coinbase txes (moneromooo-monero)
2019-10-22 10:14:33 -05:00
luigi1111 cf2d4d9a16
Merge pull request #5974
7fcd0b5 blockchain: initialize pow to ff..ff (moneromooo-monero)
2019-10-22 10:13:34 -05:00