monero/src
jeffro256 b2eb47d875
wallet: mitigate statistical dependence for decoy selection within rings
Since we are required to check for uniqueness of decoy picks within any given
ring, and since some decoy picks may fail due to unlock time or malformed EC points,
the wallet2 decoy selection code was building up a larger than needed *unique* set of
decoys for each ring according to a certain distribution *without replacement*. After
filtering out the outputs that it couldn't use, it chooses from the remaining decoys
uniformly random *without replacement*.

The problem with this is that the picks later in the picking process are not independent
from the picks earlier in the picking process, and the later picks do not follow the
intended decoy distribution as closely as the earlier picks. To understand this
intuitively, imagine that you have 1023 marbles. You label 512 marbles with the letter A,
label 256 with the letter B, so on and so forth, finally labelling one marble with the
letter J. You put them all into a bag, shake it well, and pick 8 marbles from the bag,
but everytime you pick a marble of a certain letter, you remove all the other marbles
from that bag with the same letter. That very first pick, the odds of picking a certain
marble are exactly how you would expect: you are twice as likely to pick A as you are B,
twice as likely to pick B as you are C, etc. However, on the second pick, the odds of
getting the first pick are 0%, and the chances for everything else is higher. As you go
down the line, your picked marbles will have letters that are increasingly more unlikely
to pick if you hadn't remove the other marbles. In other words, the distribution of the
later marbles will be more "skewed" in comparison to your original distribution of marbles.

In Monero's decoy selection, this same statistical effect applies. It is not as dramatic
since the distribution is not so steep, and we have more unique values to choose from,
but the effect *is* measureable. Because of the protocol rules, we cannot have duplicate
ring members, so unless that restriction is removed, we will never have perfectly
independent picking. However, since the earlier picks are less affected by this
statistical effect, the workaround that this commit offers is to store the order that
the outputs were picked and commit to this order after fetching output information over RPC.
2023-10-17 00:53:40 -05:00
..
blockchain_db blockchain_db: add clarification to get_block_already_generated_coins 2023-06-21 22:08:22 +02:00
blockchain_utilities Merge pull request #8955 2023-08-17 10:25:51 -05:00
blocks Copyright: Update to 2023 2023-01-16 13:00:18 +01:00
checkpoints Copyright: Update to 2023 2023-01-16 13:00:18 +01:00
common Merge pull request #8919 2023-07-06 21:41:12 -05:00
crypto add crypto/generators for direct access to canonical fixed generators 2023-06-28 09:52:27 -05:00
cryptonote_basic Merge pull request #8844 2023-06-27 11:37:54 -05:00
cryptonote_core Merge pull request #8924 2023-08-17 10:21:40 -05:00
cryptonote_protocol remove more 'using namespace' statements from headers 2023-07-18 22:46:43 -05:00
daemon Merge pull request #8848 2023-06-27 11:39:33 -05:00
daemonizer Merge pull request #8772 2023-06-27 11:31:27 -05:00
debug_utilities Copyright: Update to 2023 2023-01-16 13:00:18 +01:00
device Merge pull request #8698 2023-04-25 11:12:56 -04:00
device_trezor Copyright: Update to 2023 2023-01-16 13:00:18 +01:00
gen_multisig Copyright: Update to 2023 2023-01-16 13:00:18 +01:00
gen_ssl_cert core_rpc_server: new file: rpc_ssl.fingerprint 2023-07-02 19:38:51 -05:00
hardforks Copyright: Update to 2023 2023-01-16 13:00:18 +01:00
lmdb Copyright: Update to 2023 2023-01-16 13:00:18 +01:00
mnemonics Copyright: Update to 2023 2023-01-16 13:00:18 +01:00
multisig Copyright: Update to 2023 2023-01-16 13:00:18 +01:00
net net: tor_address: remove support for v2 onion addresses 2023-05-12 17:09:54 +02:00
p2p Merge pull request #8789 2023-04-25 11:22:50 -04:00
ringct Merge pull request #8698 2023-04-25 11:12:56 -04:00
rpc Merge pull request #8890 2023-08-17 10:17:46 -05:00
serialization Add CLSAG serialization to ZMQ code 2023-06-10 11:55:48 -04:00
simplewallet Merge pull request #8927 2023-08-17 10:23:10 -05:00
wallet wallet: mitigate statistical dependence for decoy selection within rings 2023-10-17 00:53:40 -05:00
CMakeLists.txt Copyright: Update to 2023 2023-01-16 13:00:18 +01:00
cryptonote_config.h Merge pull request #8698 2023-04-25 11:12:56 -04:00
version.cpp.in version: bump master version number 2022-08-09 03:37:27 +02:00
version.h