Internet-Draft zstdict October 2026
Lindqvist Expires 23 April 2027 [Page]
Workgroup:
HTTP
Internet-Draft:
draft-lindqvist-zstdict-01
Published:
Intended Status:
Informational
Expires:
Author:
P. Lindqvist
Independent

Zstandard Dictionary Content-Encoding

Abstract

This document defines a new HTTP content coding, "zstdict", which enables Zstandard compression with a pre-shared dictionary. The dictionary is identified by a SHA-256 hash and negotiated via the Content-Dict response header.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on 23 April 2027.

▲

Table of Contents

1. Introduction

Zstandard [RFC8878] is a compression algorithm that supports dictionaries for improved compression of small payloads. This document defines a new HTTP content coding, "zstdict", to signal Zstandard compression with a pre-shared dictionary.

The dictionary is identified by its SHA-256 hash. Clients MUST verify the hash before decoding.

2. The "zstdict" Content Coding

The "zstdict" content coding is identical to "zstd" [RFC8878], except that a dictionary is used for both compression and decompression.

A response using "zstdict" MUST include a Content-Dict header containing the SHA-256 hash of the dictionary, in lowercase hex.

Example:

  Content-Encoding: zstdict
  Content-Dict: sha256-89ff6702e9d396f01bdf8865451521d2ba23efce9c5968c784b85744d6e55faf

3. The Content-Dict Header

The Content-Dict header identifies the dictionary used for compression. Its value is a hash algorithm identifier followed by the hex-encoded hash.

  Content-Dict = "sha256-" 64HEXDIG

4. Dictionary Distribution

The dictionary MUST be available to the client before decoding. Three distribution mechanisms are defined:

4.1. Well-Known URI

Servers MAY publish dictionaries at:

  /.well-known/zstdict/<hash>

where <hash> is the SHA-256 hash from Content-Dict. Clients MAY fetch this URI on first encounter and cache it.

4.2. Application-Bundled

Clients MAY ship dictionaries with the application. In this case, the Content-Dict header is informational and the client uses the bundled dictionary matching the hash.

5. Security Considerations

Dictionary deserialization is a known attack vector. Clients MUST validate the dictionary hash before use. Malicious dictionaries can cause denial of service. Implementations MUST limit the maximum size of accepted dictionaries.

6. IANA Considerations

This document registers "zstdict" in the HTTP Content Coding Registry.

Name:
zstdict
Description:
Zstandard compression with pre-shared dictionary
Reference:
this document

7. Normative References

[RFC8878]
Collet, Y. and M. Kucherawy, "Zstandard Compression and the 'application/zstd' Media Type", RFC 8878, , <https://www.rfc-editor.org/rfc/rfc8878>.

Author's Address

Peter Lindqvist
Independent
Stockholm
Sweden