Nexus

TEAL compile error: "byte encoding/hex: odd length hex string"

Short answer: A byte 0x... literal has an odd number of hex digits. Each byte needs two.

The exact message

1 error: 2:5: byte encoding/hex: odd length hex string

Source: POST /v2/teal/compile, HTTP 400, captured against a public TestNet node on 2026-12-03.

Why it happens

Captured with byte 0xABC (three digits). The message includes line and column.

How to fix it

Wording can change between node versions. All API errors · errors.json · transaction errors · SDK errors · costs