With higher penetration of Whatsapp among smartphone users; many financial services entities have started offering transactions on WhatsApp as a platform.
Even WhatsApp could independently start payment services soon in India. (Source: First Post: https://www.firstpost.com/tech/news-analysis/whatsapps-payment-service-could-reportedly-debut-very-soon-in-the-country-7009961.html)
The question then is; how safe it is to transact or invest while you chat on WhatsApp?
To demystify the same, in this blog will try to understand following: 1) How WhatsApp actually works?2) Analyze how a chat on WhatsApp is actually executed into a transaction or investment?3) And finally try to draw a conclusion whether it is SAFE for financial transaction or NOT.
How WhatsApp chat works?
The image below explains the WhatsApp technical architecture:

Source: https://codetiburon.com/create-chat-app-like-whatsapp/
Never thought that so much is happening in background while you chat on WhatsApp. So let’s understand the important elements of WhatsApp:
1) XMPP: (eXtensible Messaging and Presence Protocol): It is a protocol that handles a message delivery system. It helps in streaming and exchange of message or presence information in a close network on real time basis. In a simple word it is the coding language which help in transfer of information in real time in messaging application.
Another important aspect of XMPP is that it has a decentralized architecture, which means that it does not follows client to client communication, rather it follows client-server architecture. Which means when you type a message on WhatsApp on your mobile it hits the server and then the receiver.
For every Mobile number there is ID which is created in the XMPP server which identifies the sender and receiver and hence messages are delivered with server being the intermediately. Though WhatsApp has end-to-end encryption.
2) Memory Storage: Now since WhatsApp platform follows client-server-client communication model; there is requirement to store data both at client as well as server level.
a. Client Side Memory Storage (Local SQLliteDB): Which is your Mobile phone memory space. Which stores all the message which your mobile phone receives or sends to other users. And the same is stored locally on your mobiles phone hardware.
b. Server Side Memory Storage: To understand the messages storage process on the servers, we will have to understand various situations in which the message is delivered to the users.
There are various servers which are assigned tasks basis the situation the user and type of message. Let’s understand the same:
i. Custom ejabberd server cluster: These are set of server compatible with XMPP and are dynamically managed for bandwidth allocations; which means in case of heavy traffic the bandwidth is increased. And since they are custom programmed by the publisher they are managed dynamically for delivery of message. In case of WhatsAPPMnesia DB Cluster helps in managing the same dynamically.
ii. YAWS (Yet Another Web Server): It is part WhatsApp digital infrastructure which is responsible to handling Media files.
3) How it works: With above digital structure of WhatsApp from inside, lets understand how it actually works.
When a mobile is connected to WhatsApp, it is connected as a client with the server of WhatsApp; which then assigns a unique ID to the client and same is used to identify the client for all communication and file delivery.
When a client starts a communication or an activity a process or thread is initiated for the respective client id.

When a client connects to the WhatsApp server, a process (or thread) is created with respect to that client. This process is responsible for handling all the operations related to that client.4) With every process, a queue(Highlighted with light green colour) is associated which act as a buffer for that process. After process creation, a table is created in the database to maintain the record of PID(Process ID) and the associated Client.5) How Last Seen Work?6) Implementation of this feature is very simple and straightforward, It is just about maintaining a record with Client ID and Timestamp.7) 8)

9) A table containing client id and their last seen status10) When we open Whatsapp in our smartphone, our application sends a pulse to server every 5 seconds, and with every pulse last seen time is updated in the table. As the client disconnects the last seen time exists in the record that is updated by the last pulse sent before closing the app.11) How the media sharing works?12) For sharing, we don’t use the connection which is used for sending text messages because it is a very lightweight connection and it cannot handle this much load.13) Instead, WhatsApp uses a different server(like HTTP) to share media.14) 15)

16) System design with HTTP Server17) When we share a media, it gets uploaded to an HTTP Server over a different connection, after successful upload, the HTTP server returns a hash or unique ID associated to that media and that hash value is sent to the WhatsApp server. At the receiver end, the same thing works in a reverse way, the receiver receives the hash value then it downloads the media from HTTP server associated to that hash value.18) The Telephony services also work in the same way just like media services, for this, we also use a different server and use a different kind of connection like socket etc. for real-time communication.19) https://medium.com/codingurukul/whatsapp-engineering-inside-2-bdd1ec354748
There are two ways of storing messages – you can keep them on servers forever or you can delete them as soon as delivered to be stored locally (which WhatsApp does by using SQLite database). In that case, the messages temporarily ‘queue’ on servers till the recipient comes online. When a message is delivered, the queue is deleted. The same way, the acknowledgements of the messages being sent, delivered, or read will be queued on servers in the form of a particular message ID. Thus, ‘queue health’ (keeping few messages in queues) is an important metric. Whenever the traffic spikes (like at the time of football matches or earthquakes), additional servers are used to tackle the load.
WhatsApp stores multimedia files on YAWS (Yet another web server).
Mnesia