-
Notifications
You must be signed in to change notification settings - Fork 37.7k
[WIP] 3072-bit MuHash based hash_serialized #10434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release notes entry needed.
@@ -0,0 +1,329 @@ | |||
#include "muhash.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright header missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
src/test/crypto_tests.cpp
Outdated
for (int i = 0; i < 10; ++i) { | ||
unsigned char res[384]; | ||
int table[4]; | ||
for (int i = 0; i < 4; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i
shadowing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
} | ||
for (int order = 0; order < 4; ++order) { | ||
MuHash3072 acc; | ||
for (int i = 0; i < 4; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i
shadowing
y /= x; // x=X, y=Y/X, z=X/Y | ||
z *= y; // x=X, y=Y/X, z=1 | ||
z.Finalize(out); | ||
for (int i = 0; i < 384; ++i) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i
shadowing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
7940961
to
791b3ac
Compare
@sipa - did this POC of chainstate only sync: Worked well - syncs as fast at you can download chainstate db (30mins for 2.8gig chainstate). Network was the bottleneck. Or guess could compute hash by downloading every block! Then no security loss. But 150Gig download - so still 8hrs for 40Mbit connection. (think the hashing would take about 1 hour but in parallel with download). |
Closing as stale. |
This implements a 3072-bit MuHash discussed on https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-May/014337.html as a replacement for the hash_serialized field in
gettxoutsetinfo
.This is an order-independent hash, allowing it to be computed either by iterating over the UTXO set in non-sorted order. It also supports incremental addition and deletion of entries from the hash, allowing it to be updated on the fly for each block. Neither of these approaches is currently implemented.