Verification Failed on client.sendAccountTransaction

I am trying contract-update transaction in nodeJs on Testnet. all data is real(Testnet Account).
client is not sending transaction.

what should be the amount in non payable function?


const sendUpdateTransaction = async () => {
    let TestnetAccountaddress = new AccountAddress("32Ee8mYD9aqa93gbrv5Yno29SUx4FoRb34YEMgBz2TNBa1KVv7")
    // const nonce = await client.getNextAccountNonce(new AccountAddress("32Ee8mYD9aqa93gbrv5Yno29SUx4FoRb34YEMgBz2TNBa1KVv7"));
    const nonce = await client.getNextAccountNonce(TestnetAccountaddress);

    const header = {
        expiry: new TransactionExpiry(new Date( + 3600000)),
        nonce: BigInt(nonce.nonce),              // the next nonce for this account, can be found using getNextAccountNonce
        sender: TestnetAccountaddress,

    const contractAddress = { index: BigInt(1785n), subindex: BigInt(0n) };
    const receiveName = "backgammon.transfer_prize"
    const parameters = {
        "match_id": 1,
        "winner": "32Ee8mYD9aqa93gbrv5Yno29SUx4FoRb34YEMgBz2TNBa1KVv7"
    const rawModuleSchema = Buffer.from(fs.readFileSync(
    const schemaVersion = SchemaVersion.V1;
    const serializedparams = serializeUpdateContractParameters(

    const updateModule ={
        amount: new GtuAmount(BigInt(0n)),
        contractAddress: contractAddress,
        receiveName: receiveName,
        parameter: serializedparams,
        maxContractExecutionEnergy: BigInt(5000n)};

const updateContractTransaction= {
    header: header,
    payload: updateModule,
    type: AccountTransactionType.UpdateSmartContractInstance,
const signer = buildBasicAccountSigner("19de5a445db896cfdb51482b4327cf305c5b31f0d5704c7daa2e382a6c9641ea");
// const signer = buildBasicAccountSigner(mainetkey);

// console.log(await signer.sign());

const transactionSignature = await signTransaction(updateContractTransaction, signer);


const send = await client.sendAccountTransaction(updateContractTransaction,transactionSignature); 
// const signature = Buffer.from(await sign(hashToSign, signingKey)).toString("hex");

i tried both mainnet and testnet account.
all i can think of wrong signing key:

here is schema :

Hi blue,
The key you are using, the verifyKey, can not be used for signing. It is the public key.
The sign key is inside the encryptedSignKey, so if you decrypt it, and use that, it should work.
(If I use my own account, the script works)

And the amount in a non-payable function should just be 0.

what tools are you using to decrypt?

pardon me I am not a scholar of cryptography.

How to decrypt?
Is it ?
Step1 : derive key
Step2: use key to decrypt cipherText

I am using this site to derive key

But I am lost in process.

there are multiple online solution and I am overwhelmed?

We have a small tools for decrypting, that you can use:
Just give it a json file on the format: (i.e. the value of the encryptedSignKey field)

  "metadata": {...},
  "cipherText": "..."

and then it will prompt for your password, and then decrypt it for you.