aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/cryptonote_tx_utils.h
Commit message (Collapse)AuthorAgeFilesLines
* Enforce Tx unlock_time is Zero by Relay Rule [RELEASE]jeffro2562024-04-291-3/+3
| | | | | | | | | | | | | | | | Related to https://github.com/monero-project/research-lab/issues/78 Added a relay rule that enforces the `unlock_time` field is equal to 0 for non-coinbase transactions. UIs changed: * Removed `locked_transfer` and `locked_sweep_all` commands from `monero-wallet-cli` APIs changed: * Removed `unlock_time` parameters from `wallet2` transfer methods * Wallet RPC transfer endpoints send error codes when requested unlock time is not 0 * Removed `unlock_time` parameters from `construct_tx*` cryptonote core functions @tobtoht: undo rebase changes tx.dsts -> tx_dsts
* Refactored rx-slow-hash.cSChernykh2022-12-141-8/+4
| | | | | | | | | - Straight-forward call interface: `void rx_slow_hash(const char *seedhash, const void *data, size_t length, char *result_hash)` - Consensus chain seed hash is now updated by calling `rx_set_main_seedhash` whenever a block is added/removed or a reorg happens - `rx_slow_hash` will compute correct hash no matter if `rx_set_main_seedhash` was called or not (the only difference is performance) - New environment variable `MONERO_RANDOMX_FULL_MEM` to force use the full dataset for PoW verification (faster block verification) - When dataset is used for PoW verification, dataset updates don't stall other threads (verification is done in light mode then) - When mining is running, PoW checks now also use dataset for faster verification
* multisig: fix critical vulnerabilities in signinganon2022-06-301-2/+2
|
* Add view tags to outputs to reduce wallet scanning timej-berman2022-04-181-4/+6
| | | | | | | | | | | | | 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.
* Copyright: Update to 2022mj-xmr2022-03-041-1/+1
|
* Add calcpow RPCHoward Chu2021-11-201-0/+2
| | | | Calculate PoW hash for a block candidate
* RPC and ZeroMQ APIs to support p2poolSChernykh2021-09-111-0/+9
| | | | | | | | | | | | | | | | | | | | 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
* fix serialization being different on macmoneromooo-monero2021-03-051-2/+2
| | | | | | | | | | | | On Mac, size_t is a distinct type from uint64_t, and some types (in wallet cache as well as cold/hot wallet transfer data) use pairs/containers with size_t as fields. Mac would save those as full size, while other platforms would save them as varints. Might apply to other platforms where the types are distinct. There's a nasty hack for backward compatibility, which can go after a couple forks.
* core: fix mining from a block that's not the current topmoneromooo-monero2020-08-271-0/+1
|
* Update copyright year to 2020SomaticFanatic2020-05-061-1/+1
| | | | Update copyright year to 2020
* RandomX integrationHoward Chu2019-09-251-0/+7
| | | | Support RandomX PoW algorithm
* wallet: provide original address for outgoing transfersxiphon2019-07-101-0/+15
|
* Add support for V11 protocol with BulletProofV2 and short amount.cslashm2019-03-281-0/+7
| | | | | New scheme key destination contrfol Fix dummy decryption in debug mode
* Update 2019 copyrightbinaryFate2019-03-051-1/+1
|
* New scheme key destination contrfolcslashm2019-02-081-0/+6
| | | | Implies protocol version management.
* add a bulletproof version, new bulletproof type, and rct configmoneromooo-monero2019-01-221-2/+2
| | | | This makes it easier to modify the bulletproof format
* core, wallet: remember original text version of destination addressmoneromooo-monero2019-01-181-3/+15
|
* a few minor (but easy) performance tweaksmoneromooo-monero2018-11-231-3/+3
| | | | Found by codacy.com
* v8: per byte fee, pad bulletproofs, fixed 11 ring sizemoneromooo-monero2018-09-111-1/+1
|
* bulletproofs: add multi output bulletproofs to rctmoneromooo-monero2018-09-111-2/+2
|
* Fix output shuffling for multisigstoffu2018-05-201-2/+2
|
* cryptonote_tx_utils: fixed logic bug in get_destination_view_key_pubstoffu2018-01-291-1/+1
|
* Update 2018 copyrightxmr-eric2018-01-261-1/+1
|
* make multisig work with subaddressesmoneromooo-monero2017-12-171-1/+5
| | | | Thanks to kenshi84 for help getting this work
* Add N/N multisig tx generation and signingmoneromooo-monero2017-12-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* integrate bulletproofs into moneromoneromooo-monero2017-12-081-1/+1
|
* wallet: transfer RPC can now return tx metadata (pending_tx)moneromooo-monero2017-11-241-0/+14
|
* core_tests: fix for subaddress patchkenshi842017-10-171-2/+2
|
* Subaddresseskenshi842017-10-071-3/+17
|
* construct_tx_and_get_tx_key: return sorted sources for print_ring_memebrs to ↵stoffu2017-10-031-2/+2
| | | | work properly
* core: sort ins and outs key key image and public key, respectivelymoneromooo-monero2017-09-131-1/+1
| | | | This avoids leaking some small amount of information
* some include cleanupmoneromooo-monero2017-07-311-0/+1
|
* update copyright year, fix occasional lack of newline at line endRiccardo Spagni2017-02-211-1/+1
|
* extract some basic code from libcryptonote_core into libcryptonote_basickenshi842017-02-081-0/+101