Commit Graph

485 Commits

Author SHA1 Message Date
moneromooo-monero
2a100fd81f
unit_tests: add tests for incremental keccak 2018-08-20 08:47:31 +00:00
moneromooo-monero
70271fa788
common: add a class to safely wrap mlock/munlock
This class will allow mlocking small objects, of which there
may be several per page. It adds refcounting so pages are only
munlocked when the last object on that page munlocks.
2018-08-16 11:57:46 +00:00
moneromooo-monero
e9ffa91257
store secret keys encrypted where possible
The secret spend key is kept encrypted in memory, and
decrypted on the fly when needed.

Both spend and view secret keys are kept encrypted in a JSON
field in the keys file. This avoids leaving the keys in
memory due to being manipulated by the JSON I/O API.
2018-08-16 11:57:43 +00:00
moneromooo-monero
ea37614efe
wallet: wipe seed from memory where appropriate 2018-08-16 09:17:52 +00:00
stoffu
a64f57fe42
wallet2: make --restricted-rpc available for wallet RPC only 2018-08-16 09:54:23 +09:00
luigi1111
b82bcdea2d
Merge pull request #4186
c8226ad unit_tests: use valid key images, pub keys, etc (moneromooo-monero)
2018-08-15 17:44:34 -05:00
luigi1111
01475c36c0
Merge pull request #4165
68b1197 tests: ringdb: use system's temporary dir path (radfish)
2018-08-15 17:33:06 -05:00
luigi1111
5295e4eb82
Merge pull request #4137
63e342b crypto: move null_pkey/null_skey to the cpp file (moneromooo-monero)
0496c7c crypto: do not use boost::value_initialized to init null skey/pkey (moneromooo-monero)
2018-08-15 17:17:34 -05:00
moneromooo-monero
0c8d8f6b2e
unit_tests: remove std::move in return statement
This actually prevents copy elision
2018-08-15 13:38:47 +00:00
stoffu
bcab579864
wallet: allow adjusting number of rounds for the key derivation function 2018-08-08 01:56:54 +09:00
Lee Clagett
26a42fe54a Added features to epee::span<T> :
- Support for classes
  - Added `remove_prefix` function
  - Added `to_mut_span` and `as_mut_byte_span`
2018-08-03 20:33:07 -04:00
Lee Clagett
4616cf2641 Fixed ZMQ-RPC for transactions and GET_BLOCKS_FAST 2018-08-02 07:30:20 +00:00
moneromooo-monero
43f71100bc
blockchain_db: remove unused get_output_key variant
It was actually incorrect, as it would not return commitment
2018-07-30 21:57:47 +00:00
moneromooo-monero
c8226ad1f7
unit_tests: use valid key images, pub keys, etc 2018-07-28 19:39:59 +01:00
luigi1111
3fde902394
Merge pull request #4097
61caab8 crypto: remove slight bias in key generation due to modulo (moneromooo-monero)
2018-07-27 14:23:54 -05:00
redfish
68b1197f5d tests: ringdb: use system's temporary dir path
Fixes failing test during Arch package build (due to attempt to write to
~/.bitmonero/...).

Prefix temp dir path with "monero-" because we are not putting it on the
system, so good to identify ourselves in case the dir gets left over due
to crash, etc.
2018-07-22 14:14:54 -04:00
moneromooo-monero
0496c7c91a
crypto: do not use boost::value_initialized to init null skey/pkey 2018-07-20 23:06:22 +01:00
luigi1111
f6d7e87b67
Merge pull request #4075
438d52d remove epee from link lines where it's redundant (moneromooo-monero)
2018-07-19 14:10:20 -05:00
luigi1111
007b835daa
Merge pull request #4061
e6f4d4a unit_tests: do not recreate the same base rct sig all the time (moneromooo-monero)
2018-07-19 14:03:38 -05:00
luigi1111
3e026ff6ed
Merge pull request #4013
e5592c4 rpc: add blockchain disk size to getinfo (moneromooo-monero)
2018-07-19 13:40:42 -05:00
luigi1111
21afa71ba6
Merge pull request #3981
45e419b db: store cumulative rct output distribution in the db for speed (moneromooo-monero)
2018-07-19 13:39:24 -05:00
luigi1111
025187e6c9
Merge pull request #3854
149da42 db_lmdb: enable batch transactions by default (stoffu)
34cb6b4 add --regtest and --fixed-difficulty for regression testing (vicsn)
9e1403e update get_info RPC and bump RPC version (vicsn)
207b66e first new functional tests (vicsn)
2018-07-19 13:35:25 -05:00
luigi1111
33122ab8a6
Merge pull request #3617
4c00a4d unit_tests: add device unit tests (moneromooo-monero)
2018-07-19 13:32:36 -05:00
moneromooo-monero
45e419bd5c
db: store cumulative rct output distribution in the db for speed
This gets rid of the temporary precalc cache.

Also make the RPC able to send data back in binary or JSON,
since there can be a lot of data

