espresso-cash-public icon indicating copy to clipboard operation
espresso-cash-public copied to clipboard

SignedTX.encode() builds different transaction bytes than web3.js

Open Xyzcancer opened this issue 2 years ago • 2 comments

I'm trying to sign transaction that comes to me in base64 and already signed by one of signers. When I print bytes of transaction at has stub for my signature. I've decompiled it to bytes and signed. Then I got SignedTX class, call encode method and part of bytes with signature is the same in both ByteArrays, but then it's got shuffled. So basically, first signer have signed another ByteArray and it fails on sending.

Steps to reproduce the behavior:

  1. Create transaction with two signers using web3.js
  2. Sign with first signer and convert to base64
  3. Decompile this base64 to message and try to sign
  4. Send signed transaction and see error from solana

Expected behavior Transactions bytes are in the same order

message (1).txt

Xyzcancer avatar Aug 22 '22 20:08 Xyzcancer

I spent more time on it. Seems like method Message.compile() creates ByteArray in different order

Xyzcancer avatar Aug 23 '22 08:08 Xyzcancer

Can you check this ticket?

https://github.com/cryptoplease/cryptoplease-dart/pull/184

romeo4934 avatar Aug 23 '22 10:08 romeo4934