Awesome
gcs - Golomb compressed set
Library for creating and querying Golomb Compressed Sets (GCS), a statistical compressed data-structure. The idea behind this implementation is using it in a new kind of Bitcoin light client, similar to SPV clients, that uses GCS instead of bloom filters.
This projects is based on the original BIP (Bitcoin Improvement Proposal) and the Olaoluwa Osuntokun's reference implementation
Privacy considerations
Using client-side filters (GCS) instead of server-side filter for a cryptocurrency light wallet improves the user privacy given that servers cannot infer (at least no so easily) the transactions in which he is interestd on. This project will be used as part of the privacy-oriented HiddenWallet Bitcoin wallet project.
How to use it
var cities = new[] { "New York", "Amsterdam", "Paris", "Buenos Aires", "La Habana" }
var citiesAsByteArrar = from city in cities select Encoding.ASCII.GetBytes(city);
// A random key
var key = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
// The false possitive rate (FPR) is calculated as:
// FPR = 1/(2**P)
var P = 16
var filter = Filter.Build(key, P, citiesAsByteArrar);
// The filter should match all ther values that were added
foreach(var name in names)
{
Assert.IsTrue(filter.Match(name, key));
}
// The filter should NOT match any extra value
Assert.IsFalse(filter.Match(Encoding.ASCII.GetBytes("Porto Alegre"), key));
Assert.IsFalse(filter.Match(Encoding.ASCII.GetBytes("Madrid"), key));
Support
Contributions Spent On
186n7me3QKajQZJnUsVsezVhVrSwyFCCZ
Building From Source Code
Requirements:
Step By Step
git clone https://github.com/lontivero/gcs.git
cd gcs
dotnet restore
dotnet build -c Release -r win-x64
. Depending on your platform replacewin-x64
withwin-x86
,linux-x64
orosx-x64
.
Running The Tests
cd tests
dotnet restore
dotnet build
dotnet test