| Crates.io | berblom |
| lib.rs | berblom |
| version | 0.1.0 |
| created_at | 2026-01-07 13:11:18.270384+00 |
| updated_at | 2026-01-07 13:11:18.270384+00 |
| description | A novel web-of-trust algorithm for trust calculation. |
| homepage | https://codeberg.org/Nukesor/berblom |
| repository | https://codeberg.org/Nukesor/berblom |
| max_upload_size | |
| id | 2028241 |
| size | 4,706,714 |
In a Web-of-Trust (WoT) network, trust relationships are modeled as a directed graph. OpenPGP certificates act as nodes, and delegations of trust are represented by weighted edges. Each delegation can be limited by both a trust amount and a trust depth, reflecting how much trust is forwarded and how many steps it may propagate. Finally, certification edges model connections between certificates and identities (we refer to these connections as "bindings"). The challenge is to determine the maximum trust that can be established between a set of trust anchors and a target binding, whilst considering all constraints imposed by the network's structure and its delegation rules.
Unlike simple path-finding, trust computation in a WoT must account for multiple paths that may overlap or steal each other's trust capacities. Some methodology of backtracking must be utilized to prevent such issues.
This project implements a flow computation algorithm for WoT networks, building on the abstractions provided by the wot-network crate.
It provides a library for analyzing trust graphs, computing maximum trust, with the capability to visualizing the process step-by-step (to a certain degree).
Documentation for the underlying types and interfaces is available at docs.rs/wot-network.
The main algorithm is a modified Ford-Fulkerson, adapted for multi-source, single-sink graphs with additional constraints:
A detailed description of the algorithm can be found in the documentation files:
Path finding: The inner algorithm that finds individual paths in a (residual) WoT network.
Flow Computation: The outer algorithm that finds maximum flow by combining multiple Path finding runs and adjusting the residual network.
Path consolidation: The post-processing step that normalizes the raw output of Flow Computation into a set of valid forward-paths in the original WoT network graph.
The implementation also has extensive inline documentation.
The binary provided in src/bin/run_test.rs can be used to run predefined test cases and visualize the flow computation process.
You may build it via cargo build --release, which will put the test binary at target/release/run_test
The output is a markdown file containing mermaid diagrams and additional information for each step of the algorithm, including the path consolidation.
To run a test case and generate a visualization:
cargo build --features=test --release
target/release/run_test <case> --output ./search_output.md
Replace <case> with one of the available test cases (see run_test --help for all available options).
Two checked-in examples of such a visualization are available as: