# Pinscope replaces TLS with Noise_NK on ESP32, cutting RAM use from 23.6 KB to 9.4 KB

> **Key takeaway:** A single-server ESP32 maintenance link can use the Noise_NK_25519_ChaChaPoly_SHA256 handshake instead of TLS, dropping persistent RAM from 23.6 KB to 9.4 KB while keeping server authentication, encrypted credentials and replay protection.

**Published:** 2026-11-28T00:00:09+00:00 
**Source:** Hackaday Hardware 
**Category:** open-hardware 
**Canonical URL:** https://fosswire.org/news/pinscope-replaces-tls-with-noisenk-on-esp32-cutting-ram-use 

## Summary
The Pinscope team needed an ESP32 to hold a secure connection to a maintenance server, but the chip did not have enough spare RAM to run TLS alongside the rest of the firmware. Rather than drop security, they narrowed the requirement: the device only ever talks to one known server, so it needs to confirm the server's identity, send credentials encrypted, and prevent messages from being read, replayed, reordered or modified in transit. Their answer is the Noise protocol, specifically the Noise_NK_25519_ChaChaPoly_SHA256 pattern, in which the server holds a static key that the device is provisioned with in advance.

Because only the holder of the server's private key can complete the handshake, the ESP32 can authenticate the far end without certificates or a general-purpose TLS stack. The measured handshake completes in about 0.3 seconds on the ESP32 and exchanges roughly 100 bytes over the wire. The memory comparison is the headline result: 23.6 KB of RAM to stay connected with TLS versus 9.4 KB with Noise. The project files are published on GitHub for others facing the same constraint.

## How Noise_NK fits an ESP32 maintenance link
- **Protocol pattern:** Noise_NK_25519_ChaChaPoly_SHA256 is a Noise pattern where the responder (server) has a static key pair known in advance to the initiator (ESP32), so the device authenticates the server during the handshake rather than relying on an X.509 certificate chain.
- **Memory footprint:** The persistent connection cost falls from 23.6 KB of RAM with TLS to 9.4 KB with Noise, which is the difference between fitting the maintenance link in the remaining ESP32 headroom and not.
- **Handshake cost:** The full handshake takes about 0.3 seconds on the ESP32 and sends roughly 100 bytes over the wire, keeping both CPU time and radio airtime small for a device that connects only occasionally.
- **Security properties retained:** The design still requires that the device verify it is talking to the genuine server, that credentials travel encrypted, and that in-transit messages cannot be replayed, read, reordered or altered.
- **Scope trade-off:** The team explicitly did not need TLS's general client-to-any-server functionality, which is what makes a fixed-server Noise pattern a reasonable substitute on a RAM-constrained MCU.

## Why it matters
ESP32-class devices are routinely asked to do TLS on top of application work, and the RAM bill for a full TLS session is a recurring reason projects weaken or skip transport security. A documented, open-source Noise_NK implementation with measured RAM and handshake numbers gives embedded developers a concrete alternative for fixed-server telemetry and maintenance channels. It also reinforces a broader pattern in embedded security: matching the protocol to the actual trust model instead of defaulting to a general-purpose stack the hardware can barely carry.