aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2022-08-06ledger support for hf 15 (BP+, view tags)j-berman2-7/+15
2022-06-20cryptonote_basic: catch crypto api errorsmoneromooo-monero1-2/+2
2022-05-17src, epee: fix a couple compiler warningsselsta1-2/+0
2022-04-21Preserve commitment format inside transactionsLuke Parker1-1/+1
2022-04-18Move copyable_atomic into connection_contextJeffrey1-4/+35
Relevant commit from old PR: bd0a5119957d3ef9130a0b82599e1696995ef235
2022-04-18Add view tags to outputs to reduce wallet scanning timej-berman4-30/+170
Implements view tags as proposed by @UkoeHB in MRL issue https://github.com/monero-project/research-lab/issues/73 At tx construction, the sender adds a 1-byte view tag to each output. The view tag is derived from the sender-receiver shared secret. When scanning for outputs, the receiver can check the view tag for a match, in order to reduce scanning time. When the view tag does not match, the wallet avoids the more expensive EC operations when deriving the output public key using the shared secret.
2022-04-10Fee changes from ArticMinemoneromooo-monero2-0/+65
https://github.com/ArticMine/Monero-Documents/blob/master/MoneroScaling2021-02.pdf with a change to use 1.7 instead of 2.0 for the max long term increase rate
2022-04-06CMake: Add missing headers via monero_find_all_headers macromj-xmr1-14/+1
2022-04-05store outPk/8 in the tx for speedmoneromooo-monero1-1/+1
It avoids dividing by 8 when deserializing a tx, which is a slow operation, and multiplies by 8 when verifying and extracing the amount, which is much faster as well as less frequent
2022-04-05plug bulletproofs plus into consensusmoneromooo-monero2-14/+65
2022-03-30Eliminate dependence on boost::interprocess #8223Jeffrey2-10/+9
In this repo, `boost::interprocess` was being used soley to make `uint32_t` operations atomic. So I replaced each instance of `boost::interprocess::ipcdetail::atomic(...)32` with `std::atomic` methods. I replaced member declarations as applicable. For example, when I needed to change a `volatile uint32_t` into a `std::atomic<uint32_t>`. Sometimes, a member was being used a boolean flag, so I replaced it with `std::atomic<bool>`. You may notice that I didn't touch `levin_client_async.h`. That is because this file is entirely unused and will be deleted in PR monero-project#8211. Additional changes from review: * Make some local variables const * Change postfix operators to prefix operators where value was not need
2022-03-04Copyright: Update to 2022mj-xmr27-27/+32
2022-02-22multisig key exchange update and refactorkoe3-7/+20
2021-09-11RPC and ZeroMQ APIs to support p2poolSChernykh3-0/+4
Adds the following: - "get_miner_data" to RPC API - "json-miner-data" to ZeroMQ subscriber contexts Both provide the necessary data to create a custom block template. They are used by p2pool. Data provided: - major fork version - current height - previous block id - RandomX seed hash - network difficulty - median block weight - coins mined by the network so far - mineable mempool transactions
2021-07-13cmake: fix undefined symbols and multiple definitionsanon3-16/+58
2021-04-16Split epee/string_tools.h and encapsulate boost::lexical_castmj-xmr1-0/+1
2021-03-28Reduce compilation time of epee/portable_storage_template_helper.hmj-xmr1-0/+1
2021-03-22cryptonote_protocol_handler: fix race conditionanon1-0/+2
2021-02-09New add_aux_pow RPC to support merge miningmoneromooo-monero5-0/+157
2021-02-09Remove unused variables in monero codebaseKevin Barbour1-1/+0
There are quite a few variables in the code that are no longer (or perhaps never were) in use. These were discovered by enabling compiler warnings for unused variables and cleaning them up. In most cases where the unused variables were the result of a function call the call was left but the variable assignment removed, unless it was obvious that it was a simple getter with no side effects.
2021-01-23Improve cryptonote (block and tx) binary read performanceLee Clagett4-67/+26
2021-01-03add a max levin packet size by command typemoneromooo-monero1-0/+23
2020-12-26cryptonote_basic: guess what got lost porting patches to branches againmoneromooo-monero1-1/+1
2020-12-25protocol: drop nodes if they claim new data but only give stale datamoneromooo-monero1-1/+2
Some joker is spending time actually doing this
2020-12-22Command max_bytes moved from dynamic map to static switchLee Clagett3-22/+75
2020-12-17Add aggressive restrictions to pre-handshake p2p buffer limitLee Clagett1-0/+2
2020-12-11protocol: stricter checks on received chain hash listmoneromooo1-0/+1
2020-12-06protocol: drop peers that don't reply to queriesmoneromooo1-1/+3
2020-12-04protocol: add scoring system to drop peers that don't behavemoneromooo1-2/+2
2020-08-27core: fix mining from a block that's not the current topmoneromooo-monero2-7/+9
2020-08-27Integrate CLSAGs into moneromoneromooo-monero2-8/+28
They are allowed from v12, and MLSAGs are rejected from v13.
2020-08-17Revert "Use domain-separated ChaCha20 for in-memory key encryption"luigi11112-71/+50
This reverts commit 921dd8dde5d381052d0aa2936304a3541a230c55.
2020-08-17replace most boost serialization with existing monero serializationmoneromooo-monero3-3/+1
This reduces the attack surface for data that can come from malicious sources (exported output and key images, multisig transactions...) since the monero serialization is already exposed to the outside, and the boost lib we were using had a few known crashers. For interoperability, a new load-deprecated-formats wallet setting is added (off by default). This allows loading boost format data if there is no alternative. It will likely go at some point, along with the ability to load those. Notably, the peer lists file still uses the boost serialization code, as the data it stores is define in epee, while the new serialization code is in monero, and migrating it was fairly hairy. Since this file is local and not obtained from anyone else, the marginal risk is minimal, but it could be migrated later if needed. Some tests and tools also do, this will stay as is for now.
2020-08-17Avoid some temporary strings when reading off the databasemoneromooo-monero3-31/+35
2020-08-09Use domain-separated ChaCha20 for in-memory key encryptionSarang Noether2-50/+71
2020-05-31miner: increase min/max intervals to full extentsmoneromooo-monero1-4/+3
This prevents setting target to, eg, 65 being ignored and remove an unused constant
2020-05-06Update copyright year to 2020SomaticFanatic21-21/+21
Update copyright year to 2020
2020-05-04Adding ZMQ/Pub support for txpool_add and chain_main eventsLee Clagett2-0/+82
2020-04-22cryptonote: fix reuse of non default tx data when relayingmoneromooo-monero1-0/+2
An automatic tx variable is initialized properly on the first run through the loop, but not the second. Moving the variable inside the loop ensures the ctor is called again to init it.
2020-04-08Add timelock verification on devicecslashm2-0/+16
2020-04-01Hash domain separationSarang Noether2-6/+2
2020-03-31cryptonote_basic: drop unused verification_context::m_not_rct fieldxiphon1-1/+0
2020-03-26Adding Dandelion++ support to public networks:Lee Clagett1-1/+6
- New flag in NOTIFY_NEW_TRANSACTION to indicate stem mode - Stem loops detected in tx_pool.cpp - Embargo timeout for a blackhole attack during stem phase
2020-03-20p2p: remove old debug commandsAaron Hook2-55/+0
2020-02-06miner: use verification mode for low diff one block nonce searchesmoneromooo-monero1-1/+1
This avoids lengthy init times when testing
2019-12-12print_coinbase_tx_sum now supports 128 bits sumsmoneromooo-monero2-2/+18
The tail emission will bring the total above 64 bits
2019-10-31cryptonote: untangle dependency from miner to blockchainmoneromooo-monero2-9/+9
It causes link errors at least on mac
2019-10-31cryptonote: untangle dependency from miner to blockchainmoneromooo-monero2-9/+9
It causes link errors at least on mac
2019-10-25daemon, wallet: new pay for RPC use systemmoneromooo-monero1-1/+2
Daemons intended for public use can be set up to require payment in the form of hashes in exchange for RPC service. This enables public daemons to receive payment for their work over a large number of calls. This system behaves similarly to a pool, so payment takes the form of valid blocks every so often, yielding a large one off payment, rather than constant micropayments. This system can also be used by third parties as a "paywall" layer, where users of a service can pay for use by mining Monero to the service provider's address. An example of this for web site access is Primo, a Monero mining based website "paywall": https://github.com/selene-kovri/primo This has some advantages: - incentive to run a node providing RPC services, thereby promoting the availability of third party nodes for those who can't run their own - incentive to run your own node instead of using a third party's, thereby promoting decentralization - decentralized: payment is done between a client and server, with no third party needed - private: since the system is "pay as you go", you don't need to identify yourself to claim a long lived balance - no payment occurs on the blockchain, so there is no extra transactional load - one may mine with a beefy server, and use those credits from a phone, by reusing the client ID (at the cost of some privacy) - no barrier to entry: anyone may run a RPC node, and your expected revenue depends on how much work you do - Sybil resistant: if you run 1000 idle RPC nodes, you don't magically get more revenue - no large credit balance maintained on servers, so they have no incentive to exit scam - you can use any/many node(s), since there's little cost in switching servers - market based prices: competition between servers to lower costs - incentive for a distributed third party node system: if some public nodes are overused/slow, traffic can move to others - increases network security - helps counteract mining pools' share of the network hash rate - zero incentive for a payer to "double spend" since a reorg does not give any money back to the miner And some disadvantages: - low power clients will have difficulty mining (but one can optionally mine in advance and/or with a faster machine) - payment is "random", so a server might go a long time without a block before getting one - a public node's overall expected payment may be small Public nodes are expected to compete to find a suitable level for cost of service. The daemon can be set up this way to require payment for RPC services: monerod --rpc-payment-address 4xxxxxx \ --rpc-payment-credits 250 --rpc-payment-difficulty 1000 These values are an example only. The --rpc-payment-difficulty switch selects how hard each "share" should be, similar to a mining pool. The higher the difficulty, the fewer shares a client will find. The --rpc-payment-credits switch selects how many credits are awarded for each share a client finds. Considering both options, clients will be awarded credits/difficulty credits for every hash they calculate. For example, in the command line above, 0.25 credits per hash. A client mining at 100 H/s will therefore get an average of 25 credits per second. For reference, in the current implementation, a credit is enough to sync 20 blocks, so a 100 H/s client that's just starting to use Monero and uses this daemon will be able to sync 500 blocks per second. The wallet can be set to automatically mine if connected to a daemon which requires payment for RPC usage. It will try to keep a balance of 50000 credits, stopping mining when it's at this level, and starting again as credits are spent. With the example above, a new client will mine this much credits in about half an hour, and this target is enough to sync 500000 blocks (currently about a third of the monero blockchain). There are three new settings in the wallet: - credits-target: this is the amount of credits a wallet will try to reach before stopping mining. The default of 0 means 50000 credits. - auto-mine-for-rpc-payment-threshold: this controls the minimum credit rate which the wallet considers worth mining for. If the daemon credits less than this ratio, the wallet will consider mining to be not worth it. In the example above, the rate is 0.25 - persistent-rpc-client-id: if set, this allows the wallet to reuse a client id across runs. This means a public node can tell a wallet that's connecting is the same as one that connected previously, but allows a wallet to keep their credit balance from one run to the other. Since the wallet only mines to keep a small credit balance, this is not normally worth doing. However, someone may want to mine on a fast server, and use that credit balance on a low power device such as a phone. If left unset, a new client ID is generated at each wallet start, for privacy reasons. To mine and use a credit balance on two different devices, you can use the --rpc-client-secret-key switch. A wallet's client secret key can be found using the new rpc_payments command in the wallet. Note: anyone knowing your RPC client secret key is able to use your credit balance. The wallet has a few new commands too: - start_mining_for_rpc: start mining to acquire more credits, regardless of the auto mining settings - stop_mining_for_rpc: stop mining to acquire more credits - rpc_payments: display information about current credits with the currently selected daemon The node has an extra command: - rpc_payments: display information about clients and their balances The node will forget about any balance for clients which have been inactive for 6 months. Balances carry over on node restart.
2019-10-21Support median block size > 4 GBmoneromooo-monero1-5/+2
add a 128/64 division routine so we can use a > 32 bit median block size in calculations
2019-10-13Add also ifdef __x86_64__pkubaj1-2/+2
2019-10-13Fix build on FreeBSD/!x86pkubaj1-0/+4
Checking battery status uses x86-only headers and functions. Remove this functionality to get it to build on other architectures.
2019-10-11cryptonote: add function to get weight from a pruned txmoneromooo-monero2-11/+66
The weight of the prunable data is deterministic from the unpruned data, so it can be determined from a pruned tx
2019-09-27monerod can now sync from pruned blocksmoneromooo-monero3-17/+92
If the peer (whether pruned or not itself) supports sending pruned blocks to syncing nodes, the pruned version will be sent along with the hash of the pruned data and the block weight. The original tx hashes can be reconstructed from the pruned txes and theur prunable data hash. Those hashes and the block weights are hashes and checked against the set of precompiled hashes, ensuring the data we received is the original data. It is currently not possible to use this system when not using the set of precompiled hashes, since block weights can not otherwise be checked for validity. This is off by default for now, and is enabled by --sync-pruned-blocks
2019-09-25RandomX integrationHoward Chu4-30/+14
Support RandomX PoW algorithm
2019-09-25ban peers sending bad pow outrightmoneromooo-monero1-0/+1
PoW is expensive to verify, so be strict
2019-09-19core: move hardforks into its own libmoneromooo-monero2-11/+4
So it can be used by others without encumbrance
2019-09-05Make null hash constants constexprLev Sizov1-1/+1
Simplify m_template initialization in miner
2019-09-04difficulty: fix check_hash on big endianmoneromooo-monero1-1/+0
2019-09-02Removed unused boost/value_init headerLev Sizov1-1/+0
2019-09-02Changed the use of boost:value_initialized for C++ list initializerJesus Ramirez1-1/+1
2019-07-17Added support for "noise" over I1P/Tor to mask Tx transmission.Lee Clagett1-0/+2
2019-07-02miner: fix --bg-mining-enable descriptionmoneromooo-monero1-1/+1
2019-06-14serialization: check stream good flag at the endmoneromooo-monero1-1/+1
just in case
2019-06-14cryptonote: throw on tx hash calculation errormoneromooo-monero1-3/+3
2019-06-09miner: fix double free of thread attributesston1th2-10/+6
issue: #5568
2019-05-01fix wide difficulty conversion with some versions of boostmoneromooo-monero1-2/+2
2019-04-23consensus: from v12, enforce >= 2 outputsmoneromooo-monero1-0/+1
2019-04-20hardfork: fix off by one updating fork index after poppingmoneromooo-monero1-3/+2
2019-04-15Increment m_threads_active when mining thread startsDoyle1-0/+1
2019-04-14hardfork: remove "no hf version db" recreation checkmoneromooo-monero1-20/+2
This is now obsolete, and this removes the warning on startup on a new db that confuses some people
2019-04-14blockchain_db: fix db txn ending too earlymoneromooo-monero1-6/+2
The db txn in add_block ending caused the entire overarching batch txn to stop. Also add a new guard class so a db txn can be stopped in the face of exceptions. Also use a read only db txn in init when the db itself is read only, and do not save the max tx size in that case.
2019-04-11functional_tests: add more blockchain related testsmoneromooo-monero3-2/+14
Related to emission, reorgs, getting tx data back, output distribution and histogram
2019-04-05rpc: make wide_difficulty hexadecimalmoneromooo-monero2-0/+18
This should be friendlier for clients which don't have bignum support
2019-04-05cryptonote: rework block blob size sanity checkmoneromooo-monero3-6/+2
Use the actual block weight limit, assuming that weight is always greater or equal to size
2019-04-04wallet: new option to start background miningmoneromooo-monero1-5/+11
The setup-background-mining option can be used to select background mining when a wallet loads. The user will be asked the first time the wallet is created.
2019-04-01miner: fix race when stopping mining with start mining enabledmoneromooo-monero2-6/+10
2019-04-01various: remove unused variablesmoneromooo-monero1-2/+0
2019-03-25cryptonote_basic: some more minor speedupsmoneromooo-monero1-4/+16
2019-03-25cryptonote_basic: speedup calculate_block_hashmoneromooo-monero1-2/+7
The block 202612 fix can be left tested at the end, if we already know we're not in the general case
2019-03-25cryptonote: block parsing + hash calculation speedupmoneromooo-monero2-4/+30
This saves a duplicate serialization step
2019-03-24Make difficulty 128 bit instead of 64 bitmoneromooo-monero3-4/+115
Based on Boolberry work by: jahrsg <jahr@jahr.me> cr.zoidberg <crypto.zoidberg@gmail.com>
2019-03-21cryptonote: fix calculating coinbase tx hashmoneromooo-monero1-10/+6
Also set error flag on exception when handling new txes to keep tests working
2019-03-21wallet: fix offline signing calling a daemon RPCmoneromooo-monero1-0/+7
2019-03-20device/trezor: HF10 support added, wallet::APIDusan Klinec1-0/+5
- import only key images generated by cold signing process - wallet_api: trezor methods added - wallet: button request code added - const added to methods - wallet2::get_tx_key_device() tries to decrypt stored tx private keys using the device. - simplewallet supports get_tx_key and get_tx_proof on hw device using the get_tx_key feature - live refresh enables refresh with trezor i.e. computing key images on the fly. More convenient and efficient for users. - device: has_ki_live_refresh added - a thread is watching whether live refresh is being computed, if not for 30 seconds, it terminates the live refresh process - switches Trezor state
2019-03-14miner: fix possible exit crash due to race in stopmoneromooo-monero1-2/+3
If a thread asks to stop the miner, m_stop will be set, and that thread will wait to join. If the main thread is exiting at that time, it will ask the miner to stop, but the miner will claim it's not mining and early out since m_stop is set. This will cause the database and other things to get shutdown. If the miner happens to find a block at that time, it will try to call core, and crash. Instead, lock and check whether any threads are currently in m_threads, since they'll only be cleared once the threads are joined. Moreover, since we lock, the second thread will have to wait for the first one to have finished. Calling join twice on a thread seems fine as per pthread_join(3).
2019-03-12hardfork: update last_versions on popped blockmoneromooo-monero1-0/+3
2019-03-09daemon: new mining_status commandmoneromooo-monero2-4/+9
2019-03-05Update 2019 copyrightbinaryFate22-22/+22
2019-03-05cryptonote: speed up calculating coinbase tx prunable hashmoneromooo-monero1-2/+9
It's a hash of an empty buffer, so we can avoid keccak
2019-03-05core: avoid calculating tx prefix hash when we don't need itmoneromooo-monero2-1/+9
2019-03-05db: speedup block additionmoneromooo-monero3-26/+67
by avoiding repeated (de)serialization
2019-03-04check load_t_from_json return valuesmoneromooo-monero1-1/+2
2019-03-04default initialize rpc structuresmoneromooo-monero1-1/+2
2019-03-04hardfork: fix fork determination for historical heightsmoneromooo1-1/+1
2019-02-25daemon: add --public-node mode, RPC port propagation over P2Pxiphon1-1/+3
2019-02-23miner: it can now autodetect the optimal number of threadsmoneromooo-monero2-4/+84
2019-02-14Cryptonight variant 4 aka CryptonightRSChernykh1-1/+1
It introduces random integer math into the main loop.
2019-02-10Human readable message if maximum outputs reacheditalocoin1-0/+1
2019-02-03ringct: fix v1 ecdhInfo serializationmoneromooo-monero1-15/+2
The change made for v2 broke v1, and we have no way to know which version we're serializing here. However, since we don't actually care about space savings in this case, we continue serialiazing both mask and amount.
2019-01-22ringct: remove unused senderPk from ecdhTuplemoneromooo-monero1-1/+0
This was an early ringct field, which was never used in production
2019-01-22ringct: the commitment mask is now deterministicmoneromooo-monero1-1/+4
saves space in the tx and is safe Found by knaccc
2019-01-22ringct: encode 8 byte amount, saving 24 bytes per outputmoneromooo-monero1-1/+11
Found by knaccc
2019-01-22add a bulletproof version, new bulletproof type, and rct configmoneromooo-monero1-3/+3
This makes it easier to modify the bulletproof format
2019-01-22Pruningmoneromooo-monero5-5/+56
The blockchain prunes seven eighths of prunable tx data. This saves about two thirds of the blockchain size, while keeping the node useful as a sync source for an eighth of the blockchain. No other data is currently pruned. There are three ways to prune a blockchain: - run monerod with --prune-blockchain - run "prune_blockchain" in the monerod console - run the monero-blockchain-prune utility The first two will prune in place. Due to how LMDB works, this will not reduce the blockchain size on disk. Instead, it will mark parts of the file as free, so that future data will use that free space, causing the file to not grow until free space grows scarce. The third way will create a second database, a pruned copy of the original one. Since this is a new file, this one will be smaller than the original one. Once the database is pruned, it will stay pruned as it syncs. That is, there is no need to use --prune-blockchain again, etc.
2019-01-01blockchain: fix wrong hf version when popping multiple blocksmoneromooo-monero2-0/+33
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-01-01hardfork: remove batch transactions setupmoneromooo-monero1-1/+0
This is now default, so it spares us the warnings
2018-12-07cryptonote: don't serialize for blob size if already knownmoneromooo-monero1-5/+13
2018-12-05cryptonote: set tx hash on newly parsed txes when knownmoneromooo-monero2-0/+3
2018-12-04move int-util.h to epeemoneromooo-monero2-2/+2
2018-11-30cryptonote: add a set_null for transaction_prefixmoneromooo-monero1-7/+10
Since it's all inline, I suspect the compiler will merge the duplicate stores anyway.
2018-11-23cryptonote: fix get_unit for non default settingsmoneromooo-monero1-2/+2
Found by codacy.com
2018-11-23a few minor (but easy) performance tweaksmoneromooo-monero2-2/+2
Found by codacy.com
2018-11-19Avoid unnecessary temp block and copy ctormoneromooo-monero1-1/+1
block already has a default ctor, and the extra object churn due to its innards (vectors, etc) is pointless.
2018-11-15Removed a lot of unnecessary includesMartijn Otto3-23/+18
2018-11-02device/trezor: trezor support addedDusan Klinec2-5/+20
2018-10-29hardfork: initialize current_fork_index in ctormoneromooo-monero1-3/+4
Also order init list to match actual runtime init order Coverity 136605
2018-10-27cryptonote: use logging functions for errors, not std::coutmoneromooo-monero1-1/+1
2018-10-22miner: fix build with boost 1.69moneromooo-monero1-1/+1
2018-10-16account: init creation timestamp to 0moneromooo-monero1-0/+1
Never actually used uninitialized Coverity 136615
2018-10-08miner: really reset flags/precision on std::coutmoneromooo-monero1-1/+1
2018-10-08tx_pool: avoid parsing a whole tx if only the prefix is neededmoneromooo-monero2-0/+11
2018-10-07cryptonote: sort tx_extra fieldsmoneromooo-monero3-1/+87
This removes some small amount of fingerprinting entropy. There is no consensus rule to require this since this field is technically free form, and a transaction is free to have custom data in it.
2018-09-29Merge pull request #4459Riccardo Spagni1-2/+4
bcf3f6af fuzz_tests: catch unhandled exceptions (moneromooo-monero) 3ebd05d4 miner: restore stream flags after changing them (moneromooo-monero) a093092e levin_protocol_handler_async: do not propagate exception through dtor (moneromooo-monero) 1eebb82b net_helper: do not propagate exceptions through dtor (moneromooo-monero) fb6a3630 miner: do not propagate exceptions through dtor (moneromooo-monero) 2e2139ff epee: do not propagate exception through dtor (moneromooo-monero) 0749a8bd db_lmdb: do not propagate exceptions in dtor (moneromooo-monero) 1b0afeeb wallet_rpc_server: exit cleanly on unhandled exceptions (moneromooo-monero) 418a9936 unit_tests: catch unhandled exceptions (moneromooo-monero) ea7f9543 threadpool: do not propagate exceptions through the dtor (moneromooo-monero) 6e855422 gen_multisig: nice exit on unhandled exception (moneromooo-monero) 53df2deb db_lmdb: catch error in mdb_stat calls during migration (moneromooo-monero) e67016dd blockchain_blackball: catch failure to commit db transaction (moneromooo-monero) 661439f4 mlog: don't remove old logs if we failed to rename the current file (moneromooo-monero) 5fdcda50 easylogging++: test for NULL before dereference (moneromooo-monero) 7ece1550 performance_test: fix bad last argument calling add_arg (moneromooo-monero) a085da32 unit_tests: add check for page size > 0 before dividing (moneromooo-monero) d8b1ec8b unit_tests: use std::shared_ptr to shut coverity up about leaks (moneromooo-monero) 02563bf4 simplewallet: top level exception catcher to print nicer messages (moneromooo-monero) c57a65b2 blockchain_blackball: fix shift range for 32 bit archs (moneromooo-monero)
2018-09-14hw_device: support for multiple devices added [for review]Dusan Klinec2-3/+8
- device name is a new wallet property - full device name is now a bit more structured so we can address particular device vendor + device path. Example: 'Ledger', 'Trezor:udp', 'Trezor:udp:127.0.0.1:21324', 'Trezor:bridge:usb01'. The part before ':' identifies HW device implementation, the optional part after ':' is device path to look for. - new --hw-device parameter added to the wallet, can name the hardware device - device reconnect added
2018-09-11bulletproofs: scale points by 8 to ensure subgroup validitymoneromooo-monero1-1/+1
2018-09-11cryptonote_basic: check output type before using itmoneromooo-monero1-0/+7
Reported by QuarksLab.
2018-09-11v8: per byte fee, pad bulletproofs, fixed 11 ring sizemoneromooo-monero4-28/+64
2018-09-11Bulletproof aggregated verification and testsmoneromooo-monero2-8/+16
Also constrains bulletproofs to simple rct, for simplicity
2018-09-10Add support for apple and arm buildingTheCharlatan1-3/+7
Add pcsc-lite to linux builds Fixup windows icu4c linking with depends, the static libraries have an 's' appended to them Compiling depends arm-linux-gnueabihf will allow you to compile armv6zk monero binaries
2018-09-02cryptonote_format_utils: do not early out on invalid tx pubkeysmoneromooo-monero1-3/+13
Another such pubkey might be valid
2018-08-16crypto: make secret_key automatically mlockmoneromooo-monero1-2/+2
2018-08-16store secret keys encrypted where possiblemoneromooo-monero2-0/+82
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-06-29add --regtest and --fixed-difficulty for regression testingvictorsintnicolaas1-7/+8
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-26replace std::list with std::vector on some hot pathsmoneromooo-monero1-1/+1
also use reserve where appropriate
2018-06-20miner: show id and height when a block is foundstoffu1-1/+1
2018-06-11cryptonote_config: add get_config to refactor x = testnet ? ↵stoffu1-14/+5
config::testnet::X : stagenet ? config::stagenet::X : config::X
2018-05-30hardfork: fix get_next_version()stoffu1-3/+3
2018-05-30hardfork: fix get_earliest_ideal_height_for_version() to support ↵stoffu1-4/+8
non-existent versions
2018-05-26fix build with GCC 8.1.0moneromooo-monero1-1/+1
2018-05-23db_lmdb: save pruned and prunable tx data separatelymoneromooo-monero2-8/+60
This bumps DB version to 2, migration code will run for v1 DBs
2018-05-07cryptonote: make sure outPk setup always happensmoneromooo-monero1-0/+37
2018-05-06handle optional miner params bettercryptochangements341-0/+5
2018-04-28connection_context: remove "state_" prefix from state namesmoneromooo-monero1-5/+5
It's redundant and makes it easier to print them in columns
2018-03-15Fix typos in various filesDimitris Apostolou1-1/+1
2018-03-14keypair::generate: always require hw::device to avoid possible mistakestoffu1-6/+0
2018-03-14device: untangle cyclic depenencystoffu5-200/+15
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-14device: made function prototypes consistent with pre-#3303 codebasestoffu1-7/+3
2018-03-12Ledger HW Bug fixesCédric1-2/+0
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-05Monero Cryptonight variants, and add one for v7moneromooo-monero1-1/+2
This is the first variant of many, with the intent to improve Monero's resistance to ASICs and encourage mining decentralization.
2018-03-05Correct spelling mistakes.Edward Betts1-1/+1
2018-03-05Stagenetstoffu6-28/+32
2018-03-04Code modifications to integrate Ledger HW device into monero-wallet-cli.cslashm6-23/+188
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-02-16wallet2: speed up subaddress generation (by about a third)moneromooo-monero2-0/+40
2018-02-13Remove `voting_version` parameter documentation.Jean Pierre Dudey1-1/+0
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-02-12Closes #2886: really ignore battery checkingTimothy D. Prime1-11/+5
Move option test first.
2018-02-04connection_context: initialize m_last_request_time to current timemoneromooo-monero1-1/+1
This prevents spurious early peer drops
2018-02-02miner: restore std::cout precision after modificationmoneromooo-monero1-1/+2
Coverity 136462
2018-01-31ringct: pseudoOuts moved to prunable in the simple bulletproof casemoneromooo-monero1-2/+6
Saves 64 bytes non prunable data per typical tx This breaks v7 consensus, will require a testnet reorg from v6
2018-01-26Readd copyright starting datexmr-eric1-1/+1
2018-01-26Update 2018 copyrightxmr-eric22-22/+22
2017-12-22factor STL container serializationmoneromooo-monero3-2/+2
2017-12-18check accessing an element past the end of a containermoneromooo-monero1-1/+1
2017-12-18check return value for generate_key_derivation and derive_public_keymoneromooo-monero1-4/+8
2017-12-17make multisig work with subaddressesmoneromooo-monero1-4/+49
Thanks to kenshi84 for help getting this work
2017-12-17N-1/N multisigmoneromooo-monero2-2/+14
2017-12-17Add N/N multisig tx generation and signingmoneromooo-monero1-0/+15
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-17wallet: add multisig key generationmoneromooo-monero2-0/+8
Scheme by luigi1111
2017-12-16move includes around to lessen overall loadmoneromooo-monero4-2/+43
2017-12-08add bulletproofs from v7 on testnetmoneromooo-monero1-4/+4
2017-12-08integrate bulletproofs into moneromoneromooo-monero1-0/+21
2017-11-27new wipeable_string class to replace std::string passphrasesmoneromooo-monero2-4/+10
2017-11-22cryptonote: do not overwrite const datamoneromooo-monero2-4/+4
2017-11-14remove "using namespace std" from headersmoneromooo-monero1-0/+2
It's nasty, and actually breaks on Solaris, where if.h fails to build due to: struct map *if_memmap;
2017-11-11Implement missing miner functions on FreeBSDVasil Dimov1-1/+105
cryptonote::miner::get_system_times(): Fetch the system's total and idle time using sysctl kern.cp_time. cryptonote::miner::get_process_time(): Use the same implementation as Linux and OSX, the times(3) function conforms to POSIX.1 and is available on FreeBSD. cryptonote::miner::on_battery_power(): Try to fetch the battery status using sysctl hw.acpi.acline. If that fails (if ACPI is not enabled on the system), then try querying /dev/apm.
2017-11-11Remove unused variables and fix typos in commentsVasil Dimov1-4/+2
2017-10-15refactor cryptonote_basic::add_tx_pub_key_to_extraJaquee2-3/+15
2017-10-07miner: always update block template when startingmoneromooo-monero1-2/+1
This fixes using the previous address when starting mining, then stopping and restarting with a different address
2017-10-07Subaddresseskenshi8410-84/+333
2017-09-27connection_context: initialize m_callback_request_count to 0moneromooo-monero1-1/+1
2017-09-25fix typo in basic and core CMakeLists.txtmoneromooo-monero1-1/+1
2017-09-25move checkpoints in a separate librarymoneromooo-monero7-522/+3
2017-09-12wallet: add encrypted seed functionalitymoneromooo-monero2-0/+19
This uses luigi1111's CN_Add method. See https://xmr.llcoins.net for details.
2017-09-08Fix AC power supply detection on LinuxGuillaume LE VAILLANT1-13/+0
The /sys/class/power_supply/*/present file usually does not exist for AC power supplies.
2017-09-06update hardcoded checkpointsRiccardo Spagni1-0/+2
2017-08-16cryptonote_protocol: kick idle synchronizing peersmoneromooo-monero1-0/+3
In case they dropped off downloading for any reason, they'll get sent to download again.
2017-08-15befor -> beforeNano Akron1-4/+4
Really unique yet consistent spelling mistake
2017-08-12protocol: fix reorgs while syncingmoneromooo-monero1-1/+3
2017-08-12miner: set thread name before loggingmoneromooo-monero1-1/+1
2017-08-09connection_context: initialize statemoneromooo-monero1-0/+1
Why this was initialized properly before I have no idea, but it is not anymore. Fix it, which fixes syncing in release mode.
2017-08-08cryptonote_basic: fix silly CLANG warning about not emitting functionmoneromooo-monero1-1/+1
2017-08-07cryptonote_protocol_handler: sync speedupmoneromooo-monero1-0/+1
A block queue is now placed between block download and block processing. Blocks are now requested only from one peer (unless starved). Includes a new sync_info coommand.
2017-08-02difficulty: fix misleading commentGuillaume LE VAILLANT1-2/+2
2017-07-31some include cleanupmoneromooo-monero1-1/+0
2017-07-31miner: fix ignoring battery from command linemoneromooo-monero1-1/+1
2017-07-27Move OpenAlias console input back from libsmoneromooo-monero2-6/+15
Library code should definitely not ask for console input unless it's clearly an input function. Delegating the user interaction part to the caller means it can now be used by a GUI, or have a decision algorithm better adapted to a particular caller.
2017-07-12miner: fix background mining options parsingmoneromooo-monero1-2/+2
They were set as uint8_t, which boost was apparently treating as a character type, rather than a numeric type
2017-07-06fix on_battery_power for linuxRyan Mehta1-26/+86
fix ac/battery linux
2017-06-08Add OSX background miningjethro2-1/+43
Implements miner::get_system_times, miner::get_process_time and miner::on_battery_power for OSX so that background mining works on OSX.
2017-05-23changed crypto to cncrypto so it generated libcncryptoGentian1-1/+1
fix a cmakelist