You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate canonical TypedData from arbitrary JSON input.
Instead of passing Types in the proof or credential schema, generate them from the input message. Traverse the objects in the message, depth-first, ordered by keys, to visit the objects in a canonical order. For each object, define a new struct type, incrementing a counter to create a new type name. Add members to the type definition for each property of the object. For object values, use the struct type for that object previously defined (or use recursion).
Convert array values to objects with numeric keys, but name their type differently (e.g. "Array" + counter, instead of "Struct' + counter) so that they hash differently. Converting objects to arrays allows for arrays to have values of different types, and avoids having to deal with problematic array hashing (MetaMask/eth-sig-util#106).
This algorithm could be used if messageSchema is absent. It would be desirable so that types do not have to be manually defined and passed in the proof or resolved from a URI.
The text was updated successfully, but these errors were encountered:
Generate canonical TypedData from arbitrary JSON input.
Instead of passing Types in the proof or credential schema, generate them from the input message. Traverse the objects in the message, depth-first, ordered by keys, to visit the objects in a canonical order. For each object, define a new struct type, incrementing a counter to create a new type name. Add members to the type definition for each property of the object. For object values, use the struct type for that object previously defined (or use recursion).
Convert array values to objects with numeric keys, but name their type differently (e.g. "Array" + counter, instead of "Struct' + counter) so that they hash differently. Converting objects to arrays allows for arrays to have values of different types, and avoids having to deal with problematic array hashing (MetaMask/eth-sig-util#106).
This algorithm could be used if
messageSchema
is absent. It would be desirable so that types do not have to be manually defined and passed in the proof or resolved from a URI.The text was updated successfully, but these errors were encountered: