I’m trying to mint an NFT using Hedera Token Service (HTS) but I keep getting an INVALID_SIGNATURE error. I’ve been following the official documentation but something seems wrong with how I’m creating the signature.
I’m using the standard approach to generate the signature but it’s not working. Has anyone else encountered this issue when working with HTS for NFT creation? I need to figure out what I’m missing in the signature process.
The error happens specifically during the token creation step. I’ve double-checked my private keys and account setup but still getting the same validation error. Any help would be appreciated.
omg, I totally got that error too! it was my treasury acc too. make sure to use the treasury private key when signing. if you mix it up with another acc like the fee payer, it won’t work. HTS can be super picky, man.
Had this exact problem last month with HTS integration. Wasn’t the private key - it was transaction serialization order that got me.
Here’s what fixed it: set the transaction ID before signing. I was generating the ID after creating the signature, which made validation fail every time. The signature needs the complete transaction, including the properly formatted transaction ID.
Also check your account ID format. I used the wrong format for the treasury account ID and kept getting signature validation errors even though the crypto signature was fine. Use the full format like 0.0.12345, not just the account number.
Double check your environment too. Spent hours debugging signatures when my keys were for testnet but I was hitting mainnet endpoints by mistake.
Oh man, I’ve been down this rabbit hole before! The INVALID_SIGNATURE thing with HTS is super frustrating.
You mention it happens during token creation - are you signing with the account that has proper permissions? Sometimes it’s not the signature itself but which account is doing the signing.
Also, are you using the JavaScript SDK or something else? When you say “standard approach” for the signature, are you freezing the transaction before signing? I forgot that step once and it drove me crazy for hours lol.
One more thing - is your private key format correct? Are you using the raw private key or DER encoded version? HTS can be picky about that.
What does your transaction setup look like? Might help if you share some code structure (without the actual keys). The devil’s usually in the details with these signature errors.