I have a Solana dApp that requests tokens from a wallet that I own. When the user try to claim the Tokens, one transaction is created on the frontend and signed by the user; the signature is coded and sent to my backend API. In my backend I have a function that verifies if the signature is valid: It mounts other transaction the same way (the same process) and verify if the client transaction and my generated transaction is the same. I used this script for more than 1 year but now Im getting so much trouble with differences in the Buffers of the instructions of my generated wallet:
Client instruction: TransactionInstruction { keys: [ { pubkey: [PublicKey [(x)], isSigner: false, isWritable: true }, { pubkey: [PublicKey [(y)], isSigner: false, isWritable: true }, { pubkey: [PublicKey [(z)], isSigner: true, isWritable: false } ], programId: PublicKey [PublicKey(TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA)] { _bn: <BN: (w) > }, data: <Buffer 03 00 be 88 c6 1a 00 00 00> } generated instruction: TransactionInstruction { keys: [ { pubkey: [PublicKey [(x)], isSigner: false, isWritable: true }, { pubkey: [PublicKey [(y)], isSigner: false, isWritable: true }, { pubkey: [PublicKey [(z)], isSigner: true, isWritable: false } ], programId: PublicKey [PublicKey(TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA)] { _bn: <BN: (w) > }, data: <Buffer 03 00 e4 0b 54 02 00 00 00> }
I used x, y, z & w because this infos arent important (but they are the same on the transactions)
my problem is this Buffer, its different!:
<Buffer 03 00 e4 0b 54 02 00 00 00>
Im strugling with this problem like 1 week and I dont know what to to anymore. This two transactions are made in the same process, using the same libs, functions, basicaly ctrl+c -> ctrl+v. And worked very well for an Year.
and is important to say that it still works with some wallets, but others is getting troubles
I code in Typescript, using Next.js and react for frontend and ts using Nest and Node.js in backend.