-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement TezosSignature2021 (TezosMethod2021) #170
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Apr 7, 2021
wyc
reviewed
Apr 12, 2021
wyc
reviewed
Apr 12, 2021
wyc
approved these changes
Apr 13, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay merging this, but we should make an issue to modularize verification methods into optional crates. Ideally, someone should be able to use ssi
with zero blockchain dependencies (or all of them!) if they so choose.
sbihel
approved these changes
Apr 13, 2021
chunningham
approved these changes
Apr 14, 2021
Test TezosMethod2021 in did:pkh
Co-authored-by: Charles Cunningham <c.a.cunningham6@gmail.com>
Rebasing... |
This was referenced May 4, 2021
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Create a linked data signature suite (verification method type and proof type) for signed Tezos messages.
Temple (madfish-solutions/templewallet-extension#238) and Kukai (kukai-wallet/kukai#65) allow signing messages, either as raw bytes or as a string Micheline expression beginning with prefix "Tezos Signed Message". We use the Micheline option, since that enables the user to see a string in the signing request instead of only bytes.
Similar to the Eip712Signature2021, this attempts to create a verification method for using with existing wallet applications, allowing the user to see data being signed in a richer format than a byte string. The signing format implemented here is a string containing NQuads of the URDNA2015-normalized linked data document (VC/VP) and the linked data proof options. This is as done in
existing suites such as Ed25519 Signature 2018 and JSON Web Signature 2020 but with the Create Verify Hash Algorithm modified in order to present the user with unhashed data.
Since this proof type is intended for use with Tezos accounts, which are identified by public key hashes, this signature suite will support including the public key in the proof object instead of in the verification method, and using the blockchainAccountId property of the verification method to validate the public key included in the proof. This is to enable use with signing algorithms that do not support public key recovery, as done in the existing proof types
Ed25519BLAKE2BDigestSize20Base58CheckEncodedSignature2021
andP256BLAKE2BDigestSize20Base58CheckEncodedSignature2021
(which are being considered for renaming in #152).The
jwk_from_tezos_key
function I copied from @chunningham and add it here since it will be needed in DIDKit in the browser in order to convert the wallet'sedpk
into aJWK
to pass to DIDKit. This function only supportsedpk
currently, not yetp2pk
orsppk
.I found an odd thing with
spsig
which is that unlikeedsig
andp2sig
, the prefix bytes do not match the base58: it results in "4sLJ" instead. I am following the bytes ("4sLJ") rather than the ASCII. I have not tested this with an actual Tezos implementation so I don't know if this is correct. Onlyedpk
/edsig
here has been used externally (with Temple wallet).ProofSuite
implementationdid:pkh