This bumps the LMDB database format to v3, with migration.
2018-07-13 11:37:04 +01:00
moneromooo-monero
61caab8a8c
crypto: remove slight bias in key generation due to modulo 2018-07-05 09:18:01 +01:00
victorsintnicolaas
34cb6b4b70 add --regtest and --fixed-difficulty for regression testing
on_generateblocks RPC call combines functionality from the on_getblocktemplate and on_submitblock RPC calls to allow rapid block creation. Difficulty is set permanently to 1 for regtest.
Makes use of FAKECHAIN network type, but takes hard fork heights from mainchain
Default reserve_size in generate_blocks RPC call is now 1. If it is 0, the following error occurs 'Failed to calculate offset for'.
Queries hard fork heights info of other network types
2018-06-29 10:06:11 +02:00
moneromooo-monero
438d52deaf
remove epee from link lines where it's redundant
For some reason, this confuses and kills ASAN on startup
as it thinks const uint8_t ipv4_network_address::ID is
defined multiple times.
2018-06-28 16:45:22 +01:00
luigi1111
a844844cda
Merge pull request #3716
a2b557f 6795bd0 209ec96 ed2c81e a830db2 57ea902 31a895e ba8331c f7f1917 41be339 f025ae9 ef2cb63 dcfd299 5d3e702 2704624 2771a18 0e4c7d0 (moneromooo-monero)
2018-06-27 15:33:01 -05:00
moneromooo-monero
e6f4d4acf0
unit_tests: do not recreate the same base rct sig all the time
Helps a bit when running with valgrind
2018-06-27 11:11:14 +01:00
moneromooo-monero
2771a18e85
threadpool: allow leaf functions to run concurrently
Decrease the number of worker threads by one to account
for the fact the calling thread acts as a worker thread now
2018-06-26 22:15:22 +01:00
moneromooo-monero
ed2c81ed95
replace std::list with std::vector on some hot paths
also use reserve where appropriate
2018-06-26 22:14:21 +01:00
luigi1111
8fad35f8e2
Merge pull request #3962
55c7fb8 epee: adaptive connection timeout system (moneromooo-monero)
2018-06-25 15:12:37 -05:00
moneromooo-monero
e5592c4bab
rpc: add blockchain disk size to getinfo
This should help new nodes predict how much disk space will be
needed for a full sync
2018-06-20 23:48:37 +01:00
luigi1111
34c57d071f
Merge pull request #3938
01cc978 ringct: remove an unnecessary scalarmultBase in zeroCommit (moneromooo-monero)
2018-06-20 14:51:31 -05:00
luigi1111
c678413a89
Merge pull request #3902
f8dd433 epee: fix detection of 172.16.0.0/172.31.255.255 local IP range (moneromooo-monero)
5db9e3c unit_tests: add tests for local IP range detection (moneromooo-monero)
2018-06-20 14:22:44 -05:00
luigi1111
cfd66dae4b
Merge pull request #3691
db55263 threadpool: allow constructing an object, and misc tweaks (moneromooo-monero)
ce173cb core: remove threadpool dependency from header (moneromooo-monero)
3147468 unit_tests: add threadpool unit test (moneromooo-monero)
2018-06-17 22:04:39 -05:00
moneromooo-monero
55c7fb87a9
epee: adaptive connection timeout system
a connection's timeout is halved for every extra connection
from the same host.

Also keep track of when we don't need to use a connection
anymore, so we can close it and free the resource for another
connection.

