How sen2 keeps your messages safe
A picture story for anyone who wants to know why only the right people can read a sen2 message, even though every message is written on a giant public wall for the whole world to see.
Meet our friends
Alice wants to write a message to Bob. The problem? She has to write it on a giant bulletin board in the middle of town. Everyone walking by, including Eve, can read whatever is on that board. So how can Alice send something only Bob can understand?
Everyone has two keys
In sen2, every person has two special keys that go together, like a matching pair.
🔓 The “Open Key”
You give this one to everybody. It's like a padlock you hand out so others can lock boxes for you. Computer name: public key.
🔑 The “Secret Key”
You keep this one hidden forever. Only you have it, the only thing that opens boxes locked with your padlock. Computer name: private key.
The magic paint trick
Alice and Bob need to agree on a shared secret color to lock their message with, but they can only talk through the public bulletin board. How?
Step 1: everyone starts with yellow paint
Step 2: Alice & Bob each pick a secret color (never shared)
Step 3: mix secret + yellow, then post the result publicly
Eve sees the orange and the teal on the board. She does not know either secret color.
Step 4: the magic mixing
They both end up with the exact same purple, their shared secret, without ever telling each other their secret colors. Mixing paint forward is easy; un-mixing it backward is basically impossible, so Eve can't make the purple.
In real sen2 the “colors” are huge numbers and the “mixing” is elliptic curve Diffie-Hellman. But the idea is exactly the paint trick.
What does the world see?
On the bulletin board (in sen2, the Solana blockchain) it looks roughly like this:
Alice sees
“Meet me at the slide at 3pm!”, she wrote it.
Bob sees
“Meet me at the slide at 3pm!”, he re-makes the purple secret and opens the box.
Eve sees
📦 xKZ8wQ4n+2bLpYr9oTjV3mFcGdHvNaSxBuEy7iWkPq1Z… (gibberish, no purple secret, no way in)
Why only Alice and Bob can read it
- Eve doesn't have the purple secret.To make it she'd need Alice's or Bob's secret color, and those never left their owners.
- Eve can't un-mix the paint.Pulling a secret color back out is so hard even the world's fastest computers can't.
- Eve can't fake a message.The tamper-sticker is also made from the purple secret; swap the contents and Bob's box refuses to open.
One thing to be careful about
🔑 Don't lose your secret key, and don't let anyone copy it.
Every message you've ever sent is on the public board forever, but it's locked with your secret key. If someone steals it, they could open every old message too. So sen2 keeps your secret key inside your computer's vault (Windows Credential Manager / macOS Keychain) and never sends it anywhere.