Skip to content

Instantly share code, notes, and snippets.

@RazorBest
RazorBest / der_encoding.md
Created March 16, 2026 11:16
DER encoding

DER encoding

Why does DER enforce minimal encoding rules? How did non-strict DER encoding historically cause problems in Bitcoin?

Quick answer: DER does not allow multiple encodings for the same data

To understand DER, we need to know about BER. And to understand BER we first need to talk about ASN.1. Let's encrypt has written a good article about all of these, and this MD that you're reading will be based on that: https://letsencrypt.org/docs/a-warm-welcome-to-asn1-and-der/.

ASN.1

@RazorBest
RazorBest / point_at_infinity.md
Last active March 9, 2026 10:54
The point at infinity in elliptic curves

The point at infinity in elliptic curves

Prerequisites:

  • The properties of a group
  • Elliptic curve point addition

An elliptic curve is a group. Its elements are closed under point addition.

Check addition: https://www.desmos.com/calculator/ialhd71we3