Also use the longer timeout for non routable local addresses.
2018-06-10 19:39:38 +01:00
luigi1111
22c8730261
Merge pull request #3450
3b941be core: add get_earliest_ideal_height_for_version() (stoffu)
2018-06-08 14:31:49 -05:00
luigi1111
5321769b65
Merge pull request #3444
a79fc21 hardfork: fix get_earliest_ideal_height_for_version() to support non-existent versions (stoffu)
7e30ead unit_tests/hardfork: add tests for check_for_height() (stoffu)
98cf62c hardfork: fix get_next_version() (stoffu)
0321d1a unit_tests/hardfork: add tests for get_voting_info() (stoffu)
2018-06-08 14:29:38 -05:00
moneromooo-monero
01cc978722
ringct: remove an unnecessary scalarmultBase in zeroCommit 2018-06-06 10:14:36 +01:00
moneromooo-monero
5db9e3c28e
unit_tests: add tests for local IP range detection 2018-06-01 21:47:25 +01:00
luigi1111
b6eb7484d1
Merge pull request #3592
90a16b1 crypto: fix initialization order issue with random mutex (moneromooo-monero)
6a61f52 unit_tests: add ringdb unit tests (moneromooo-monero)
2018-05-31 14:41:17 -05:00
stoffu
0321d1ac79
unit_tests/hardfork: add tests for get_voting_info() 2018-05-30 09:49:58 +09:00
stoffu
98cf62cc45
hardfork: fix get_next_version() 2018-05-30 09:49:57 +09:00
stoffu
7e30eadb32
unit_tests/hardfork: add tests for check_for_height() 2018-05-30 09:49:55 +09:00
stoffu
a79fc219b7
hardfork: fix get_earliest_ideal_height_for_version() to support non-existent versions 2018-05-30 09:49:52 +09:00
luigi1111
c534fe8d19
Merge pull request #3251
b9389e5 db_lmdb: save pruned and prunable tx data separately (moneromooo-monero)
2018-05-29 17:56:26 -05:00
moneromooo-monero
b9389e582e
db_lmdb: save pruned and prunable tx data separately
This bumps DB version to 2, migration code will run for v1 DBs
2018-05-23 22:48:12 +01:00
moneromooo-monero
64f82e0481
unit_tests: fix build after get_output_didstribution signature change 2018-05-21 20:49:02 +01:00
moneromooo-monero
5f8ffca34d
speed up get_output_distribution (and precalc common case) 2018-05-21 19:51:58 +01:00
Riccardo Spagni
2906a24179
Merge pull request #3809
b88c9a00 unit_tests: set default data dir to the source tree at build time (moneromooo-monero)
2018-05-21 20:44:07 +02:00
Riccardo Spagni
ff31611a32 Revert "Merge pull request #3775"
This reverts commit 20ef37bbca, reversing
changes made to 40070a661f.
2018-05-21 20:30:31 +02:00
moneromooo-monero
3147468d35
unit_tests: add threadpool unit test 2018-05-20 12:06:10 +01:00
moneromooo-monero
b88c9a003e
unit_tests: set default data dir to the source tree at build time 2018-05-15 21:45:34 +01:00
moneromooo-monero
c1886155ed
unit_tests: fix build after get_output_didstribution signature change 2018-04-28 18:02:58 +01:00
Thaer Khawaja
dad1077577 Only log an error if fork version is higher AND is not known. 2018-04-22 17:26:44 -07:00
moneromooo-monero
4c00a4d31e
unit_tests: add device unit tests
Annoyingly, its locking semantics are borked since it does not
do any locking
2018-04-12 13:49:05 +01:00
moneromooo-monero
6a61f520e2
unit_tests: add ringdb unit tests 2018-04-11 11:43:39 +01:00
stoffu
3b941befae
core: add get_earliest_ideal_height_for_version() 2018-03-21 01:53:24 +09:00
moneromooo-monero
41f727ce42
add RPC to get a histogram of outputs of a given amount 2018-03-16 10:32:26 +00:00
Riccardo Spagni
4f93f74528
Merge pull request #3277
0e7ad2e2 Wallet API: generalize 'bool testnet' to 'NetworkType nettype' (stoffu)
af773211 Stagenet (stoffu)
cc9a0bee command_line: allow args to depend on more than one args (stoffu)
55f8d917 command_line::get_arg: remove 'required' for dependent args as they're always optional (stoffu)
450306a0 command line: allow has_arg to handle arg_descriptor<bool,false,true> #3318 (stoffu)
9f9e095a Use `genesis_tx` parameter in `generate_genesis_block`. #3261 (Jean Pierre Dudey)
2018-03-05 19:11:20 +02:00
Edward Betts
fbcc91c2a4 Correct spelling mistakes. 2018-03-05 17:00:40 +00:00
stoffu
af773211cb
Stagenet 2018-03-05 11:55:05 +09:00
cslashm
e745c1e38d Code modifications to integrate Ledger HW device into monero-wallet-cli.
The basic approach it to delegate all sensitive data (master key, secret
ephemeral key, key derivation, ....) and related operations to the device.
As device has low memory, it does not keep itself the values
(except for view/spend keys) but once computed there are encrypted (with AES
are equivalent) and return back to monero-wallet-cli. When they need to be
manipulated by the device, they are decrypted on receive.

Moreover, using the client for storing the value in encrypted form limits
the modification in the client code. Those values are transfered from one
C-structure to another one as previously.

