Error: Signature Issue When Creating NFT on Hedera

I’m having trouble creating an NFT using Hedera Token Service (HTS). When I try to create the NFT, I keep getting an ‘INVALID_SIGNATURE’ error. I’ve been following the documentation, but something’s not working right.

Here’s what I’ve done so far:

  1. Set up my Hedera account
  2. Tried to create the NFT using HTS
  3. Got stuck with the signature creation

Has anyone else run into this problem? I’m not sure if I’m missing a step or if there’s an issue with my code. Any help or tips would be really appreciated. I’m new to working with Hedera and NFTs, so I might be overlooking something obvious.

// Example code (not my actual code)
const nftCreate = await new TokenCreateTransaction()
  .setTokenName('My NFT')
  .setTokenSymbol('MNFT')
  .setTokenType(TokenType.NonFungibleUnique)
  .setTreasuryAccountId(myAccountId)
  .setAdminKey(adminKey)
  .setSupplyKey(supplyKey)
  .freezeWith(client);

const nftCreateTxSign = await nftCreate.sign(myPrivateKey);
const nftCreateSubmit = await nftCreateTxSign.execute(client);
const nftCreateRx = await nftCreateSubmit.getReceipt(client);

What am I doing wrong here? Thanks in advance for any help!

yo sophiaatom88, i feel ya on that signature hassle. one thing that saved my bacon was triple-checking my key formats. make sure ur using the right format (ED25519 or ECDSA) for ur keys. also, try logging the transaction details before signing - sometimes theres a sneaky mismatch hiding there. keep at it, nft creation can be a pain but its worth it!

hey there SophiaAtom88! i’ve been tinkering with hedera nfts too and ran into some similar hiccups. have you double-checked that your account has enough hbar balance? sometimes the ‘INVALID_SIGNATURE’ error can pop up if you’re running low on funds for the transaction fees.

also, i’m curious - are you using testnet or mainnet? i found that switching networks sometimes helped me troubleshoot weird errors.

oh, and one more thing - how are you generating your keys? i had better luck using the sdk’s built-in key generation methods rather than trying to import my own. maybe give that a shot?

let us know if any of these ideas help! it’d be cool to hear more about the nft you’re trying to create too. what’s the concept behind it?

I encountered a similar issue when I first started working with Hedera and NFTs. The ‘INVALID_SIGNATURE’ error often occurs when there’s a mismatch between the account used to sign the transaction and the one specified in the transaction itself.

Double-check that the private key you’re using to sign (myPrivateKey in your example) matches the account ID you’re using for the treasury (myAccountId). Also, ensure that the client object is properly initialized with the correct network and account credentials.

One thing that helped me was to verify the account details before creating the token:

const accountInfo = await new AccountInfoQuery()
.setAccountId(myAccountId)
.execute(client);

console.log(‘Account Info:’, accountInfo);

This will help confirm that your account is set up correctly and has the necessary permissions. If you’re still stuck after trying these steps, consider posting your actual code (with sensitive information removed) for more specific debugging.