From bf64a12098691b7ba32444584300addfeec9f445 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 23 Sep 2026 14:31:54 +0200 Subject: [PATCH] bip138: clarify rejection of empty payloads Clarify that an empty payload contains zero content items. Add a vector that rejects a payload consisting only of the 0x00 terminator. --- bip-0138.md | 2 +- bip-0138/test_vectors/payload.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bip-0138.md b/bip-0138.md index d339bedf..2cefbe12 100644 --- a/bip-0138.md +++ b/bip-0138.md @@ -338,7 +338,7 @@ CHACHA20_POLY1305 (per RFC 8439) supports plaintext up to 2^38 - 64 bytes. Implementations MAY impose stricter limits based on platform constraints (e.g., limiting to 2^32 - 1 bytes on 32-bit architectures). -Implementations MUST reject empty payloads. +Implementations MUST reject empty payloads (i.e. zero content items). #### Ciphertext diff --git a/bip-0138/test_vectors/payload.json b/bip-0138/test_vectors/payload.json index 826c5145..90ee8f65 100644 --- a/bip-0138/test_vectors/payload.json +++ b/bip-0138/test_vectors/payload.json @@ -9,5 +9,10 @@ "content": "61" } ] + }, + { + "description": "Payload with no content item.", + "valid": false, + "payload": "00" } ]