Skip to main content

What is FHE?

Fully Homomorphic Encryption (FHE) is a breakthrough in cryptography that allows computations on encrypted data without ever decrypting it.
blockmsg uses Zama’s fhEVM to bring FHE to the blockchain.

The Encryption Process

1

Message Chunking

Your message is split into 32-bit segments in your browser
2

FHE Encryption

Each chunk is encrypted using TFHE.asEuint32 - plaintext never leaves your device
3

On-Chain Storage

Encrypted handles are stored on the Zama fhEVM blockchain
4

Recipient Decryption

Recipient signs with wallet → re-encryption → local decryption

Smart Contract Architecture

The main contract handles:
  • Storing FHE-encrypted messages
  • Managing DM channels between wallets
  • Self-destruct timer logic
  • Access control for decryption
struct DirectMessage {
    address sender;
    uint256 timestamp;
    euint32[] encryptedContent;  // FHE encrypted
    uint256 expiresAt;
}

Self-Destructing Messages

Set a timer on your messages. Once expired, the smart contract returns an empty array - the message becomes permanently unreadable.
TimerUse Case
5 minutesQuick sensitive info
1 hourShort-term coordination
12 hoursDay-limited conversations
24 hoursDaily check-ins
7 daysWeekly updates
Self-destructed messages cannot be recovered by anyone - not even us.

Technical Stack

fhEVM by Zama

Fully Homomorphic Encryption virtual machine

Solidity

Smart contracts for encrypted message management

Next.js

Frontend application framework

fhevmjs

Client-side FHE encryption library