Error when rekeying address (Dart Algorand SDK)

Hi all!

I’m trying to send Rekey transaction by Dart algorand SDK and getting the error when I send raw transaction: {“message”:“At least one signature didn’t pass verification”}

My code:

try{
      final params = await algorand.getSuggestedTransactionParams();
      Address address = Address.fromAlgorandAddress(address: <SENDER>);

      RawTransaction transaction = await (PaymentTransactionBuilder()
        ..sender = address
        ..receiver = address
        ..amount = Algo.toMicroAlgos(0)
        ..rekeyTo = <REKEY_TO_ADDRESS>
        ..suggestedParams = params).build();

      final signedTx = await transaction.sign(<SENDER_OBJECT>!);

      await algorand.sendTransaction(signedTx);

      print("success");
    } on AlgorandException catch (ex) {
      if(ex.cause is DioError){
        print((ex.cause as DioError).response);
      }
      else{
        print((ex).message);
      }
    }

The issue

If you were to use the same code, without the rekeyto line, would that work ?
Any chance you’ve sent this transaction twice, and the account is already rekey-ied ?

Without the rekeyto line it works, I’m using new account not rekeyed account

It looks correct… but it’s not working for you.
Is there any way you could dump the content of the signed transaction object ?

Hi here is the transaction object :

{sig: z7nisnEKTXnWBZEWSeQP4hQ1jvblSC+/k1bdJ6nTFqMtRy7fDe2CCy2GriH0gqStFRUp5ioup3uV5RyN9/7tAg==, txn: {fee: 1000, fv: 20212115, gh: [72, 99, 181, 24, 164, 179, 200, 78, 200, 16, 242, 45, 79, 16, 129, 203, 15, 113, 240, 89, 167, 172, 32, 222, 198, 47, 127, 112, 229, 9, 58, 34], lv: 20213115, snd: [4, 89, 59, 111, 219, 135, 92, 68, 58, 126, 237, 16, 97, 146, 241, 114, 133, 157, 204, 94, 126, 230, 62, 72, 67, 10, 122, 254, 234, 66, 16, 142], type: pay, gen: testnet-v1.0, grp: null, lx: null, note: null, rekey: GOGEZPO65UJBZ323UBBUDKN3VBZTULAB623ZSXWIVTUREXCU2JMAMVOQBM, rcv: [4, 89, 59, 111, 219, 135, 92, 68, 58, 126, 237, 16, 97, 146, 241, 114, 133, 157, 204, 94, 126, 230, 62, 72, 67, 10, 122, 254, 234, 66, 16, 142], amt: 0, close: null}, sgnr: , lsig: null}

@aldiey9063 I found the issue in the SDK. The rekeyTo value was not properly serialized for the msgpack format. I patched the bug and will be uploading a new version later today.

Okay thanks, looking forward to see the updated SDK

The bug has been patched and is now available in v1.0.2.
I’ve also added a rekeying example: algorand-dart/rekeying.dart at master · RootSoft/algorand-dart · GitHub

1 Like

Hi, i have tested new sdk and it works, thank you