The code modification has been done with the wishes to be open to any
other hardware wallet. To achieve that a C++ class hw::Device has been
introduced. Two initial implementations are provided: the "default", which
remaps all calls to initial Monero code, and  the "Ledger", which delegates
all calls to Ledger device.
2018-03-04 12:54:53 +01:00
Riccardo Spagni
421ab3119c
Merge pull request #3245
54c256bc unit_tests.serialization: refactored with ASSERT_EQ_MAP (stoffu)
e6a60938 unit_tests: added gtest utility ASSERT_EQ_MAP for easily testing key-value map (stoffu)
2018-02-20 17:53:52 +02:00
stoffu
54c256bc26
unit_tests.serialization: refactored with ASSERT_EQ_MAP 2018-02-12 21:56:51 +09:00
stoffu
e6a6093871
unit_tests: added gtest utility ASSERT_EQ_MAP for easily testing key-value map 2018-02-12 21:56:36 +09:00
moneromooo-monero
71806327f5
dns: change default DNS to a worldwide selection
DNSSEC aware servers picked from https://wiki.ipfire.org/dns/public-servers
2018-02-08 09:46:16 +00:00
Riccardo Spagni
86da46e224
Merge pull request #3151
ab2e9953 unit_tests: do not ASSERT_TRUE(decodeRct(...)) (moneromooo-monero)
2018-01-27 17:25:55 -08:00
xmr-eric
84a7f6a482 Readd copyright starting date 2018-01-26 10:03:20 -05:00
xmr-eric
18216f19dd Update 2018 copyright 2018-01-26 10:03:20 -05:00
Riccardo Spagni
0a94399a05
Merge pull request #3082
8b50209c fix for warning (Onur Altun)
2018-01-25 16:49:20 -08:00
Riccardo Spagni
ede4e1c54c
Merge pull request #3057
9ffa97fe Factor the monero donation address (Maxithi)
2018-01-25 16:46:18 -08:00
moneromooo-monero
ab2e9953b4
unit_tests: do not ASSERT_TRUE(decodeRct(...))
decodeRct returns the amount, which may be zero
2018-01-18 13:55:51 +00:00
Riccardo Spagni
f9c66ba67c
Merge pull request #2990
2d17feb0 factor STL container serialization (moneromooo-monero)
2018-01-10 11:53:05 +01:00
Riccardo Spagni
ab8a32429a
Merge pull request #2985
6d8b29ef fix some link errors in debug mode for macos (stoffu)
fdd4c5e5 move memwipe to epee to avoid common<->crypto circular dependencies (moneromooo-monero)
40ab12a7 epee: remove dependency on common (moneromooo-monero)
2018-01-10 11:50:58 +01:00
Riccardo Spagni
0a110aefbb
Merge pull request #2971
ae860230 Fix exceptions not finding txpool txes when relaying (moneromooo-monero)
2018-01-10 11:45:15 +01:00
moneromooo-monero
fdd4c5e577
move memwipe to epee to avoid common<->crypto circular dependencies 2018-01-10 01:57:54 +00:00
moneromooo-monero
40ab12a773
epee: remove dependency on common 2018-01-10 01:57:51 +00:00
Onur Altun
8b50209ca0
fix for warning
monero/tests/unit_tests/memwipe.cpp:50:8: Warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
     if (wipe) ASSERT_TRUE(memcmp(quux, "bar", 3));
