/* PoC for secure and encrypted messaging via Twetch protoc…
/* PoC for secure and encrypted messaging via Twetch protocol.
Motivation:
Users wish to send messages to one or more of their followers, only.
Users wish to send messages to one or more of their followers, and require a fee to decrypt the message.
Users wish to send messages to one or more of their followers, and decrypt the message at a set time, and optionally encrypt and remove local plaintext after a set interval.
Users wish to compose the combinations of the above wishes together in one script for one or more messages in a set of messages, for a set of followers and optionally a set of non-followers.
Concepts to prove:
A Twetch user BOB may send an encrypted message which is may only be decrypted by a chosen set of followers drawn from BOB's set of followers.
That is, BOB wants to send a message to a sub-set of his followers, which may be 1 or more of his followers, or he may send a message to the entire set of followers.
1. BOB requests a filtered set of his followers by using a bitquery and using the twetch api or timememe bitbus, or by running his own full node or custom neon planaria node.
2. Twetch's API has room for the user to have a description on the account - a PGP key fingerprint could be stored there, or a field added if required, or if there is reserved space for it,
such that when you retreive a list of the sub(followers) you want to send to, you are able to retrieve the PGP key fingerprints for those followers.
Followers without a PGP key
3. Generate a key pair representing the sub(followers) - it is the keys used for this instance of this sub(followers), and every follower drawn
from the set of sub(followers) which would be represented in C# with the generic type:
Maybe<ISet<Follower>> (0 - many)
var q = bitquery.filter;
var s = subscription(followers.filter(q));
var sPK = followers.map(follower as Enciphered<F>) => reduce(filter(f))), subset =>
(message, fPKs) => (message.encipher(sPK, cipher, fK).encipher.(privKey)) -> (followerKey.P