1// Copyright (c) 2016-2017 The btcsuite developers
2// Copyright (c) 2016-2017 The Lightning Network Developers
3// Use of this source code is governed by an ISC
4// license that can be found in the LICENSE file.
5
6/*
7Package gcs provides an API for building and using a Golomb-coded set filter.
8
9Golomb-Coded Set
10
11A Golomb-coded set is a probabilistic data structure used similarly to a Bloom
12filter. A filter uses constant-size overhead plus on average n+2 bits per
13item added to the filter, where 2^-n is the desired false positive (collision)
14probability.
15
16GCS use in Bitcoin
17
18GCS filters are a proposed mechanism for storing and transmitting per-block
19filters in Bitcoin. The usage is intended to be the inverse of Bloom filters:
20a full node would send an SPV node the GCS filter for a block, which the SPV
21node would check against its list of relevant items. The suggested collision
22probability for Bitcoin use is 2^-20.
23*/
24package gcs
25