2018-01-08 06:58:48 +03:00
Maxithi
9ffa97fe98
Factor the monero donation address
Signed-off-by: Maxithi <34792056+Maxithi@users.noreply.github.com>
2018-01-05 12:58:40 +01:00
Riccardo Spagni
989c9309ec
Merge pull request #2964
3ed1a74c tests: remove unused/unfinished keccak bits (moneromooo-monero)
2018-01-02 00:30:54 +02:00
Riccardo Spagni
753215b9c6
Merge pull request #2963
0e19a394 tests: test wallets don't need a dummy temp file anymore (moneromooo-monero)
2018-01-02 00:30:33 +02:00
Riccardo Spagni
838b2e8a52
Merge pull request #2944
223e3788 unit_tests: fix memwipe test comparison (moneromooo-monero)
2017-12-28 08:59:01 +02:00
moneromooo-monero
1e5491e942
Add a chacha20 variant to go with chacha8 2017-12-25 19:28:03 +00:00
Riccardo Spagni
2b00899bb2
Merge pull request #2920
bd5cce07 network_throttle: fix ineffective locking (moneromooo-monero)
e0a61299 network_throttle: remove unused xxx static member (moneromooo-monero)
24f584d9 cryptonote_core: remove unused functions with off by one bugs (moneromooo-monero)
b1634aa3 blockchain: don't leave dangling pointers in this (moneromooo-monero)
8e60b81c cryptonote_core: fix db leak on error (moneromooo-monero)
213e326c abstract_tcp_server2: log init_server errors as fatal (moneromooo-monero)
b51dc566 use const refs in for loops for non tiny types (moneromooo-monero)
f0568ca6 net_parse_helpers: fix regex error checking (moneromooo-monero)
b49ddc76 check accessing an element past the end of a container (moneromooo-monero)
2305bf26 check return value for generate_key_derivation and derive_public_key (moneromooo-monero)
a4240d9f catch const exceptions (moneromooo-monero)
45a1c4c0 add empty container sanity checks when using front() and back() (moneromooo-monero)
56fa6ce1 tests: fix a buffer overread in a unit test (moneromooo-monero)
b4524892 rpc: guard against json parsing a non object (moneromooo-monero)
c2ed8618 easylogging++: avoid buffer underflow (moneromooo-monero)
187a6ab2 epee: trap failure to parse URI from request (moneromooo-monero)
061789b5 checkpoints: trap failure to load JSON checkpoints (moneromooo-monero)
ba2fefb9 checkpoints: pass std::string by const ref, not const value (moneromooo-monero)
38c8f4e0 mlog: terminate a string at last char, just in case (moneromooo-monero)
d753d716 fix a few leaks by throwing objects, not newed pointers to objects (moneromooo-monero)
fe568db8 p2p: use size_t for arbitrary counters instead of uint8_t (moneromooo-monero)
46d6fa35 cryptonote_protocol: sanity check chain hashes from peer (moneromooo-monero)
25584f86 cryptonote_protocol: print peer versions when unexpected (moneromooo-monero)
490a5d41 rpc: do not try to use an invalid txid in relay_tx (moneromooo-monero)
2017-12-25 21:17:52 +02:00
Riccardo Spagni
2f09828ea8
Merge pull request #2890
83b0f9e6 version: add -master to master version (moneromooo-monero)
493f7d09 util: allow non numeric version parts (moneromooo-monero)
2017-12-25 21:13:59 +02:00
moneromooo-monero
2d17feb060
factor STL container serialization 2017-12-22 19:47:12 +00:00
moneromooo-monero
ae8602303a
Fix exceptions not finding txpool txes when relaying 2017-12-20 13:02:53 +00:00
moneromooo-monero
3ed1a74ca3
tests: remove unused/unfinished keccak bits
The author doesn't seem to be finishing/fixing this, and it
doesn't do anything.
2017-12-19 13:14:12 +00:00
moneromooo-monero
0e19a39469
tests: test wallets don't need a dummy temp file anymore 2017-12-19 12:56:21 +00:00
moneromooo-monero
56fa6ce15f
tests: fix a buffer overread in a unit test
and remove a leftover debugging sanity check
2017-12-18 15:15:37 +00:00
moneromooo-monero
a36c261d7a
wallet2: fix slow multisig unit tests with subaddress patch
While there, move the wallet2 ctor to the cpp file as it's a huge
amount of init list now, and remove an unused one.
2017-12-17 16:12:30 +00:00
moneromooo-monero
265290388b
wallet: guard against partly initialized multisig wallet 2017-12-17 16:12:18 +00:00
moneromooo-monero
f4eda44ce3
N-1/N multisig 2017-12-17 16:12:12 +00:00
moneromooo-monero
fff871a455
gen_multisig: generates multisig wallets if participants trust each other 2017-12-17 16:12:06 +00:00
moneromooo-monero
95a21a793d
wallet2: allow empty wallet filename to avoid saving data
Useful to speed tests up and avoid unnecessary leftover files
2017-12-17 16:12:03 +00:00
moneromooo-monero
b84b3565f3
tests: add multisig unit tests 2017-12-17 16:12:00 +00:00
moneromooo-monero
4c313324b1
Add N/N multisig tx generation and signing
Scheme by luigi1111:

    Multisig for RingCT on Monero

    2 of 2

    User A (coordinator):
    Spendkey b,B
    Viewkey a,A (shared)

    User B:
    Spendkey c,C
    Viewkey a,A (shared)

    Public Address: C+B, A

    Both have their own watch only wallet via C+B, a

    A will coordinate spending process (though B could easily as well, coordinator is more needed for more participants)

    A and B watch for incoming outputs

    B creates "half" key images for discovered output D:
    I2_D = (Hs(aR)+c) * Hp(D)

    B also creates 1.5 random keypairs (one scalar and 2 pubkeys; one on base G and one on base Hp(D)) for each output, storing the scalar(k) (linked to D),
    and sending the pubkeys with I2_D.

    A also creates "half" key images:
    I1_D = (Hs(aR)+b) * Hp(D)

    Then I_D = I1_D + I2_D

    Having I_D allows A to check spent status of course, but more importantly allows A to actually build a transaction prefix (and thus transaction).

    A builds the transaction until most of the way through MLSAG_Gen, adding the 2 pubkeys (per input) provided with I2_D
    to his own generated ones where they are needed (secret row L, R).

    At this point, A has a mostly completed transaction (but with an invalid/incomplete signature). A sends over the tx and includes r,
    which allows B (with the recipient's address) to verify the destination and amount (by reconstructing the stealth address and decoding ecdhInfo).

    B then finishes the signature by computing ss[secret_index][0] = ss[secret_index][0] + k - cc[secret_index]*c (secret indices need to be passed as well).

    B can then broadcast the tx, or send it back to A for broadcasting. Once B has completed the signing (and verified the tx to be valid), he can add the full I_D
    to his cache, allowing him to verify spent status as well.

    NOTE:
    A and B *must* present key A and B to each other with a valid signature proving they know a and b respectively.
    Otherwise, trickery like the following becomes possible:
    A creates viewkey a,A, spendkey b,B, and sends a,A,B to B.
    B creates a fake key C = zG - B. B sends C back to A.
    The combined spendkey C+B then equals zG, allowing B to spend funds at any time!
    The signature fixes this, because B does not know a c corresponding to C (and thus can't produce a signature).

    2 of 3

    User A (coordinator)
    Shared viewkey a,A
    "spendkey" j,J

    User B
    "spendkey" k,K

    User C
    "spendkey" m,M

    A collects K and M from B and C
    B collects J and M from A and C
    C collects J and K from A and B

    A computes N = nG, n = Hs(jK)
    A computes O = oG, o = Hs(jM)

    B anc C compute P = pG, p = Hs(kM) || Hs(mK)
    B and C can also compute N and O respectively if they wish to be able to coordinate

    Address: N+O+P, A

    The rest follows as above. The coordinator possesses 2 of 3 needed keys; he can get the other
    needed part of the signature/key images from either of the other two.

    Alternatively, if secure communication exists between parties:
    A gives j to B
    B gives k to C
    C gives m to A

    Address: J+K+M, A

    3 of 3

    Identical to 2 of 2, except the coordinator must collect the key images from both of the others.
    The transaction must also be passed an additional hop: A -> B -> C (or A -> C -> B), who can then broadcast it
    or send it back to A.

    N-1 of N

    Generally the same as 2 of 3, except participants need to be arranged in a ring to pass their keys around
    (using either the secure or insecure method).
    For example (ignoring viewkey so letters line up):
    [4 of 5]
    User: spendkey
    A: a
    B: b
    C: c
    D: d
    E: e

    a -> B, b -> C, c -> D, d -> E, e -> A

    Order of signing does not matter, it just must reach n-1 users. A "remaining keys" list must be passed around with
    the transaction so the signers know if they should use 1 or both keys.
    Collecting key image parts becomes a little messy, but basically every wallet sends over both of their parts with a tag for each.
    Thia way the coordinating wallet can keep track of which images have been added and which wallet they come from. Reasoning:
    1. The key images must be added only once (coordinator will get key images for key a from both A and B, he must add only one to get the proper key actual key image)
    2. The coordinator must keep track of which helper pubkeys came from which wallet (discussed in 2 of 2 section). The coordinator
    must choose only one set to use, then include his choice in the "remaining keys" list so the other wallets know which of their keys to use.

    You can generalize it further to N-2 of N or even M of N, but I'm not sure there's legitimate demand to justify the complexity. It might
    also be straightforward enough to support with minimal changes from N-1 format.
    You basically just give each user additional keys for each additional "-1" you desire. N-2 would be 3 keys per user, N-3 4 keys, etc.

The process is somewhat cumbersome:

To create a N/N multisig wallet:

 - each participant creates a normal wallet
 - each participant runs "prepare_multisig", and sends the resulting string to every other participant
 - each participant runs "make_multisig N A B C D...", with N being the threshold and A B C D... being the strings received from other participants (the threshold must currently equal N)

As txes are received, participants' wallets will need to synchronize so that those new outputs may be spent:

 - each participant runs "export_multisig FILENAME", and sends the FILENAME file to every other participant
 - each participant runs "import_multisig A B C D...", with A B C D... being the filenames received from other participants

Then, a transaction may be initiated:

 - one of the participants runs "transfer ADDRESS AMOUNT"
 - this partly signed transaction will be written to the "multisig_monero_tx" file
 - the initiator sends this file to another participant
 - that other participant runs "sign_multisig multisig_monero_tx"
 - the resulting transaction is written to the "multisig_monero_tx" file again
 - if the threshold was not reached, the file must be sent to another participant, until enough have signed
 - the last participant to sign runs "submit_multisig multisig_monero_tx" to relay the transaction to the Monero network
2017-12-17 16:11:57 +00:00
Riccardo Spagni
066fd7aced
Merge pull request #2877
43f5269f Wallets now do not depend on the daemon rpc lib (moneromooo-monero)
bb89ae8b move connection_basic and network_throttle from src/p2p to epee (moneromooo-monero)
4abf25f3 cryptonote_core does not depend on p2p anymore (moneromooo-monero)
2017-12-17 12:59:44 +02:00
moneromooo-monero
223e3788ac
unit_tests: fix memwipe test comparison
free might overwrite the memory, so we can't expect to see
the NULs we overwrote with, but at least we shouldn't see
the original data.
2017-12-17 09:56:36 +00:00
moneromooo-monero
4abf25f3c9
cryptonote_core does not depend on p2p anymore
As a followon side effect, this makes a lot of inline code
included only in particular cpp files (and instanciated
when necessary.
2017-12-16 23:28:38 +00:00
moneromooo-monero
09ce03d612
move includes around to lessen overall load 2017-12-16 22:46:38 +00:00
Riccardo Spagni
6c0953b15a
Merge pull request #2860
3dffe71b new wipeable_string class to replace std::string passphrases (moneromooo-monero)
7a2a5741 utils: initialize easylogging++ in on_startup (moneromooo-monero)
54950829 use memwipe in a few relevant places (moneromooo-monero)
000666ff add a memwipe function (moneromooo-monero)
2017-12-16 23:19:27 +02:00
moneromooo-monero
d58835b2f6
integrate bulletproofs into monero 2017-12-08 13:48:15 +00:00
moneromooo-monero
90b8d9f271
add bulletproofs to the build, with basic unit tests
Based on Java code from Sarang Noether
2017-12-08 13:41:13 +00:00
moneromooo-monero
493f7d0974
util: allow non numeric version parts 2017-12-07 10:32:48 +00:00
moneromooo-monero
3dffe71b72
new wipeable_string class to replace std::string passphrases 2017-11-27 22:25:57 +00:00
moneromooo-monero
000666ff78
add a memwipe function
It's meant to avoid being optimized out

memory_cleanse lifted from bitcoin
2017-11-27 22:15:34 +00:00
moneromooo-monero
f493eabba7
unit_tests: fix running without --data-dir
While there, also use the new is_arg_defaulted API instead of
going to poke the internal API directly.
2017-11-15 10:45:14 +00:00
Riccardo Spagni
5c2dfe157b
Merge pull request #2771
e3e838d0 kaccak: remove unused return value (moneromooo-monero)
4877aca2 keccak: some paranoid "can't happen" checks (moneromooo-monero)
2017-11-15 11:22:56 +02:00
Riccardo Spagni
74b699beda
Merge pull request #2812
9ac52127 unit_tests: fix build after wallet2 list/vector change (moneromooo-monero)
2017-11-14 21:33:38 +02:00
Riccardo Spagni
edebe4e3b6
Merge pull request #2736
0d9c0db9 Do not build against epee_readline if it was not built (Howard Chu)
178014c9 split off readline code into epee_readline (moneromooo-monero)
a9e14a19 link against readline only for monerod and wallet-wallet-{rpc,cli} (moneromooo-monero)
437421ce wallet: move some scoped_message_writer calls from the libs (moneromooo-monero)
e89994e9 wallet: rejig to avoid prompting in wallet2 (moneromooo-monero)
ec5135e5 move input_line from command_line to simplewallet (moneromooo-monero)
082db75f move cryptonote command line options to cryptonote_core (moneromooo-monero)
2017-11-14 21:31:51 +02:00
moneromooo-monero
9ac5212775
unit_tests: fix build after wallet2 list/vector change 2017-11-14 18:30:58 +00:00
moneromooo-monero
082db75f28
move cryptonote command line options to cryptonote_core
Those have no reason to be in a generic module
2017-11-14 17:06:19 +00:00
moneromooo-monero
383ff4f689
remove "using namespace std" from headers
It's nasty, and actually breaks on Solaris, where if.h fails to
build due to:

  struct map *if_memmap;
2017-11-14 16:56:10 +00:00
Riccardo Spagni
4754390725
Merge pull request #2720
110339f5 unit_tests: fix data dir determination (moneromooo-monero)
2017-11-14 15:16:23 +02:00
Riccardo Spagni
8df6b010eb
Merge pull request #2696
937e7f8a Initialize openssl on startup (moneromooo-monero)
2017-11-14 15:13:44 +02:00
Riccardo Spagni
5d52463b57
Merge pull request #2670
4fb77946 unit tests: OOB indexes & adding subaddress (Cole Lightfighter)
4fd6a3d2 Subaddress unit tests (Cole Lightfighter)
2017-11-14 15:01:49 +02:00
Riccardo Spagni
9317c9c57e
Merge pull request #2617
7dbf76d0 Fix an object lifetime bug in net load tests (moneromooo-monero)
2017-11-14 14:54:05 +02:00
moneromooo-monero
e3e838d0cf
kaccak: remove unused return value 2017-11-11 11:20:48 +00:00
binaryFate
10013e9434 Protect node privacy by proper filtering in restricted-mode RPC answers
This patch allows to filter out sensitive information for queries that rely on the pool state, when running in restricted mode.
This filtering is only applied to data sent back to RPC queries. Results of inline commands typed locally in the daemon are not affected.
In practice, when running with `--restricted-rpc`:
* get_transaction_pool will list relayed transactions with the fields "last relayed time" and "received time" set to zero.
* get_transaction_pool will not list transaction that have do_not_relay set to true, and will not list key images that are used only for such transactions
* get_transaction_pool_hashes.bin will not list such transaction
* get_transaction_pool_stats will not count such transactions in any of the aggregated values that are computed

The implementation does not make filtering the default, so developers should be mindful of this if they add new RPC functionality.
Fixes #2590.
2017-11-08 13:07:07 +01:00
Riccardo Spagni
9d65a9cc98
Merge pull request #2483
ff7745bb Edited test readme for accuracy and depth (Cole Lightfighter)
c300ae56 Added test documentation & Keccak unit test (Cole Lightfighter)
f6119a8e Added test documentation & Keccak unit test (Cole Lightfighter)
2017-11-06 01:52:08 +02:00
moneromooo-monero
110339f553
unit_tests: fix data dir determination 2017-10-24 10:22:46 +01:00
moneromooo-monero
937e7f8aa6
Initialize openssl on startup 2017-10-21 10:17:18 +01:00
Cole Lightfighter
4fb7794651 unit tests: OOB indexes & adding subaddress
Tests for checking proper error throwing for out-of-bounds subaddress
indexes, and proper addition of subaddresses.

Signed-off-by: Cole Lightfighter <cole@onicsla.bz>
2017-10-19 20:33:58 -06:00
Cole Lightfighter
4fd6a3d27f Subaddress unit tests
Basic unit test fixture, and initialization of a subaddress account.

Signed-off-by: Cole Lightfighter <cole@onicsla.bz>
2017-10-17 10:59:53 -06:00
moneromooo-monero
8233a24ba8
unit_tests: fix build on windows
Reported by iDunk on IRC
2017-10-16 09:37:51 +01:00
Riccardo Spagni
b4126266d4
Merge pull request #2610
44c1d160 unit_tests: fix compiling on Windows (iDunk5400)
2017-10-15 18:54:32 +02:00
Riccardo Spagni
6159a83175
Merge pull request #2608
fe484f30 unit_tests: data dir is now overridden with --data-dir (moneromooo-monero)
2017-10-15 18:54:16 +02:00
Riccardo Spagni
cb9b1fcc94
Merge pull request #2582
240f769d tests: add sha256sum unit test (moneromooo-monero)
2017-10-15 18:36:38 +02:00
Riccardo Spagni
1c546e0d81
Merge pull request #2565
452d4fae tests: fix hashchain unit tests (moneromooo-monero)
2017-10-15 18:27:08 +02:00
Riccardo Spagni
56ea442fd3
Merge pull request #2555
a4b4651c dns_utils: allow an optional DNS server IP in DNS_PUBLIC (moneromooo-monero)
2017-10-15 17:33:09 +02:00
Riccardo Spagni
5df4ecbb83
Merge pull request #2528
551a8ea6 mnemonics: new Lojban word list (Wei Tang)
2017-10-15 17:27:58 +02:00
Riccardo Spagni
5ea20d6944
Merge pull request #2469
7adceee6 precomputed block hashes are now in blocks of N (currently 256) (moneromooo-monero)
2017-10-15 17:23:50 +02:00
moneromooo-monero
a4b4651cb0
dns_utils: allow an optional DNS server IP in DNS_PUBLIC
tcp://a.b.c.d
2017-10-10 12:29:05 +01:00
moneromooo-monero
7dbf76d0da
Fix an object lifetime bug in net load tests
The commands handler must not be destroyed before the config
object, or we'll be accessing freed memory.

An earlier attempt at using boost::shared_ptr to control object
lifetime turned out to be very invasive, though would be a
better solution in theory.
2017-10-09 16:46:42 +01:00
iDunk5400
44c1d160c8
unit_tests: fix compiling on Windows 2017-10-08 23:59:08 +02:00
moneromooo-monero
fe484f3049
unit_tests: data dir is now overridden with --data-dir
rather than a raw string without option
2017-10-08 21:19:05 +01:00
kenshi84
53ad5a0f42
Subaddresses 2017-10-07 13:06:21 +09:00
Riccardo Spagni
8661f4e868
Merge pull request #2523
540d6fa3 tests: pass data dir as arg (redfish)
2017-10-06 22:51:22 +04:00
moneromooo-monero
240f769d21
tests: add sha256sum unit test 2017-10-05 17:03:37 +01:00
Lee Clagett
8b00687735 Upgrades to epee::net_utils::network_address
- internal nullptr checks
  - prevent modifications to network_address (shallow copy issues)
  - automagically works with any type containing interface functions
  - removed fnv1a hashing
  - ipv4_network_address now flattened with no base class
2017-10-05 11:57:09 -04:00
moneromooo-monero
452d4fae39
tests: fix hashchain unit tests
and relax the not-empty safety check to stay more intuitiuve
2017-10-03 00:51:53 +01:00
redfish
540d6fa3d5 tests: pass data dir as arg
This fixes test failure on builds that happen
to be built in 'build/' instead of 'build/release'.

Use boost filesystem path type.
2017-09-28 01:41:44 -04:00
Wei Tang
551a8ea60e mnemonics: new Lojban word list
Word list authored by: sorpaas
Sources:
  lo gimste jo'u lo ma'oste (http://guskant.github.io/lojbo/gismu-cmavo.html)
  N-grams of Lojban corpus (https://mw.lojban.org/papri/N-grams_of_Lojban_corpus)
2017-09-26 06:42:17 +08:00
moneromooo-monero
36c3465b98
wallet2: do not keep block hashes below last checkpoint
This saves a lot of space and load/save time for wallet caches
2017-09-25 21:16:40 +01:00
moneromooo-monero
5d65a75b69
move checkpoints in a separate library 2017-09-25 21:16:26 +01:00
Riccardo Spagni
e5a2cdbfad
Merge pull request #2457
d2d8a41c Use actual batch size for resize estimates (Howard Chu)
2017-09-25 16:57:07 +02:00
Riccardo Spagni
c2346c6c59
Merge pull request #2424
28b72b6e tx_pool: pre-init tvc.m_verifivation_failed before processing (moneromooo-monero)
50a629b2 core_tests: catch (impossible in practice) tx extra api failure (moneromooo-monero)
fee15ef1 wallet2: catch failure to parse address (moneromooo-monero)
1399e26d net_peerlist: remove dead code (moneromooo-monero)
50e09698 tx_pool: guard against failure getting tx hash (moneromooo-monero)
54cc209a wallet_rpc_server: catch failure to create directory (moneromooo-monero)
3e55099c wallet_rpc_server: init m_vm to NULL in ctor (moneromooo-monero)
7d0dde5e wallet_args: remove redundant default value for --log-file (moneromooo-monero)
ed4a3350 wallet2: catch failure to save keys file (moneromooo-monero)
44434c8a wallet2_api: check whether dynamic_cast returns NULL (moneromooo-monero)
92f2f687 core: check return value from parse_hexstr_to_binbuff (moneromooo-monero)
5475692e wallet2_api: remove an unused, uninitialized, field (moneromooo-monero)
a7ba3de1 libwallet_api_tests: initialize newblock_triggered on reset (moneromooo-monero)
b2763ace wallet2_api: init error code to "no error" in the ctor (moneromooo-monero)
b5faac53 get_blockchain_top now returns void (moneromooo-monero)
2e44d8f2 wallet_rpc_server: guard against exceptions (moneromooo-monero)
4230876b simplewallet: guard against I/O exceptions (moneromooo-monero)
06c1e057 daemon: initialize decode_as_json in RPC request (moneromooo-monero)
11f71af5 http_base: init size_t in http_request_info ctor (moneromooo-monero)
2017-09-25 16:52:27 +02:00