Short answer: signTxn was given something that is not a full 64-byte secret key.
bad secret key size
Source: Error, captured locally with algosdk 3.9.0 on 2026-12-03.
The capture signed with a 10-byte array and got "bad secret key size". Accounts from generateAccount() and mnemonicToSecretKey() expose a 64-byte sk.
account.sk to txn.signTxn(), not a seed, a hex string or a public key.Wording can change between SDK versions. All SDK errors · errors.json · node errors · x402 errors.