Nexus

algosdk "bad secret key size" when signing

Short answer: signTxn was given something that is not a full 64-byte secret key.

The exact message

bad secret key size

Source: Error, captured locally with algosdk 3.9.0 on 2026-12-03.

Why it happens

The capture signed with a 10-byte array and got "bad secret key size". Accounts from generateAccount() and mnemonicToSecretKey() expose a 64-byte sk.

How to fix it

Wording can change between SDK versions. All SDK errors · errors.json · node errors · x402 errors.