openssi / peer-did-method-spec

A spec for the did:peer DID method.
https://dhh1128.github.io/peer-did-method-spec/index.html
Apache License 2.0
30 stars 17 forks source link

DID doc should be serialized before hashing to get the DID #77

Closed lovesh closed 5 years ago

lovesh commented 5 years ago

Signed-off-by: lovesh lovesh.bond@gmail.com

dhh1128 commented 5 years ago

@lovesh I don't think we need to canonicalize. That's one of the key evolutions in my thinking since I first started working on this topic. What has to be signed is the bytes of a DID doc in any valid format. We sign the raw bytes, uncanonicalized. Then we sign deltas, which are also raw JSON with no canonicalization requirement. The magic here is caused by several things:

{
    "deleted": [
        "key-1"
    ]
}

...mean the same thing, but we don't care. They are different byte sequences and thus produce different signatures. Whichever form was used by the party that makes a change is the form we'll apply.

dhh1128 commented 5 years ago

@lovesh Do you think we can close this issue, or do you want to have more discussion?