py-algorand-sdk ValueError: "The seed must be exactly 32 bytes long"
Short answer: The key decoded to the wrong number of bytes.
The exact message
ValueError: The seed must be exactly 32 bytes long
Source: captured locally with py-algorand-sdk 2.12.0 on 2026-12-03.
Why it happens
Captured with .sign(b"1234"): the four bytes were accepted as base64 text and then the decoded seed was far too short.
How to fix it
- Use the base64 private key string from the SDK; do not pass a public key, an address or a hex string.
Wording can change between SDK versions. All Python SDK errors · errors.json · JavaScript SDK errors · API errors · node errors