Commit graph

898 commits

Author SHA1 Message Date
Riccardo Spagni
24d8f9237f
Merge pull request #3248
d6a0ae96 blockchain: don't try to use hash check array after it's freed (moneromooo-monero)
2018-02-16 14:24:22 +01:00
Riccardo Spagni
bfddb2283b
Merge pull request #3210
39992134 txpool: Properly bail out when outputs_amount == inputs_amount (Leon Klingele)
2018-02-16 14:22:10 +01:00
Riccardo Spagni
079eea7b70
Merge pull request #3205
bc61ae69 tx_pool: add a max pool size, settable with --max-txpool-size (moneromooo-monero)
3b4e6b35 txpool: increase unmined tx expiry to three days (moneromooo-monero)
2018-02-16 14:21:50 +01:00
Riccardo Spagni
a43be404c7
Merge pull request #3171
402c9eef cryptonote_tx_utils: fixed logic bug in get_destination_view_key_pub (stoffu)
2018-02-16 14:19:10 +01:00
moneromooo-monero
d6a0ae96c6
blockchain: don't try to use hash check array after it's freed
It's freed when we've synced past its end, but we might still
find an old chain somewhere
2018-02-10 11:26:06 +00:00
moneromooo-monero
bc61ae69bf
tx_pool: add a max pool size, settable with --max-txpool-size 2018-02-07 13:42:12 +00:00
Leon Klingele
399921347f
txpool: Properly bail out when outputs_amount == inputs_amount
Previously, when outputs_amount == inputs_amount, the "m_overspend" property
was set, whereas "m_fee_too_low" would have been the correct property to set.

