implementation of the fully decentralized anti-spam algorithm used in Freenet / Hyphanet, intended as fundament for testing adaptions and to use propagating trust with clearnet services

clone

read-only
https://hg.sr.ht/~arnebab/wispwot
read/write
ssh://hg@hg.sr.ht/~arnebab/wispwot
wispwot - generic implementation of the spam- and disruption defense of the WoT in Freenet / Hyphanet 
=====================================================================================================

This implements the defense from the Freenet / Hyphanet project against
disruption of communication. It is created to experiment with ways to
improve the scaling and performance.

For details on the goals,
see https://github.com/hyphanet/plugin-WebOfTrust/raw/master/developer-documentation/core-developers-manual/OadSFfF-version1.2-non-print-edition.pdf
and see https://www.draketo.de/english/freenet/deterministic-load-decentralized-spam-filter

See NEWS for user-visible changes.
See ChangeLog or the history for detailed changes.

## Usage

### As a REST service

Start the service.

    $ ./run-wispwot --server [--store path/to/folder] startfile-relative-path

Interact: See <HOWTO.org>

### As a subprocess

    $ ./run-wispwot --stdin [--store path/to/folder] startfile-relative-path

Interact as in <HOWTO.org>, but send requests to stdin of the
subprocess and read results from stdout.

Control via subprocess only supports csv-format for changing values.

### Direct usage

Get the trusted identities with their scores as seen from a given start identity:

$ wispwot <startfile>
<ID>,<score>
<ID>,<score>
…

As a simple example here in the repository:

$ ./run-wispwot trust/00/00
, => ONE,100

(more to come, see above for the plan)

## Install

$ ./bootstrap.sh && make install

To install only for the current user, use

$ ./bootstrap.sh --prefix=$HOME/.local && make install

Also see

$ make help

For details on installing a release, see INSTALL

### Build and run docker image

$ docker build . -f Dockerfile # note the IMAGE built
$ docker run -p 4280:4280 --name wispwot IMAGE

(build gives the IMAGE)

Access the service from http://127.0.0.1:4280/health

## Background

Wispwot operates on a minimal representation of trust between identities:
One file that maps index-values to arbitrary identifiers

    (index,identifier)

and for each index a directory/file entry named after the index
(first two numbers for the directory, rest for the file) that
maps index values of trustees to a trust value between -100 and 100

    (trustee-index,trust)

The core of the implementation is in wispwot/wispwot.w

Currently the maximum number of tracked IDs is hard-limited to 65536 
to allow tracking IDs as 16bit unsigned integers (for efficiency). 
More IDs can exist in the network, but such a high count is irrelevant 
for individual interactions. To lift this restriction, string-replace 
u16vector by u32vector in wispwot/wispwot.w.

Longterm-plan: Expose a REST-service with the following actions:
- PUT an ID with trust values (trust-value,trustee-ID).
- GET an ID to receive its index.
- GET an index to receive its score.
- GET a list of IDs to check for update of trust and/or content.
- PUT new trust values directly (truster-ID,trustee-ID,trust) for fine-grained trust-control.
- POST a list of IDs you requested without seeing a change.

PUT of changed IDs and POST of lists of unchanged IDs drive the state
of the WoT.


## Deviations from the WoT in Freenet / Hyphanet

Wispwot implements a battle-tested WoT as described in [the thesis on the WoT](https://github.com/freenet/plugin-WebOfTrust/blob/next/developer-documentation/core-developers-manual/OadSFfF-version1.2-non-print-edition.pdf), except for some adjustments:

- Trust flows strictly along the ranks: trust by children to parents
  is ignored to prevent ids from causing closer ids (including their
  own ancestors) to get distrusted.
- Trust from rank 3+ identities (low ranks) gets pruned infrequently
  to ensure bounded resource consumption and avoid too simple attacks
  by taking over many old IDs (like using the names of long-deleted
  accounts).

## Contributors

See AUTHORS

Licensed under GPLv3 or later.

(this is the default of conf. To use a different license, replace
COPYING and the header in the main code file)

## Release Process

* Check/Update NEWS
* Increase version in configure.ac (see semver.org)
* Commit, merge to stable and tag (see branching[1])
$ ./bootstrap.sh && make distcheck

[1]: See do a release in
     http://www.draketo.de/branching-strategy#action-maintainer

------

Built on Setting up a GNU Guile project with Autotools by Erik Edrosa:
https://erikedrosa.com/2017/10/29/guile-projects-with-autotools.html