Wishoom is a platform that allows people to send messages to the universe. Yes, you read that right. It was initially conceived as a charity project that aims to bring people together by sending messages of hope, love, and peace to the universe. The messages are sent using a laser from a rural location in the Scotland and the photons emitted by the laser may travel mind-boggling distances into the vastness of our universe.
I have to admit, it is one of the more odd engineering works I’ve been involved with but a nice change from the AI hype that has been producing spaghetti code. When designing the system, we wanted the system to be able to handle:
- Security: Messages should be fully encrypted and hashed before transmission. These are private messages and should not be at any time decoded. How do we transmit the message if it is encrypted? We decided to never decode the message and actually transmit the encrypted bytes. Technically, the original message is never sent but the essence of the message is transmitted which was suitable for the goal of the project.
- Reliability: The system should be able to ensure the messages are durable until they are transmitted reliably. The lets-not-over-engineer starting point was to directly connect to the Raspberry Pi and serve transmission requests. We quickly realised that the robustness of the Raspberry Pi alone was not enough to handle increasing traffic or rural 4G connections. We decided to use NATS as a message broker to handle the transmission requests and the Raspberry Pi to handle the laser transmission. NATS Jetstream creates a durable replicated log of messages that can be used in a publish-subscribe model which suited our needs.
- Scalability: Each message requires a reasonable time (couple of seconds for longer messages) to transmit and ensure sufficient number of photons are emitted that would escape the atmosphere. This easily started to become a bottleneck as the number of messages increased. We decided to make sure the system was horizontally scalable by adding more transmission points and using NATS to handle the distribution of messages.
Here is the sequence diagram of the system architecture:
sequenceDiagram autonumber actor User participant App as Wishoom participant NATS participant Pi participant Laser User->>App: Original Message activate App App->>App: Encrypt with AES 256 & Hash with SHA256 App->>NATS: Publish Encrypted Message deactivate App activate NATS NATS->>Pi: Transmission Request deactivate NATS activate Pi Pi->>Laser: Morse Code activate Laser Laser->>Laser: Transmission Laser-->>Pi: Done deactivate Laser Pi->>NATS: Transmission Time deactivate Pi activate NATS NATS->>App: Update Record deactivate NATS activate App App->>App: Delete Encrypted Message deactivate App App-->>User: Update dashboard
When a user requests to transmit a message:
- The message is encrypted and hashed using AES 256 and SHA256 respectively. The hash is used to verify the integrity of the message prior to transmission. A random key is used to encrypt the message which is then never decoded.
- The transmission request is published to NATS which stores it in a durable replicated Jetstream log.
- An available transmission endpoint, e.g. a Raspberry Pi, picks up the message checking it’s integrity. The message is then converted to morse code and transmitted using a connected laser, usually 650nm wavelength (see below why).
- An acknowledgement is sent back to NATS which updates the record and deletes the message, recording only the transmission time.
- The user dashboard is updated with the transmission time and other relevant information.
Does the message actually leave the atmosphere?
That was definitely the main concern when we started the project and it is the most common question for Wishoom. The short answer based on our research is yes.
Absorption spectrum of the atmosphere
The atmosphere is mostly transparent to visible light. These regions of transparency are called optical windows. 650nm wavelength lasers are what we perceive as red light and it sits in the optical window of the atmosphere. This means that the photons emitted by the laser can mostly escape the atmosphere and travel into space even if some are scattered. The other alternative was to explore radio waves and we were in touch with some astronomy societies to explore that option. However, radio waves are not as focused as laser beams and require licensing to transmit while most radio observatories just listen to incoming signals.
People often think you can’t send a signal because you either need a really powerful laser or the photons would simply be scattered. This may be true if you want to receive the signal on the other end (e.g. Mars) but not for sending photons into space as a gesture to have your prayer, message or thought travel into the universe.
How many photons are emitted by the laser?
It’s not just the power of the laser but also the duration of the transmission that determine the number of photons emitted per unit time. So by adjusting the duration of the transmission, we can ensure enough photons are emitted. While some of which are scattered and absorbed, a significant number of them will travel into space. But how many?
We can start by calculating the energy of a single photon emitted by the laser. The energy of a photon is given by the equation:
$$ E = h \nu = h \frac{c}{\lambda} $$where $E$ is the energy of the photon, $h$ is the Planck constant, $\nu$ is the frequency of the photon, $c$ is the speed of light and $\lambda$ is the wavelength. The energy of the photon is directly proportional to the frequency of the photon or inversely proportional to the wavelength of the photon. We calculate the energy of a single photon emitted by a 650nm laser:
$$ \begin{align*} E &= (6.626 \times 10^{-34} \text{ J s}) \frac{3 \times 10^8 \text{ m/s}}{650 \times 10^{-9} \text{ m}} \\ E &\approx 3.06 \times 10^{-19} \text{ J} \end{align*} $$and assuming a very mediocre laser power of 5mW, we can calculate the number of photons emitted per second:
$$ \begin{align*} N &= \frac{P}{E} \\ N &= \frac{5 \times 10^{-3} \text{ J/s}}{3.06 \times 10^{-19} \text{ J/photon}} \\ N &\approx 1.63 \times 10^{16} \text{ photons/s} \end{align*} $$that is 16300000000000000 photons per second. So quite a lot of photons is the answer.
Conclusion
Wishoom was a fun project to work on and the idea definitely resonated with a lot of people. It is now a standalone platform that allows people to send 1 free message a day and you can purchase extra credits. What I liked about it was the simplicity of the idea and the engineering challenges it presented. We went from a simple Raspberry Pi based server to a durable message queue coordinating the front-end, back-end and edge devices. I hope you give it a try and send a message into space.