Created
August 14, 2022 14:22
Simple Simulated Monero Black Marble/Flooding Attack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set.seed(314) | |
black.marble.proportion <- 0.9 | |
ring.size <- 16 | |
outputs <- sample(c(TRUE, FALSE), 1000000, replace = TRUE, | |
prob = c(1 - black.marble.proportion, black.marble.proportion)) | |
sampled.decoys <- matrix(sample(outputs, (ring.size - 1) * 100000, replace = TRUE), ncol = ring.size - 1) | |
sampled.rings <- cbind(sampled.decoys, rep(TRUE, 100000)) | |
summary(rowSums(sampled.rings)) | |
# Min. 1st Qu. Median Mean 3rd Qu. Max. | |
# 1.000 2.000 2.000 2.495 3.000 9.000 | |
black.marble.proportion <- 0.9 | |
ring.size <- 11 | |
outputs <- sample(c(TRUE, FALSE), 1000000, replace = TRUE, | |
prob = c(1 - black.marble.proportion, black.marble.proportion)) | |
sampled.decoys <- matrix(sample(outputs, (ring.size - 1) * 100000, replace = TRUE), ncol = ring.size - 1) | |
sampled.rings <- cbind(sampled.decoys, rep(TRUE, 100000)) | |
summary(rowSums(sampled.rings)) | |
# Min. 1st Qu. Median Mean 3rd Qu. Max. | |
# 1.000 1.000 2.000 1.995 3.000 8.000 | |
black.marble.proportion <- 0.8 | |
ring.size <- 16 | |
outputs <- sample(c(TRUE, FALSE), 1000000, replace = TRUE, | |
prob = c(1 - black.marble.proportion, black.marble.proportion)) | |
sampled.decoys <- matrix(sample(outputs, (ring.size - 1) * 100000, replace = TRUE), ncol = ring.size - 1) | |
sampled.rings <- cbind(sampled.decoys, rep(TRUE, 100000)) | |
summary(rowSums(sampled.rings)) | |
# Min. 1st Qu. Median Mean 3rd Qu. Max. | |
# 1 3 4 4 5 12 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment