upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiatjaf <fiatjaf@gmail.com>2024-11-09 07:59:14 -0300
committerfiatjaf <fiatjaf@gmail.com>2026-02-04 19:22:23 -0300
commitf1ed55e8e9d861938670f34c7251713d3ebab235 (patch)
tree5d88afe2e4996c770b9dccfa1e61ab7f8b369981
parentcd60c2e9cf4600641bcd85efca15eccd50d0c417 (diff)
nip45: mention hyperloglog attack and its solution.
-rw-r--r--45.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/45.md b/45.md
index 48ff447..6bb4203 100644
--- a/45.md
+++ b/45.md
@@ -56,6 +56,10 @@ On the client side, these HLL values received from different relays can be merge
56 56
57And finally the absolute count can be estimated by running some methods I don't dare to describe here in English, it's better to check some implementation source code (also, there can be different ways of performing the estimation, with different quirks applied on top of the raw registers). 57And finally the absolute count can be estimated by running some methods I don't dare to describe here in English, it's better to check some implementation source code (also, there can be different ways of performing the estimation, with different quirks applied on top of the raw registers).
58 58
59### Attack vectors
60
61One could mine a pubkey with a certain number of zero bits in the exact place where the HLL algorithm described above would look for them in order to artificially make its reaction or follow "count more" than others. For this to work a different pubkey would have to be created for each different target (event id, followed profile etc). This approach is not very different than creating tons of new pubkeys and using them all to send likes or follow someone in order to inflate their number of followers. The solution is the same in both cases: clients should not fetch these reaction counts from open relays that accept everything, they should base their counts on relays that perform some form of filtering that makes it more likely that only real humans are able to publish there and not bots or artificially-generated pubkeys.
62
59### `hll` encoding 63### `hll` encoding
60 64
61The value `hll` value must be the concatenation of the 256 registers, each being a uint8 value (i.e. a byte). Therefore `hll` will be a 512-character hex string. 65The value `hll` value must be the concatenation of the 256 registers, each being a uint8 value (i.e. a byte). Therefore `hll` will be a 512-character hex string.