You're still signing data structures the wrong way

Dev brawl over “label your messages” fix: brilliant or just déjà vu

TLDR: A new proposal says to attach a unique label to every message so signatures can’t be misused on the wrong thing. Commenters split: some say this is old news with simpler fixes, others want labels baked in, and veterans joke it’s 1980s tech reborn—important because real systems have been burned by this mix‑up.

A new post says we’ve been signing data the wrong way and proposes a fix: bake a unique “label” into each message type so a signature can’t be reused on something else. Think of it like writing the dish name on a casserole—no more mixing up lasagna with dessert. The idea (from FOKS’s “Snowpack”) sparked a comment-section cage match.

Fans say it’s clean and hard to mess up. Skeptics rolled their eyes hard enough to power a data center. formerly_proven declared the problem solved ages ago: just sign the raw bytes and include secret context that never gets sent—classic best practice. Retr0id countered with a pragmatic take: forget fancy compilers, “put the type in the message itself” so everyone can see it. Meanwhile, tantalor dropped a practical “do it in protobuf options” recipe, and the old guard, led by Muromec, joked that we just reinvented 1980s tech like ASN.1 and should probably slap a version number on everything while we’re at it.

The stakes aren’t imaginary—mix-ups like this have burned projects from Bitcoin to TLS. One commenter even warned you can get a legit-looking email the sender never sent, proving why labeling matters. The vibe? Equal parts “finally,” “already solved,” and “lol we’re back to square one.”

Key Points

  • The article identifies two key requirements for secure cryptographic preprocessing: canonical encoding and domain separation.
  • A protobuf example shows how two different message types with identical field layouts can serialize identically, enabling signature misinterpretation attacks.
  • Such type-confusion attacks have real-world precedents in systems like Bitcoin, Ethereum DEXs, TLS, JWTs, and AWS.
  • Prior domain separation techniques are ad hoc (e.g., Solana method names, Ethereum best practices, TLS 1.3 context strings), motivating a systematic solution.
  • The proposed Snowpack approach embeds random, immutable 64-bit domain separators in the IDL; code generation and type systems (e.g., in Go/TypeScript) enforce prepending these IDs before signing, verifying, MAC’ing, hashing, or encrypting.

Hottest takes

"Putting domain separators in the IDL is interesting but you can also avoid the problem by putting the domain separators in-band" — Retr0id
"This article claims that these are somewhat open questions, but they're not and have not been for a long time." — formerly_proven
"So another lesson had been relearned from asn.1. I'm proud of working in this industry again!" — Muromec
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.