Bijou64: A variable-length integer encoding

TL;DR

Bijou64 is a new variable-length integer encoding designed for the Subduction CRDT protocol. It ensures unique representation of integers, improving both performance and security. The development addresses issues with existing encodings like LEB128, especially in adversarial contexts.

Developers of the Subduction CRDT protocol have introduced Bijou64, a new variable-length integer encoding that guarantees a single, canonical representation for each integer, enhancing both security and efficiency.

Bijou64 was created to address a subtle bug related to signature verification in the Subduction CRDT protocol. Unlike common varint formats like LEB128, Bijou64 ensures that each integer has only one valid encoding, eliminating the risk of adversarially crafted byte sequences that could cause signature mismatches or security vulnerabilities.

The encoding works by using a first byte that either directly encodes small numbers (0-247) or acts as a tag indicating how many subsequent bytes are needed to represent larger numbers. This structure allows for predictable, constant-time decoding and removes the need for additional canonicality checks.

Preliminary benchmarks indicate that Bijou64 performs several times faster than LEB128, primarily because it does less work during decoding, thanks to its structured approach and immediate knowledge of the number of bytes involved.

Why It Matters

Bijou64’s design enhances security by preventing multiple representations of the same number, a known vulnerability in formats like LEB128 that can be exploited in cryptographic or signature verification scenarios. Its efficiency also benefits protocols requiring fast, compact integer encoding, potentially influencing future implementations in distributed systems and cryptography.

Amazon

variable-length integer encoding tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

Variable-length integer encodings are common in binary protocols to save space, especially when small numbers are frequent. LEB128 is a widely used format but suffers from non-canonical representations, which can lead to security issues. Bijou64 was developed as part of ongoing efforts to improve protocol robustness and performance, motivated by the needs of the Subduction CRDT synchronization protocol.

The problem with LEB128 and similar formats is their allowance for multiple encodings of the same number, which complicates security and deduplication. Previous attacks and vulnerabilities in cryptographic protocols have exploited this non-canonicality, prompting the development of Bijou64.

“Bijou64 guarantees a single, canonical encoding for every integer, removing a class of security vulnerabilities while also improving decoding speed.”

— Lead developer of Bijou64

“Eliminating non-canonical representations helps prevent certain signature forgery attacks and simplifies protocol validation.”

— Cryptography researcher

Cryptography For Dummies

Cryptography For Dummies

Used Book in Good Condition

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

It is not yet clear how widely Bijou64 will be adopted outside the Subduction protocol or how it compares in large-scale real-world deployments. Further benchmarking and security analysis are ongoing.

Amazon

binary protocol encoding hardware

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

Developers plan to publish detailed specifications and open-source implementations of Bijou64. Additional testing and peer review are expected in the coming months, with potential integration into other protocols requiring secure, efficient varint encoding.

Amazon

efficient data serialization tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

How does Bijou64 differ from LEB128?

Bijou64 enforces a single, canonical representation for each integer by using a structured encoding with a tag and offset scheme, unlike LEB128, which allows multiple encodings for the same number.

Why is canonical encoding important?

Canonical encoding prevents multiple representations of the same number, which is crucial for security, signature verification, and deduplication in protocols.

Is Bijou64 faster than existing varint formats?

Initial benchmarks suggest Bijou64 is several times faster than LEB128 due to its simpler, more predictable decoding process.

Can Bijou64 be used in other protocols?

While designed for the Subduction CRDT protocol, Bijou64’s principles could be adapted for other systems requiring secure, efficient varint encoding, pending further testing and validation.

Source: Hacker News

You May Also Like

Anthropic’s projected valuation has already reached an astonishing $1.4 trillion, and it might even surpass SpaceX to become the biggest IPO. This is way too exaggerated! I support OpenAI—now OpenAI’s the cheap one.

Anthropic’s projected valuation has reached $1.4 trillion, possibly surpassing SpaceX to become the biggest IPO, raising questions about its future market impact.

Quiet GPUs for Local AI: Acoustic and Thermal Roundup

Thorsten Meyer AI’s 2026 roundup ranks local AI GPUs by VRAM, heat, noise, cooler design and power limits.

Undervolting Your GPU for Local Inference: Lower Heat, Same Tokens/sec

Thorsten Meyer AI says power limits can cut GPU heat for local inference with small tokens/sec losses, based on RTX 4090 and RTX 5090 data.

How Generative AI Is Designing Next‑Gen Protocols

Generative AI is transforming protocol design by enabling innovative, efficient solutions—discover how this technology is shaping the future of reliable systems.