~ushin/trust.el

Explore trust relationships as a graph
Change (example-alice-trust): Vertically split colors
Remove (README.md): Remove reference to dot-to-ascii

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~ushin/trust.el
read/write
git@git.sr.ht:~ushin/trust.el

You can also use your local clone with git send-email.

#trust.el - Explore trust relationships as a graph

This idea was prototyped in u4u. (source) (video demo)

Given a series of trust relationships between peers like

{
  "alice": {
    "source": {
      "weights": {
        "bob": 1
      },
      "blocked": []
    },
    "blocker": {
      "weights": {
        "carol": 1
      }
    }
  },
  "bob": {
    "source": {
      "weights": {
        "doug": 1,
        "mallory": 0.5
      },
      "blocked": []
    },
    "blocker": {}
  },
  "carol": {
    "source": {
      "weights": {},
      "blocked": ["mallory"]
    },
    "blocker": {}
  }
}

Here are two ways to render the graph of trust relationships (as PNG or ASCII):

#graphviz/dot (PNG output)

graphviz can be installed from the Debian repo as graphviz. Given this input:

digraph {
 "alice" [style=filled, fillcolor="green;0.5:blue"];
 "bob" [style=filled, fillcolor="green"];
 "carol" [style=filled, fillcolor="blue"];
 "doug" [style=filled, fillcolor="green"];
 "mallory" [style=filled, fillcolor="red"];
 alice -> bob [ label="source: 1", color="green" ];
 bob -> doug [ label="source: 1", color="green"];
 bob -> mallory [ label="source: 0.5", color="green", arrowsize="0.5"];
 alice -> carol [ label="blocker: 1", color="blue"];
 carol -> mallory [ label="blocked", color="red"];
}

dot -Tpng example-alice-trust.dot > example-alice-trust.png will produce this output:

example-alice-trust.png

#graph-easy (ASCII output)

graph-easy can be installed from the Debian repo as libgraph-easy-perl. Given this input:

[ Alice ] -- source --> [ Bob ]
[ Bob ] -- source --> [ Doug ]
[ Bob ] -- source --> [ Mallory ]
[ Alice ] -- blocker --> [ Carol ]
[ Carol ] -- block --> [ Mallory ]

graph-easy example-alice-trust.grapheasy will produce this output:

+----------+  source   +---------+  source   +------+
|  Alice   | --------> |   Bob   | --------> | Doug |
+----------+           +---------+           +------+
  |                      |
  | blocker              | source
  v                      v
+----------+  block    +---------+
|  Carol   | --------> | Mallory |
+----------+           +---------+

We can then post-process the graph to, e.g., add color and make nodes clickable.

#Usage

We also should add an easy way to change the parameters which output the graph (max hops for source, blockers, minimum trust weight for source, blockers). This way, trust.el will narrow a potentially large dataset into a small, understandable graph containing only the peers we're interested in.

We'll also want to add trust categories/topics so that peers can assign different trust weights to one another per topic.

#Inspiration

This idea is largely inspired by Alex Cobleigh's TrustNet.

#Prior Art

The ushin team implemented the same basic idea as part of u4u.

#Bugs and Patches

Bugs can be submitted to the ushin issue tracker. Patches, comments or questions can be submitted to the ushin public inbox.