I am getting "Signature verification failed" error for my program even if there are no constraints for signers in the program (permissionless).

Also checked that the signer is properly defined before sending transaction. This error occurs only sometimes, where most times it succeeds.

What are the core reasons for this error when submitting tx via anchor on ts?

  • can you give more reference about error and also code for this May 31, 2023 at 7:07

2 Answers 2

it("An account is initialized", async function() {
    const baseAccount  = Keypair.generate();
    const initializeTx = await program.methods.initialize("My first message").accounts({
      baseAccount: baseAccount.publicKey,
        user: provider.wallet.publicKey,
        systemProgram: SystemProgram.programId,
//    }).signers([baseAccount]).rpc()

This is a common issue raised when we don't provide a signer for an instruction like in this commented line we need a signer for this account named baseAccount

you need to provide a signer

  • I am setting the AnchorProvider with the signer, which means this is not required? Even though I set .signers, it happens only in certain occasions, like 1 out of 50 txs.
    – gud
    Jun 1, 2023 at 21:06
  • can you provide a reference code Jun 2, 2023 at 7:16

If you are trying to initialize a new data account on the program, the wallet occasionally wants the account to be a signer. You can easily fix it to change the ABI of the program. You can change the account isSigner as true.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.