Closed
Description
Looking at signStructuredMessage
, I noticed that although it signs Clarity Values, it is missing parts of the specification thus resulting in different signatures.
connect/packages/connect/src/signature/structuredData.ts
Lines 24 to 43 in 1f3e94a
As per the current draft:
https://github.com/stacksgov/sips/blob/48a8493f19702a14258db5730fece837cd783b7a/sips/sip-018/sip-018-signed-structured-data.md#formal-specification
signStructuredData(D, K) = sign(messageHash(D), K)
, where:messageHash(D) = sha256(structuredDataPrefix || domainHash || structuredDataHash(D))
.
The domain tuple CV and payload CV should therefore be supplied separately. The prefix is 0x534950303138
.
The domain tuple CV at the bare minimum requires:
{
name: (string-ascii len)
version: (string-ascii len)
chain-id: uint
}
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Released or closed