magic-js icon indicating copy to clipboard operation
magic-js copied to clipboard

Flow domain tags problem

Open bluesign opened this issue 3 years ago • 3 comments

✅ Prerequisites

  • [x] Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • [x] Are you running the latest SDK version?
  • [x] Are you reporting to the correct repository (magic-sdk)?

🐛 Description

https://github.com/magiclabs/magic-js/pull/293 broke Flow transaction signing for FCL >= 0.0.46

🧩 Steps to Reproduce

Try to run demo app with FCL >= 0.0.46 ( which is very old version )

😮 Actual behavior

FAILED TRANSACTION [Error Code: 1006] invalid proposal key: public key 0 on account 4333f1b7e58a550a does not have a valid signature: [Error Code: 1009] invalid envelope key: public key 0 on account 4333f1b7e58a550a does not have a valid signature: signature is not valid

FCL 0.0.46 introduces domain tags to FCL

2021-05-05 BREAKING -- Prepends a transaction domain tag to encoded payload and envelope messages. Transaction domain tags allow signers to identify which messages are intended to represent encoded transactions, and which are not. The Flow protocol has been updated (as of May 5th 2021) to both accept signatures produced from messages prepended with a transaction domain tag, and from messages that are not. The next spork (time and date of next spork are TBD) will strictly require all signatures for transnactions to have been produced from messages prepended with a transaction domain tag. This breaking change requires all users of Flow Client Library and the Flow JavaScript SDK to update their versions to a version greater than or equal to the verison that this change was included in.

Probably you started prepending domain tag when signing and this caused double domain tag on payload. As FCL already prepends when version is >= 0.0.46

bluesign avatar Aug 10 '22 07:08 bluesign

Thank you @bluesign for reporting this issue. I will bring this to our Engineering team and will update this issue accordingly.

am-hernandez avatar Aug 10 '22 15:08 am-hernandez

Wondering if there has been an update here for Flow tx signing support?

gregsantos avatar Jan 04 '23 21:01 gregsantos

Looking for an update here as well.

Thank you!

zolrath avatar Apr 06 '23 23:04 zolrath