Oddbean new post about | logout
 How does one implement this? 
 Table 1:  Followings  --    key = publickey,  value = Vec<PublicKey>   (this is computed from their kind-3 record, smaller than the event itself).
Table 2:  WOT -- key = public key, value = WoT score   (this is maintained as described below)

Subscribe to kind-3 events of people you follow (periodically, probably once a day is enough).
Whenever a kind-3 event comes in, convert it to a Vec<PublicKey> (but don't store into Followings just yet).
Compute symmetric differences between the old and new followings (perhaps using a HashSet to do it).
Start Transaction
For all the people they were following but no longer, decrement that WoT score in table 2.
For all the people they weren't following but now are, increment that WoT score in table 2.
Now replace their Followings table entry.
End Transaction 
 Also you need a rebuild_wot system that clears the WoT Table and Followings table, and iterates through all the ContactList events to build it from scratch.  Then you need to do that once to kickstart the data.