Whisper is another of the native services built into the PUFFScoin EVM web3 stack. It operates as a blockchain resident messaging system, intrinsically designed for dApps to communicate with one another. Topics and messages can be broadcast across the network, either anonymously or clearly signed, which can most easily be represented as a blockchain-hosted Twitter-like dApp. Whisper can be used for group messaging or subscription based announcements.
Encrypted signed messages, similar to a secure e-mail server – or encrypted anonymous messaging analogous to an innominate dropbox. At its most secure mode of operation, Whisper can theoretically deliver 100% darkness, yet allows users to configure the level of privacy they wish to send or receive data with as a trade-off for performance and speed of delivery. In order to prevent a DDoS attack, an internal proof-of-work (PoW) algorithm is used by the contract itself.
Every Whisper message must be encrypted either symmetrically or asymmetrically, which can then be decrypted by anyone who possesses the corresponding key (Asymmetric encryption uses the standard Elliptic Curve Integrated Encryption Scheme with a SECP-256k1 public key. Symmetric encryption uses the AES GCM algorithm with a random 96-bit nonce.)
Messages are sent as packets called Envelopes, which contain the encrypted payload. Nodes providing Whisper throughputs have no knowledge regarding the content of envelopes to which they do not have the encryption key. Whisper messaging uses a Proof of Work calculation to prevent spam messaging, which will reduce network stress.
The cost of PoW computation in Whisper may be considered the price for network resource allocation required to store a message for a set amount of time. This Proof of Work requirement will be proportionate to message size and storage time.
Whisper Nodes will send and receive Envelopes continuously. When their envelope memory exhausts, they may prune messages from their queue (expired envelopes, those with an implied future insertion date). They will maintain node maps to efficiently deliver messages to the front-end API.
CREATING AND SENDING MESSAGES THROUGH WHISPER
Users will compose an Envelope with a basic payload which is done in a few steps:
*Compose the Envelope data by concatenating the relevant flag byte, padding, payload (randomly generated or provided by the user), and an optional signature.
*Encrypt the data symmetrically or asymmetrically.
*Add a Topic.
*Set the TTL attribute.
*Set the expiry as the present Unix time plus TTL.
*Set the nonce which provides the best PoW.
To send a message, the node will place the Envelope its envelope pool. This envelope will then be forwarded to peers in due course along with the other envelopes.
Whisper on the PUFFScoin network will be utilized to provide native on-chain decentralized services much like one would expect from traditional third-party services on the Internet. The most obvious and earliest implementations will be the PUFFSMail Server and peer-to-peer chat applications.
The PUFFSMail Server will store messages, resending them at the request of known nodes, engaging in peer-to-peer communication with the recipient node, sending stored or expired messages directly. USers will call the “mailRequestCode” function to request messages from the PUFFSmail server, and “p2pCode” for direct peer-to-peer messaging. These functions will bypass the expiry and PoW threshold protocol-level checks through Whisper.
Group Chats can be initiated, on-chain, using symmetric encryption and a shared password, with one of the nodes started with a “standalone” flag to which the other users may connect.