From ac1aba90f8037d29803699bedc782f87ed9698ad Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 22 Apr 2017 08:57:18 +0100 Subject: wallet2: bias fake outs more towards recent outputs Two recent papers quantified the real usage bias for the real output in a ring being the true one, and shows that the current biasing is much too weak. While we wait for a better solution, we increase the ratio of recent-to-total fake outputs, as well as decrease the time window for recent outputs, so that half the fake outs are selected within the last 1.8 day. Value plucked from figure 10, page 11 of An Empirical Analysis of Linkability in the Monero Blockchain, 2017, Miller et al. This is also arbitrary, of course, but serves as a stopgap till a better selection algorithm is chosen. --- src/wallet/wallet2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 941ee8afb..50efe1cc3 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -82,8 +82,8 @@ using namespace cryptonote; #define UNSIGNED_TX_PREFIX "Monero unsigned tx set\003" #define SIGNED_TX_PREFIX "Monero signed tx set\003" -#define RECENT_OUTPUT_RATIO (0.25) // 25% of outputs are from the recent zone -#define RECENT_OUTPUT_ZONE (5 * 86400) // last 5 days are the recent zone +#define RECENT_OUTPUT_RATIO (0.5) // 50% of outputs are from the recent zone +#define RECENT_OUTPUT_ZONE ((time_t)(1.8 * 86400)) // last 1.8 day makes up the recent zone (taken from monerolink.pdf, Miller et al) #define FEE_ESTIMATE_GRACE_BLOCKS 10 // estimate fee valid for that many blocks -- cgit v1.2.3 From a6d5bb75fe90b9f8d25ded862c7fc2d57b633ee9 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 22 Apr 2017 11:21:30 +0100 Subject: wallet2: refer to triangular distribution for recent zone in comment It was wrongly refering to equiprobable distribution, which I think I'd originally done, but forgot to update the comment after changing to triangular Reported by smooth on IRC --- src/wallet/wallet2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 50efe1cc3..08e186ac5 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -3643,7 +3643,7 @@ void wallet2::get_outs(std::vector> uint64_t i; if (num_found - 1 < recent_outputs_count) // -1 to account for the real one we seeded with { - // equiprobable distribution over the recent outs + // triangular distribution over [a,b) with a=0, mode c=b=up_index_limit uint64_t r = crypto::rand() % ((uint64_t)1 << 53); double frac = std::sqrt((double)r / ((uint64_t)1 << 53)); i = (uint64_t)(frac*num_recent_outs) + num_outs - num_recent_outs; -- cgit v1.2.3