Commit Graph

909 Commits

Author SHA1 Message Date
Jean Pierre Dudey
9f9e095a8c
Use genesis_tx parameter in generate_genesis_block. #3261
* src/cryptnote_config.h: The constant `config::testnet::GENESIS_TX` was
changed to be the same as `config::GENESIS_TX` (the mainnet's transaction)
because the mainnet's transaction was being used for both networks.

* src/cryptonote_core/cryptonote_tx_utils.cpp: The `generate_genesis_block` function
was ignoring the  `genesis_tx` parameter, and instead it was using the `config::GENESIS_TX`
constant. That's why the testnet genesis transaction was changed. Also five lines of unused
code were removed.

Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-03-05 11:19:01 +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
moneromooo-monero
4a78a99f96
cryptonote_core: change wording of fork warning message
An udpate may or may not be available now, but should be soon if not.
This will prevent too many people freaking out.
2018-02-18 23:44:59 +00:00
Riccardo Spagni
6198c816b1
Merge pull request #3170
b3b2d4d2 options: add testnet option dependencies (whythat)
c5f55bb4 common: implement dynamic option dependencies mechanism (whythat)
05a12ccc options: remove testnet-* options (whythat)
c33cb60e common: implement dependent option descriptor (whythat)
2018-02-17 11:51:57 +01:00
Riccardo Spagni
a2cbedd29f
Merge pull request #3191
3607d467 core: add --no-fluffy-blocks, and enable fluffy blocks by default (moneromooo-monero)
2018-02-17 11:48:31 +01:00
whythat
b3b2d4d20c options: add testnet option dependencies 2018-02-16 22:32:01 +02:00
whythat
05a12ccc2d options: remove testnet-* options 2018-02-16 22:32:01 +02:00
Leon Klingele
7c1a607c40
txpool: Don't bail out when blob_size == tx_size_limit
Previously, when blob_size == tx_size_limit, the "m_too_big" property was set
and the transaction was rejected. This should not have been the case.
2018-02-16 16:27:08 +01:00
moneromooo-monero
3607d467f3
core: add --no-fluffy-blocks, and enable fluffy blocks by default 2018-02-16 13:46:46 +00:00
Riccardo Spagni
f4a6bc79d9
Merge pull request #3226
e4646379 keccak: fix mdlen bounds sanity checking (moneromooo-monero)
2e3e90ac pass large parameters by const ref, not value (moneromooo-monero)
61defd89 blockchain: sanity check number of precomputed hash of hash blocks (moneromooo-monero)
9af6b2d1 ringct: fix infinite loop in unused h2b function (moneromooo-monero)
8cea8d0c simplewallet: double check a new multisig wallet is multisig (moneromooo-monero)
9b98a6ac threadpool: catch exceptions in dtor, to avoid terminate (moneromooo-monero)
24803ed9 blockchain_export: fix buffer overflow in exporter (moneromooo-monero)
f3f7da62 perf_timer: rewrite to make it clear there is no division by zero (moneromooo-monero)
c6ea3df0 performance_tests: remove add_arg call stray extra param (moneromooo-monero)
fa6b4566 fuzz_tests: fix an uninitialized var in setup (moneromooo-monero)
03887f11 keccak: fix sanity check bounds test (moneromooo-monero)
ad11db91 blockchain_db: initialize m_open in base class ctor (moneromooo-monero)
bece67f9 miner: restore std::cout precision after modification (moneromooo-monero)
1aabd14c db_lmdb: check hard fork info drop succeeded (moneromooo-monero)
2018-02-16 14:26:58 +01:00
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
moneromooo-monero
61defd89e3
blockchain: sanity check number of precomputed hash of hash blocks
Coverity 142951
2018-02-02 17:10:13 +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