This is unlikely to ever occur and just something I've noticed while reading
through the code.
2018-02-01 00:48:45 +01:00
moneromooo-monero
c70f03cacf
blockchain: move bulletproofs to v8
and set v7 height to 1057027 on testnet (one block earlier)
This is to easily dump current nodes since we're going to change
the v7 rules with this.
2018-01-31 15:52:39 +00:00
stoffu
402c9eef0e
cryptonote_tx_utils: fixed logic bug in get_destination_view_key_pub 2018-01-29 17:05:07 +09:00
Riccardo Spagni
f7dcb730cb
Merge pull request #3144
42f86624 rpc: expose recent median block size in getinfo (moneromooo-monero)
2018-01-27 17:25:40 -08:00
Riccardo Spagni
e93ff8f22d
Merge pull request #3143
ba6d2975 cryptonote_core: add --disable-dns-checkpoints flag (moneromooo-monero)
2018-01-27 17:25:33 -08:00
xmr-eric
18216f19dd Update 2018 copyright 2018-01-26 10:03:20 -05:00
Riccardo Spagni
9872620781
Merge pull request #3014
deeffaeb blockchain: remove minor floating point usage (moneromooo-monero)
2018-01-25 16:38:32 -08:00
moneromooo-monero
42f86624a3
rpc: expose recent median block size in getinfo 2018-01-17 11:12:26 +00:00
moneromooo-monero
ba6d2975bc
cryptonote_core: add --disable-dns-checkpoints flag 2018-01-17 10:14:48 +00:00
moneromooo-monero
deeffaeb5c
blockchain: remove minor floating point usage 2018-01-10 11:05:30 +00: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
Riccardo Spagni
b38f6dcf0b
Merge pull request #2929
ae55bacd resumption support for updates using range requests (moneromooo-monero)
fe0fae50 epee: add a get_file_size function (moneromooo-monero)
2017-12-25 21:20:22 +02:00
moneromooo-monero
ae8602303a
Fix exceptions not finding txpool txes when relaying 2017-12-20 13:02:53 +00:00
moneromooo-monero
24f584d90d
cryptonote_core: remove unused functions with off by one bugs 2017-12-18 15:16:06 +00:00
moneromooo-monero
b1634aa3e8
blockchain: don't leave dangling pointers in this 2017-12-18 15:16:03 +00:00
moneromooo-monero
8e60b81c48
cryptonote_core: fix db leak on error 2017-12-18 15:16:00 +00:00
moneromooo-monero
b49ddc766d
check accessing an element past the end of a container 2017-12-18 15:15:49 +00:00
moneromooo-monero
d753d716a6
fix a few leaks by throwing objects, not newed pointers to objects 2017-12-18 15:15:13 +00:00
Riccardo Spagni
1cc7451130
Merge pull request #2134
ceabc4f9 change the N-1/N multisig second message signer for auth (moneromooo-monero)
55c2845d core_tests: multisig test now tests multiple inputs (moneromooo-monero)
98db7ee4 wallet: factor multisig info parsing (moneromooo-monero)
31a97e76 wallet: use raw encrypted data in multisig import/export RPC (moneromooo-monero)
2fa707d1 wallet: add multisig sign/submit RPC (moneromooo-monero)
e36f5b60 Match surae's recommendation to derive multisig keys (moneromooo-monero)
a36c261d wallet2: fix slow multisig unit tests with subaddress patch (moneromooo-monero)
fa569712 make multisig work with subaddresses (moneromooo-monero)
dffa0dce simplewallet: add export_raw_multisig command (moneromooo-monero)
7f4c220b simplewallet: add multisig to wallet type in wallet_info output (moneromooo-monero)
26529038 wallet: guard against partly initialized multisig wallet (moneromooo-monero)
66e34e85 add multisig core test and factor multisig building blocks (moneromooo-monero)
f4eda44c N-1/N multisig (moneromooo-monero)
cd64c799 multisig address generation RPC (moneromooo-monero)
fff871a4 gen_multisig: generates multisig wallets if participants trust each other (moneromooo-monero)
95a21a79 wallet2: allow empty wallet filename to avoid saving data (moneromooo-monero)
b84b3565 tests: add multisig unit tests (moneromooo-monero)
4c313324 Add N/N multisig tx generation and signing (moneromooo-monero)
6d219a92 wallet: add multisig key generation (moneromooo-monero)
2017-12-17 21:05:16 +02:00
moneromooo-monero
d9b137f161
cryptonote_core: fix blockchain init call after prototype change 2017-12-17 18:47:46 +00:00
moneromooo-monero
fa5697127f
make multisig work with subaddresses
Thanks to kenshi84 for help getting this work
2017-12-17 16:12:27 +00:00
moneromooo-monero
66e34e85b1
add multisig core test and factor multisig building blocks 2017-12-17 16:12:15 +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
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
8da24c2a57
Merge pull request #2878
abebe392 rpc: add offline state in info rpc (moneromooo-monero)
7696e849 core: make --offline also disable DNS lookups (moneromooo-monero)
2017-12-16 23:27:00 +02:00
Riccardo Spagni
7998ffc26b
Merge pull request #2871
2b0a32f8 Small cleanup of daemon synchronization output (xmr-eric)
2017-12-16 23:25:02 +02:00
moneromooo-monero
ae55bacd8c
resumption support for updates using range requests 2017-12-15 10:46:23 +00:00
moneromooo-monero
ead48f7d92
core: fix input ordering from v7 2017-12-09 11:24:38 +00:00
moneromooo-monero
c83d0b3ee2
add bulletproofs from v7 on testnet 2017-12-08 13:50:45 +00:00
moneromooo-monero
d58835b2f6
integrate bulletproofs into monero 2017-12-08 13:48:15 +00:00
moneromooo-monero
7696e84952
core: make --offline also disable DNS lookups 2017-11-30 15:35:52 +00:00
xmr-eric
2b0a32f8af Small cleanup of daemon synchronization output
Add period to second sentence
2017-11-27 16:37:20 -05:00
Cifrado
287dde63d8 Added command descriptions 2017-11-26 10:37:37 +01:00
Riccardo Spagni
ed2fc4a1ff
Merge pull request #2794
43f27c7d core: warn when free disk space is low (moneromooo-monero)
2017-11-25 19:48:33 +02:00
moneromooo-monero
01dc829784
wallet: transfer RPC can now return tx metadata (pending_tx) 2017-11-24 14:03:52 +00:00
Riccardo Spagni
10a237783a
Merge pull request #2692
0f2c2d4c rpc: remove obsolete busy core checks (moneromooo-monero)
2017-11-14 21:32:33 +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
0f2c2d4c34
rpc: remove obsolete busy core checks 2017-11-14 17:15:19 +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
48ff10f77f
Merge pull request #2681
ec48e8d8 core: do not forbid txes without destination (moneromooo-monero)
523084bc core: don't add empty additional pub keys field to extra (moneromooo-monero)
2017-11-14 15:02:55 +02:00
Riccardo Spagni
256a1d9ead
Merge pull request #2675
00cc1fdd subaddress: remove unneeded scalarmultBase (kenshi84)
2017-11-14 15:02:14 +02:00