Open robertkowalski opened 4 years ago
That 12 character limit is imposed as a defense mechanism since hashes could be passed into that method which are actually packed transactions, and then signed by the user without their knowledge of the parameters of the transaction they are signing (since arbitrary sigs only show the data being signed, and doesn't unpack it).
The alternative is using a pseudo-chain call to trick Scatter into using an on-chain contract for parsing, and passing in the string to be signed as a parameter. The transaction isn't actually sent to chain, just using the ABIs. Example: https://github.com/GetScatter/scatter-js/blob/master/mock-sites/eosjs/index.html#L245 This also allows hardware wallets to work with arbitrary signatures.
Happy friday Scatter team!
We are trying to sign arbitrary data with Scatter.
We use
scatter.getArbitrarySignature
. It works well for any strings that have less than 12 chars per word.In our case, we need to sign larger JSON messages, so the limitation becomes tricky. The documentation mentions that the limitation applies to strings.
Not sure if we can pass other data types to it.
I already tried to pass in plain Node.js Buffers and Uint8 Arrays created with
eos.Serialize.SerialBuffer
, but no luck so far.Why is the limitation of 12 chars there? Any ideas how to solve this issue?
Example:
Example with Uint8 Binary data