aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2019-02-15blockchain: fix m_long_term_block_weight_height initializationmoneromooo-monero1-6/+13
Also check return of that function, it can now return error
2019-02-15blockchain: forbid older BP rct versions from v11moneromooo-monero1-1/+18
2019-02-15Fix v3/v4 db conversionmoneromooo-monero1-0/+2
2019-02-14Build fixes for some platformsmoneromooo-monero3-6/+6
2019-02-14blockchain: add v10 fork heightsmoneromooo-monero1-0/+5
2019-02-14New scheme key destination contrfolcslashm2-41/+10
Implies protocol version management.
2019-02-14cryptonote: Fix enum check in expand_transaction_2Tom Smeding1-1/+1
This was noticed because GCC warned about using an enum value in a boolean context.
2019-02-12add a bulletproof version, new bulletproof type, and rct configmoneromooo-monero4-12/+26
This makes it easier to modify the bulletproof format
2019-02-12core: include a dummy encrypted payment id when no payment is usedmoneromooo-monero1-6/+40
For better transaction uniformity, even though this wastes space.
2019-02-12core, wallet: remember original text version of destination addressmoneromooo-monero1-3/+15
2019-02-12blockchain: fix wrong hf version when popping multiple blocksmoneromooo-monero1-6/+4
Since we keep track of the hf version in the db, we pick it up from there instead of doing the full reorg call, which is quite expensive
2019-02-12blockchain: fix block rate check for empty blockchainsmoneromooo-monero1-1/+3
2019-02-12core: fix unmixable special case allowing ring size below 11moneromooo-monero1-1/+1
2019-02-12blockchain: include number of discarded blocks in --reorg-notifymoneromooo-monero2-3/+5
2019-02-12core: add a few more block rate window sizesmoneromooo-monero1-1/+1
The 10 minute one will never trigger for 0 blocks, as it's still fairly likely to happen even without the actual hash rate changing much, so we add a 20 minute window, where it will (for 0 blocks) and a one hour window.
2019-02-12core: add --block-rate-notifymoneromooo-monero2-0/+33
This runs a command whenever the block rate deviates too much from the expectation
2019-02-12blockchain: add --reorg-notifymoneromooo-monero3-1/+32
This will trigger if a reorg is seen. This may be used to do things like stop automated withdrawals on large reorgs. %s is replaced by the height at the split point %h is replaced by the height of the new chain %n is replaced by the number of new blocks after the reorg
2019-02-12cryptonote_core: warn when the block rate deviates from expectationsmoneromooo-monero4-7/+64
The warning threshold is set to allow a false positive every ten days on average.
2019-02-12notify: handle arbitrary tagsmoneromooo-monero1-1/+1
2019-02-12ArticMine's new block weight algorithmmoneromooo-monero4-14/+158
This curbs runaway growth while still allowing substantial spikes in block weight Original specification from ArticMine: here is the scaling proposal Define: LongTermBlockWeight Before fork: LongTermBlockWeight = BlockWeight At or after fork: LongTermBlockWeight = min(BlockWeight, 1.4*LongTermEffectiveMedianBlockWeight) Note: To avoid possible consensus issues over rounding the LongTermBlockWeight for a given block should be calculated to the nearest byte, and stored as a integer in the block itself. The stored LongTermBlockWeight is then used for future calculations of the LongTermEffectiveMedianBlockWeight and not recalculated each time. Define: LongTermEffectiveMedianBlockWeight LongTermEffectiveMedianBlockWeight = max(300000, MedianOverPrevious100000Blocks(LongTermBlockWeight)) Change Definition of EffectiveMedianBlockWeight From (current definition) EffectiveMedianBlockWeight = max(300000, MedianOverPrevious100Blocks(BlockWeight)) To (proposed definition) EffectiveMedianBlockWeight = min(max(300000, MedianOverPrevious100Blocks(BlockWeight)), 50*LongTermEffectiveMedianBlockWeight) Notes: 1) There are no other changes to the existing penalty formula, median calculation, fees etc. 2) There is the requirement to store the LongTermBlockWeight of a block unencrypted in the block itself. This is to avoid possible consensus issues over rounding and also to prevent the calculations from becoming unwieldy as we move away from the fork. 3) When the EffectiveMedianBlockWeight cap is reached it is still possible to mine blocks up to 2x the EffectiveMedianBlockWeight by paying the corresponding penalty.
2018-10-19blockchain: move two new verification errors to the verify categorymoneromooo-monero1-2/+2
Lest we get people get scared again
2018-10-18tx_pool: revert #4592 and move bin2hex conversion to on_get_transaction_poolstoffu1-1/+1
2018-10-17core: don't verify range proofs multiple timesmoneromooo-monero1-1/+6
2018-10-15tx_pool: store hex string instead of raw binary to tx_blob of ↵stoffu1-1/+1
get_transaction_pool RPC Inspired by https://github.com/masari-project/masari/issues/93
2018-10-08Revert "Merge pull request #4472"Riccardo Spagni5-34/+27
This reverts commit b26ab0b5803af4ffe23de11a45e43877301a4902.
2018-10-06Merge pull request #4472Riccardo Spagni5-27/+34
02d3ef7b blocks: use auto-generated .c files instead of 'LD -r -b binary' (xiphon)
2018-10-02Merge pull request #4476Riccardo Spagni1-1/+1
fa9e54b6 build: fix gcc false positive 'stringop-overflow' warning (xiphon)
2018-10-02Merge pull request #4467Riccardo Spagni1-2/+2
fa942ef6 daemon: silence daemon update warnings on testnet (iDunk5400)
2018-09-29add --block-notify to monerod and --tx-notify to monero-wallet-{cli,rpc}moneromooo-monero3-0/+33
Those take a command line of the form "A [B]", with A being the name (and optional path, if not in the caller's CWD, but fully qualified path is recommended, avoids possible security issues) to a program, and optional arguments. Any occurence of the two character string "%s" will be replaced by the hash of the block or transaction which triggered the notification. Tokenization is barebones. If you want things like pipes, calls to paths with spaces, etc, then use a script (though exec time will suffer). block-notify is called when a new block is added onto the chain. tx-notify is called when a new transaction happens with the wallet as source and/or destination. It is the notification program's responsibility to determine what to do in those cases. Note that this is asynchronous, so it is very possible that: - the notification programs will be run out of order - several events happen before the notification for the first one A Windows port would be nice if someone wants to make one.
2018-09-25tx_pool: fix tx removal at startup keeping referencesmoneromooo-monero1-0/+1
2018-09-24blockchain: add stagenet v8 and v9, two weeks before mainnetmoneromooo-monero1-0/+2
2018-09-23update checkpoints.datRiccardo Spagni1-1/+1
2018-09-14remove obsolete daemon selection of fake outs and old tx constructionmoneromooo-monero4-328/+0
2018-09-14rpc: add a "is an update available" flag in get_infomoneromooo-monero2-1/+18
Make it easier for a user to be told when to update
2018-09-13tx_pool: make the max tx size a consensus rule from v8moneromooo-monero1-1/+1
2018-09-12blockchain: simplify output distribution codemoneromooo-monero1-7/+2
2018-09-11blockchain: add a testnet v9 a day after v8moneromooo-monero1-0/+1
So that bulletproofs become mandatory
2018-09-11v8: per byte fee, pad bulletproofs, fixed 11 ring sizemoneromooo-monero8-327/+356
2018-09-11require canonical multi output bulletproof layoutmoneromooo-monero1-0/+29
2018-09-11Bulletproof aggregated verification and testsmoneromooo-monero4-51/+149
Also constrains bulletproofs to simple rct, for simplicity
2018-09-11bulletproofs: add aggregated verificationmoneromooo-monero2-2/+2
Ported from sarang's java code
2018-09-11bulletproofs: add multi output bulletproofs to rctmoneromooo-monero3-8/+24
2018-09-02blockchain: add mainnet v8 height targetting 18 octobermoneromooo-monero1-0/+6
and v9 a day later
2018-08-19tx_pool: fix infinite loop when failing to find a meta recordmoneromooo-monero1-7/+1
2018-08-16Do memwipe for critical secret keys copied to rct::keystoffu1-0/+3
2018-08-16core: cache block template where possiblemoneromooo-monero4-2/+94
This avoids constant rechecking of the same things each time a miner asks for the block template. The tx pool maintains a cookie to allow users to detect when the pool state changed, which means the block template needs rebuilding.
2018-08-12core: sync database based on bytes added, not blocks addedmoneromooo-monero3-14/+35
Blocks have a very wide range, whereas actual size is the relevant quantity to consider when syncing
2018-08-09blockchain: use uint64_t for height, not size_tmoneromooo-monero1-1/+1
2018-07-21blockchain: some batch tx scanning speedupmoneromooo-monero1-15/+19
2018-07-13db: store cumulative rct output distribution in the db for speedmoneromooo-monero1-5/+34
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-07blockchain: cache next block difficulty after adding a blockmoneromooo-monero1-0/+1
It's not 100% certain it'll be needed, but it avoids getinfo needing the blockchain lock and potentially blocking
2018-06-29blockchain: fix getting invalid block data on failuremoneromooo-monero1-1/+2
2018-06-29add --regtest and --fixed-difficulty for regression testingvictorsintnicolaas4-4/+87
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-28blockchain: set the m_verifivation_failed flag in a couple more placesmoneromooo-monero1-0/+2
when a block being added to the main chain is invalid. This ensures the peer is banned after a number of these.
2018-06-28blockchain: fix build after waiter::wait prototype changemoneromooo-monero1-1/+1
2018-06-26threadpool: allow leaf functions to run concurrentlymoneromooo-monero2-8/+8
Decrease the number of worker threads by one to account for the fact the calling thread acts as a worker thread now
2018-06-26blockchain: simplify/speedup handle_get_objectsmoneromooo-monero1-13/+8
2018-06-26rpc: rework to avoid repeated calculations in get_blocks.binmoneromooo-monero4-10/+19
2018-06-26replace std::list with std::vector on some hot pathsmoneromooo-monero6-76/+108
also use reserve where appropriate
2018-06-26alt_chain_info can now give more info about a particular alt chainmoneromooo-monero2-6/+7
2018-06-24tx_pool: cache check_tx_inputs resultsmoneromooo-monero2-6/+35
This is called a lot when creating a block template, and does not change until the blockchain changes. This also avoids tx parsing when cached.
2018-06-11Remove old logic saved in comments.Jean Pierre Dudey1-2/+2
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-06-11cryptonote_config: add get_config to refactor x = testnet ? ↵stoffu1-12/+1
config::testnet::X : stagenet ? config::stagenet::X : config::X
2018-06-09blockchain: avoid duplicate db query for heightmoneromooo-monero1-1/+1
2018-06-06blockchain: fix deadlock with the difficulty cachemoneromooo-monero1-8/+12
2018-06-05tx_pool: initialize bitflags padding since it gets written to storagemoneromooo-monero1-0/+2
Avoids valgrind reporting uninitialized data usage
2018-06-04blockchain: pop forked blocks only when DB is not read-onlystoffu1-1/+1
2018-06-02blockchain: demote a hash-of-hashes validation warning to debugmoneromooo-monero1-1/+1
This data comes from untrusted peers, and validation failures are therefore normal.
2018-06-02update checkpoints.dat for point releaseRiccardo Spagni1-1/+1
2018-06-02tx_pool: hold off parsing a tx blob till we actually need itmoneromooo-monero2-12/+35
2018-06-01blockchain: return error when requesting non existent outputmoneromooo-monero1-6/+13
avoids RPC thread dying, causing the wallet to timeout
2018-05-28core: fix automatic safe db sync mode switchingmoneromooo-monero1-5/+6
2018-05-28tx_pool: remove old comment from fill_block_template()stoffu1-4/+0
2018-05-23db_lmdb: save pruned and prunable tx data separatelymoneromooo-monero4-12/+18
This bumps DB version to 2, migration code will run for v1 DBs
2018-05-23update checkpointsRiccardo Spagni1-1/+1
2018-05-21speed up get_output_distribution (and precalc common case)moneromooo-monero4-22/+8
2018-05-20core: remove threadpool dependency from headermoneromooo-monero2-6/+3
2018-05-20Fix output shuffling for multisigstoffu2-9/+11
2018-05-18core: lock incoming tx lock when checking the txpool and chainmoneromooo-monero1-0/+1
This gets rid of an innocuous race trying to add the same tx twice to the txpool
2018-05-13Use median timestamp if current time renders a block invalid.Thaer Khawaja2-6/+15
2018-05-09blockchain: avoid exception if asked for a block we do not havemoneromooo-monero1-8/+11
This can happen if a peer tries to obtain the next span from other peers if that span is needed for not downloaded yet. Also if the peer maliciously requests a non existent block hash.
2018-05-09blockchain: invalidate misc caches when popping blocksmoneromooo-monero1-0/+6
Might be a bit heavy handed, but conservative.
2018-05-07cryptonote: make sure outPk setup always happensmoneromooo-monero1-33/+0
2018-05-06blockchain: pop top if block version disagrees with the ideal fork versionstoffu1-0/+47
2018-04-29Ensure m_timestamps has the correct number for computing difficulty.Thaer Khawaja1-1/+1
2018-04-23blockchain: log in DEBUG when a block is found, and wheremoneromooo-monero1-3/+3
Eases up debugging
2018-04-23speedup get_output_histogram for all amounts when min_count > 0moneromooo-monero2-3/+4
This skips the vast majority of "dust" output amounts with just one instance on the chain. Clocks in at 0.15% of the original time on testnet.
2018-04-22Only log an error if fork version is higher AND is not known.Thaer Khawaja2-0/+12
2018-04-11tx_pool: fix loading with colliding key imagesmoneromooo-monero1-17/+26
A key image may be present more than once if all but one of the txes spending that key image are coming from blocks. When loading a txpool from storage, we must load the one that's not from a block first to avoid rejection
2018-03-31cryptonote_tx_util: make destinations properly shuffledstoffu1-2/+3
2018-03-30blockchain: add scope guard to waiter for threaded txv1 verificationstoffu1-0/+1
2018-03-27fix lambda compile error on openbsdmoneromooo-monero1-1/+1
2018-03-24update block hashes for checkpoints.datRiccardo Spagni1-1/+1
2018-03-21core: add get_earliest_ideal_height_for_version()stoffu3-0/+19
2018-03-19blockchain: cache difficulty for next blockmoneromooo-monero2-3/+22
Takes about 10 ms, which takes pretty much all of the get_info RPC, which is called pretty often from wallets. Also add a new lock so we don't need to lock the blockchain lock, which will avoid blocking for a long time when calling the getinfo RPC while syncing. Users of get_difficulty_for_next_block who need the lock will have locked it already.
2018-03-18core: fix use of uninitialised datamoneromooo-monero1-1/+2
2018-03-18Move v7 fork to 1546000 to give more update timemoneromooo-monero1-2/+2
2018-03-16blockchain: forbid bulletproof types before v8moneromooo-monero1-1/+2
They were already forbidden implicitely, but let's make that explicit for robustness
2018-03-16add RPC to get a histogram of outputs of a given amountmoneromooo-monero4-2/+78
2018-03-16blockchain: fix log message about per-kB feestoffu1-1/+1
2018-03-15Fix typos in various filesDimitris Apostolou3-6/+6
2018-03-14Remove the `Blockchain::get_all_known_block_ids` function.Jean Pierre Dudey2-28/+0
This function isn't used in the codebase. Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-03-14keypair::generate: always require hw::device to avoid possible mistakestoffu1-1/+1
2018-03-14device: untangle cyclic depenencystoffu1-10/+9
When #3303 was merged, a cyclic dependency chain was generated: libdevice <- libcncrypto <- libringct <- libdevice This was because libdevice needs access to a set of basic crypto operations implemented in libringct such as scalarmultBase(), while libringct also needs access to abstracted crypto operations implemented in libdevice such as ecdhEncode(). To untangle this cyclic dependency chain, this patch splits libringct into libringct_basic and libringct, where the basic crypto ops previously in libringct are moved into libringct_basic. The cyclic dependency is now resolved thanks to this separation: libcncrypto <- libringct_basic <- libdevice <- libcryptonote_basic <- libringct This eliminates the need for crypto_device.cpp and rctOps_device.cpp. Also, many abstracted interfaces of hw::device such as encrypt_payment_id() and get_subaddress_secret_key() were previously implemented in libcryptonote_basic (cryptonote_format_utils.cpp) and were then called from hw::core::device_default, which is odd because libdevice is supposed to be independent of libcryptonote_basic. Therefore, those functions were moved to device_default.cpp.
2018-03-12Ledger HW Bug fixesCédric1-1/+1
Fix the way the REAL mode is handle: Let create_transactions_2 and create_transactions_from construct the vector of transactions. Then iterate on it and resign. We just need to add 'outs' list in the TX struct for that. Fix default secret keys value when DEBUG_HWDEVICE mode is off The magic value (00...00 for view key and FF..FF for spend key) was not correctly set when DEBUG_HWDEVICE was off. Both was set to 00...00. Add sub-address info in ABP map in order to correctly display destination sub-address on device Fix DEBUG_HWDEVICE mode: - Fix compilation errors. - Fix control device init in ledger device. - Add more log. Fix sub addr control Fix debug Info
2018-03-09Stagenet: successive forks up to v7stoffu1-0/+8
2018-03-07core: add v7 for 1539500 on mainnetmoneromooo-monero1-0/+3
2018-03-07Bump min ring size from 5 to 7 from v7moneromooo-monero1-1/+1
2018-03-05Correct spelling mistakes.Edward Betts1-2/+2
2018-03-05Stagenetstoffu4-46/+79
2018-03-05Use `genesis_tx` parameter in `generate_genesis_block`. #3261Jean Pierre Dudey1-10/+1
* 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-04Code modifications to integrate Ledger HW device into monero-wallet-cli.cslashm2-16/+24
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-02core: fix sending to the source address with a short payment idmoneromooo-monero1-0/+2
It would fail to send, thinking it needs a destination address, since the destination matches the change address in this case.
2018-02-23blockchain: fix random sync failuresmoneromooo-monero1-1/+4
When a block is added as part of a chunk (when syncing historical blocks), a block may end up already in the blockchain if it was added to the queue before being added to the chain (though it's not clear how that could happen, but it's an implementation detail) and thus may not be added to the chain when add_block is called. This would cause m_blocks_txs_check to not be cleared, causing it to get out of sync at next call, and thus wrongfully reject the next block.
2018-02-18cryptonote_core: change wording of fork warning messagemoneromooo-monero1-1/+1
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-16options: add testnet option dependencieswhythat1-2/+6
2018-02-16options: remove testnet-* optionswhythat2-14/+10
2018-02-16txpool: Don't bail out when blob_size == tx_size_limitLeon Klingele1-2/+2
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-16core: add --no-fluffy-blocks, and enable fluffy blocks by defaultmoneromooo-monero1-2/+10
2018-02-14Use `genesis_tx` parameter in `generate_genesis_block`.Jean Pierre Dudey1-10/+1
* 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-02-10blockchain: don't try to use hash check array after it's freedmoneromooo-monero1-0/+4
It's freed when we've synced past its end, but we might still find an old chain somewhere
2018-02-07tx_pool: add a max pool size, settable with --max-txpool-sizemoneromooo-monero3-5/+113
2018-02-02blockchain: sanity check number of precomputed hash of hash blocksmoneromooo-monero1-1/+6
Coverity 142951
2018-02-01txpool: Properly bail out when outputs_amount == inputs_amountLeon Klingele1-1/+8
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-01-31blockchain: move bulletproofs to v8moneromooo-monero1-4/+5
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-29cryptonote_tx_utils: fixed logic bug in get_destination_view_key_pubstoffu2-10/+14
2018-01-26Update 2018 copyrightxmr-eric10-10/+10
2018-01-17rpc: expose recent median block size in getinfomoneromooo-monero2-1/+16
2018-01-17cryptonote_core: add --disable-dns-checkpoints flagmoneromooo-monero1-0/+6
2018-01-10blockchain: remove minor floating point usagemoneromooo-monero1-1/+1
2017-12-20Fix exceptions not finding txpool txes when relayingmoneromooo-monero3-11/+34
2017-12-18cryptonote_core: remove unused functions with off by one bugsmoneromooo-monero4-105/+0
2017-12-18blockchain: don't leave dangling pointers in thismoneromooo-monero1-0/+2
2017-12-18cryptonote_core: fix db leak on errormoneromooo-monero2-2/+3
2017-12-18check accessing an element past the end of a containermoneromooo-monero2-4/+12
2017-12-18fix a few leaks by throwing objects, not newed pointers to objectsmoneromooo-monero1-1/+1
2017-12-17cryptonote_core: fix blockchain init call after prototype changemoneromooo-monero1-1/+1
2017-12-17make multisig work with subaddressesmoneromooo-monero2-14/+9
Thanks to kenshi84 for help getting this work
2017-12-17add multisig core test and factor multisig building blocksmoneromooo-monero2-15/+2
2017-12-17Add N/N multisig tx generation and signingmoneromooo-monero2-44/+107
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-16cryptonote_core does not depend on p2p anymoremoneromooo-monero2-13/+6
As a followon side effect, this makes a lot of inline code included only in particular cpp files (and instanciated when necessary.
2017-12-16move includes around to lessen overall loadmoneromooo-monero3-1/+4
2017-12-15resumption support for updates using range requestsmoneromooo-monero1-5/+35
2017-12-09core: fix input ordering from v7moneromooo-monero1-1/+1
2017-12-08add bulletproofs from v7 on testnetmoneromooo-monero2-9/+44
2017-12-08integrate bulletproofs into moneromoneromooo-monero2-4/+4
2017-11-30core: make --offline also disable DNS lookupsmoneromooo-monero4-8/+35
2017-11-27Small cleanup of daemon synchronization outputxmr-eric1-2/+2
Add period to second sentence
2017-11-26Added command descriptionsCifrado1-0/+1
2017-11-24wallet: transfer RPC can now return tx metadata (pending_tx)moneromooo-monero1-0/+14
2017-11-14rpc: remove obsolete busy core checksmoneromooo-monero1-10/+0
2017-11-14move cryptonote command line options to cryptonote_coremoneromooo-monero2-24/+96
Those have no reason to be in a generic module
2017-11-14remove "using namespace std" from headersmoneromooo-monero4-2/+8
It's nasty, and actually breaks on Solaris, where if.h fails to build due to: struct map *if_memmap;
2017-11-14core: warn when free disk space is lowmoneromooo-monero2-0/+34
2017-11-08Protect node privacy by proper filtering in restricted-mode RPC answersbinaryFate6-46/+80
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-06track double spending in the txpoolmoneromooo-monero3-8/+62
Transactions in the txpool are marked when another transaction is seen double spending one or more of its inputs. This is then exposed wherever appropriate. Note that being marked with this "double spend seen" flag does NOT mean this transaction IS a double spend and will never be mined: it just means that the network has seen at least another transaction spending at least one of the same inputs, so care should be taken to wait for a few confirmations before acting upon that transaction (ie, mostly of use for merchants wanting to accept unconfirmed transactions).
2017-10-30blockchain: do not lock the blockchain lock for simple DB gettersmoneromooo-monero1-7/+28
It is safe in those cases, though might return slightly out of date information if another thread is busy modifying the blockchain, but it avoids potentially lengthy delays just to get things like the current blockchain height.
2017-10-19core: do not forbid txes without destinationmoneromooo-monero1-6/+0
This was spuriously forbidden in the recent subaddress patch, which isn't inherently incompatible with these.
2017-10-19core: don't add empty additional pub keys field to extramoneromooo-monero1-1/+1
Saves a couple bytes per tx
2017-10-18subaddress: remove unneeded scalarmultBasekenshi841-6/+11
2017-10-17core_tests: fix for subaddress patchkenshi842-7/+7
2017-10-15remove reference to cryptonote::null_hashJaquee1-3/+3
2017-10-12blockchain: avoid exceptions in output verificationmoneromooo-monero1-2/+12
This can happen if we get a bad tx, so let's not spam the log.
2017-10-11core: guard against a mined block not finding all txes in the poolmoneromooo-monero1-1/+9
This can happen for several reasons, but mainly if another block was received, which took that tx off the pool.
2017-10-07Subaddresseskenshi842-8/+115
2017-10-03construct_tx_and_get_tx_key: return sorted sources for print_ring_memebrs to ↵stoffu2-4/+4
work properly
2017-09-29core: fix failure to sync when a tx is already in the poolmoneromooo-monero3-9/+28
2017-09-27core: remove out sorting from v7 rulesmoneromooo-monero2-37/+4
and restore random shuffle of outputs This turned out to have a flaw (sort order depends on output index), and this doesn't really bring much anyway
2017-09-27core: fix logging the one time public key on errormoneromooo-monero1-1/+1
2017-09-27blockchain: fix off by one getting blocksmoneromooo-monero1-2/+2
2017-09-26core: undo output sortingmoneromooo-monero1-0/+2
It looks like it may be buggy
2017-09-25core: fix creation of v1 txesmoneromooo-monero1-1/+2
2017-09-25checkpoints: add a token checkpoint on testnet (the genesis block)moneromooo-monero1-1/+1
2017-09-25fix typo in basic and core CMakeLists.txtmoneromooo-monero1-1/+1
2017-09-25move checkpoints in a separate librarymoneromooo-monero3-3/+2
2017-09-25tx_pool: pre-init tvc.m_verifivation_failed before processingmoneromooo-monero1-3/+3
CID 175316
2017-09-25tx_pool: guard against failure getting tx hashmoneromooo-monero1-1/+2
Should be impossible in practice, but easy change CID 175282
2017-09-25core: check return value from parse_hexstr_to_binbuffmoneromooo-monero1-2/+3
2017-09-25get_blockchain_top now returns voidmoneromooo-monero2-5/+2
It was always returning true, and could not be foreseen to usefully return errors in the future. This silences CID 162652 as well as saves some checking code in a few places.
2017-09-22Source updates are in a source subdirectorymoneromooo-monero1-1/+2
rather than in the same directory as the prebuilt versions
2017-09-21build: auto update version info without manually deleting version.hstoffu1-0/+1
2017-09-20tx_pool: drop invalid txes from the pool on startupmoneromooo-monero1-3/+23
instead of just failing This is a workaround for bad tx blobs being inserted in the pool for unknown reasons
2017-09-20blockchain: fix crash checking pre-validated txidsmoneromooo-monero1-2/+2
2017-09-18precomputed block hashes are now in blocks of N (currently 256)moneromooo-monero4-9/+133
This shaves a lot of space off binaries
2017-09-18blockchain: reject unsorted ins and outs from v7moneromooo-monero1-0/+39
This ensures no information is leaked by the ordering
2017-09-17Use actual batch size for resize estimatesHoward Chu1-1/+10
And optimize import startup: Remember start_height position during initial count_blocks pass to avoid having to reread entire file again to arrive at start_height
2017-09-17protocol: remove hop count on block propagationmoneromooo-monero1-1/+0
It is unused, as it was apparently a future optimization, and it leaks some information (though since pools publish thei blocks they find, that amount seems small).
2017-09-16tx_pool: set the "invalid input" bit when check_tx_inputs failsmoneromooo-monero1-0/+1
2017-09-14Use a threadpoolHoward Chu3-97/+56
Instead of constantly creating and destroying threads
2017-09-14Remove 1.25x multiplier from tx_poolNano Akron1-1/+1
2017-09-13core: sort ins and outs key key image and public key, respectivelymoneromooo-monero2-6/+32
This avoids leaking some small amount of information
2017-09-12core: guard against exceptions in tx verification worker threadsmoneromooo-monero1-2/+18
2017-09-06update checkpoint hashesRiccardo Spagni1-1/+1
2017-09-05json serialization for rpc-relevant monero typesThomas Winget5-1/+112
Structured {de-,}serialization methods for (many new) types which are used for requests or responses in the RPC. New types include RPC requests and responses, and structs which compose types within those. # Conflicts: # src/cryptonote_core/blockchain.cpp
2017-09-05Refactor some things into more composable (smaller) functionsThomas Winget2-73/+179
This commit refactors some of the rpc-related functions in the Blockchain class to be more composable. This change was made in order to make implementing the new zmq rpc easier without trampling on the old rpc. New functions: Blockchain::get_num_mature_outputs Blockchain::get_random_outputs Blockchain::get_output_key Blockchain::get_output_key_mask_unlocked Blockchain::find_blockchain_supplement (overload) functions which previously had this functionality inline now call these functions as necessary.
2017-09-04tx_pool: catch exceptions in LockedTXN dtormoneromooo-monero1-1/+1
This might prevent some calls to terminate when the LockedTXN dtor is called as part of stack unwinding caused by another exception in the first place.
2017-09-03Add a --fluffy-blocks option to relay blocks as fluffy blocksmoneromooo-monero2-0/+11
Defaults to off, but fluffy blocks are forced enabled on testnet
2017-08-31DRY refactoringThomas Winget2-1/+13
2017-08-29tx_pool: wrap tx meta updates in a LockedTXNmoneromooo-monero1-0/+3
2017-08-29Fix blockchain_import wedge on exception in cleanup_handle_incoming_blocksmoneromooo-monero2-5/+17