-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Discussions for EIP: Add DID related methods to the JSON-RPC #2845
Comments
Replying to @kdenhartog from the duplicate discussion thread #2851 Original message:
Personally I would be fine with restricting the alg and key types to the ones that are supported by JOSE registries (are those used by default for COSE as well?). So the JSON-RPC is used for two main things with ethereum. Interacting interacting with chain state, and requesting things from the wallet. This means that it acts as a way for an app to request signatures and account information from a wallet. So in our case here the only things needed to be done wallet side is signing and decrypting. Internally wallets are free to use whichever key management system they prefer. A caller of any of these methods won't need to provide any type of key material. |
Things to consider... secp256k1 supports ecdsa (ES256K JWS) and Schnorr (SS256K (not registered!)).... and UPort created IMO, making the header a required RPC argument, and restricting the valid values of There is also detached JWS https://tools.ietf.org/html/rfc7797 ... this is really useful for when you are signing binary... not some JSON.stringify-iable data (lots of issues with canonicalization and JOSE).... It's also the default JWS format used by Linked Data Proofs. I'm not sure adding the |
Thanks @OR13
Good point. I should probably explicitly say
Hm, seems like this would require the application developer to be aware of which algs the wallet supports. This would mean that there needs to be an additional rpc method for getting this information. I'd rather have the wallet decide this and append the alg that it is using.
Happy to add this if others express interest.
The whole point here is to enable DID signed JOSE/COSE objects. Essentially by setting the |
If the developer is not required to know which signing algorithms are supported and set the header explicitly, a default header should be provided.... which defaults will be used? +1 to using what about all the developers who want JWTs / JWSs but don't care about DIDs?... I agree that the APIs should be simple, but i question why they should start with dids... to me... dids are more of an option for setting the |
That's up to the wallet implementer (a reccommendation is provided in the EIP)
What do you mean by this exactly? To me this is what you would use the DID for. Using |
put another way... what RPC interfaces will be provided for getting public key bytes.... possibly options:
For example... Tangem cards support a "getPublicKey" NFC interface. You can then use that interface to verify signatures... the cards themselves don't support "verifying on the card".... thats similar to the concept of "verifying on the rpc server"... I'd prefer to have a JOSE RPC interface, that happened to work with DIDs... and a DID RPC interface that supported things like: resolution (which returns a set of keys, and their associated relationships)... those relationships have nothing to do with JOSE... they are no mentioned in the JOSE RFCs... they were created in DID Core. |
This is what The problem with an RPC method like |
Updated: You might be able to use the |
I guess
^^should be rather CWS, right? |
Is there a reason to not include an API for:
? Update: That certainly only makes sense using authcrypt -> e.g., ECDH-1PU |
Is the |
Is it needed to recommend a decryption algorithm for decryption? The decryption algorithm can be determined from the CWE/JWE directly, trying to decrypt the CWE/JWE with a different algorithm, would fail anyways. In general I agree that ECDH-ES (X25519) + XChacha20Poly1305 should be recommended. |
Me and @wighawag drafted a similar proposal last year where accounts would be exposed with signatures for a given challenge. https://ethereum-magicians.org/t/automatic-authentication-signature/2429 If this pattern would be possible with Same dapps currently after getting the user's accounts follow up with a I think this should just be the default behavior for all dapp and wallet interoperability |
Adding a challenge makes sense! Thanks for suggesting @awoie and clarifying @pedrouid. Will add this when I update the draft. Might make sense to make this an actual JWT/CWT with an expiry actually. A
Nice catch!
Would you mind expanding on this? And yeah for the suggested encryption alg you can just do the encryption client side.
It's really up to the wallet to decide what to use, and state that in their DID document.
The |
ECDH-1PU is for example used in DIDComm-messaging to encrypt a message to a DID while enabling the receiver of the encrypted message to verify some sort of authenticity that the sender is has a certain DID (or more general keys) by avoiding the sign-JWS-then-encrypt-JWE pattern. In that case, only the wallet would be able to create such a JWE/CWE because only the wallet controls the private key.
The |
Great, let's use
Ok, so this would be optionally set by the wallet?
Makes sense, but seems a bit out of scope for now. Could easily be addressed in an additional EIP!
That's my point :) In some cases you might not want to leak information about whom the ciphertext is intended for. |
https://github.com/decentralized-identity/did-jose-extensions/blob/master/options.md TL;DR; I'd rather see use of |
I agree we should postpone encryption until we have signatures. can we take an inventory of the proposed RPC methods? |
@oed @OR13 Does it make sense to also support JWS JSON serialization? What happens if a DID has more than one signature key attached to it? |
I assume the API interface would support specifying the exact key to use for signing.... For example: https://github.com/transmute-industries/did-key.js/blob/master/packages/secp256k1/src/__fixtures__/index.ts#L58
I would consider a wallet API that didn't let me choose the signing key pretty broken, in all cases where there was more than 1 signing key.... its not clear to me that is the case for |
With JSON Serialization you would be able to send multiple signatures back in case the DID controls a few signing keys. That was why I brought that up. |
@awoie hm so the interface would be Seems useful. |
Makes sense. This was my intention. Maybe that was unclear?
I'm agnostic as to which serialization to use. I'm curious though what the use case is for signing with multiple keys from the same DID? If you want to have two different DIDs sign the same payload you can just take two JWS with compact serialization and reserialize them using the JSON serlialization (which is trivial).
Yeah exactly. You can already specify the fragment in the |
Would this break the signatures of the two because of the non-payload data being signed (e.g. protected headers)? If not, it would be cool to enable multi-signature supports as a separate API where a JWS can be passed in with the DID and it will de-assemble the JWS and sign the payload/header data and then that JSON serialized JWS could be passed as a form of a multi-signature to something like a smart contract or any other verifier for that matter. |
Thanks for creating this proposal. Regarding The current draft of this proposal specify that Otherwise, as @pedrouid mentions, But looking at the current draft of the proposal here, it seems that It accept a If we go with the idea that Any other Furthermore as mentioned here and explained in Proposal 1: Non-Interactive Decryption This would allow a seamless encrypted storage for application, that can then be safely shared across devices. Now if the content change (and so the uri), the user would be requested to Now, I am not very knowledgeable with JWS and I might abuse term "path" here by allowing it to represent URI. If that is the case, we could separate the 2. Note: for traditional URI (non content-addressable) it could be up to the wallet to decide whether a user confirmation is required as there is a security risk that the application get compromised. |
It wouldn't. Each signer is free to choose what to put in their protected header. For example they would need to put their own |
@wighawag While we could use I'm saying this mainly because I believe data should always be independent of the app that is bee used to display the data. |
@oed I agree that we should not silo data. But here the proposal is to remove the need for approval for the default case. |
Updated the EIP. Let me know if I missed something or if you have additional suggestions :) |
why is a signature from a specific version is similar to a signature from an issuer which never does key rotation... it will always verify.... defeating the purpose of many signatures.... however, there are cases you only care that the signature was valid at the time in the past when the keys were active, and you don't care if the signature valid for the current version. Consider that an attacker will have "active keys for a version" if they compromise any version, so rotation no longer insulates the controller from being impersonated. also Since this is an EIP, it might be helpful to provide concrete data model examples using: |
@oed DIDComm v2 as it is proposed right now, won't use compact serialization. Example JWM (JWE) that is used in DIDComm v2 -- JWS and plain-text will be also supported:
Example payload (other claims might be included):
|
@oed @OR13 @kdenhartog imo, the did_* API should also support JSON serialization, or if the first version does not support other serialization options than compact serialization, then i would rename the API, or introduce a place holder parameter that indicates the type and have compact as the default option. further, it would be great if we could continue the work on this to add support for JWM and more specifically JSON serialized JWE which are used in DIDComm v2. another point that i want to make is to add an did_encryptJWE for authcrypt. it would be specifically great to get feedback on the usefulness from @kdenhartog on this. |
@oed |
Thanks, it shouldn't be. Will change the wording.
This is not always true. For example in Ceramic each update that is made is anchored in a blockchain. This makes it possible to determine if a key that signed the update was valid at the time the anchor was made. Not sure how @awoie good point about serialization. Meant to change it to general, will make another update!
Can you please provide a specification for this? I don't know how that should work.
Good point, will add the Have the updates here: https://github.com/oed/EIPs/blob/chore/additional-2844-udates/EIPS/eip-2844.md Will make a PR after some more time for feedback 👍 |
right, but when that signature is the first evidence of a compromised key, and the signature remains valid forever (because its pinned to a version), this removes a lot of the value of dids and key rotation...
If you were to sign an
^ This is a generic way of representing ethereum addresses, and bitcoin addresses (and others) and its part of DID Core. |
I would disagree with that. The |
IMO, a mix might be desired. For example, if you look at the SSI use case. An issuer provides a VC to a subject/holder. The VC could contain the DID of the issuer + version property. If think it is desirable to being able to verify that the VC was valid at least once. In case the issuer key got compromised, then I would expect that the issuer would revoke the credential through the revocation method of their choice (e.g., through some onchain accumulator). The VC would need to contain a Update: |
sure, but what about VCs that have no Rotating keys is a weapon of last resort for credential revocation... |
Imo this should not be limited to VCs. Maybe it makes sense to add an option to the For example in ceramic all previous documents would be invalidated if you rotate keys for whatever reason, which is definitely not desired. New keys can always invalidate changes made by old keys. |
Authcrypt is effectively ECDH-1PU |
Thanks @kdenhartog I meant more if someone could provide a description of how the json-rpc method for it would work :) |
There is an early version of a JWM implementation that uses authcrypt:
It further says:
|
@awoie Do you have an opinion on how the json-rpc method should look like? I don't have enough insight to design it. |
@oed I will provide an example this week. |
@oed This is the proposal to update eip2844 to support authcrypt but I'm wondering if @kdenhartog also thinks this is useful. AuthcryptJWEEncrypts a message using ECDH-1PU to an array of recipients. Authenticated encryption provides only authenticity and not the stronger security properties of non-repudiation or third-party verifiability. This can be an advantage in applications where privacy, anonymity, or plausible deniability are goals. For content encryption of the message, the following algorithm MUST be used:
Method: Params:
Returns:
|
Looks nice overall @awoie. Some thoughts:
Can we be more opinionated here please? I would prefer just one option, probably base64url.
So if I understand correctly this did would be used as the
Where would the |
@oed right, I will provide an update, we should also talk about |
@awoie Can you remind me what
|
Yeah that would be really useful in my opinion. That's effectively merging everyone on the envelope of DIDCommV2 which would be amazing. |
As for apu / apv that's correct that they're not strictly for a generic JWE, but for the 1PU they appear to be required for the HKDF function parameters |
I think I had a similar thought to #2845 (comment). For
Would it makes to apply the same logic for Imagine a chat application where a signature is attached to each message, a similar logic would enable this use case without having to ask the user for signature authorization every time. Or am I missing the point of the |
Thinking about this more after coming back to look at this a few months later, I get the feeling we're conflating a few different layers here and if we decompose these things a bit more it would make the DID functionality all the more usable. 1st, I think we should add a DID management layer for normal CRUD ops so that the DID can be managed independent of it's usage. 2nd, I think we need to look at the JOSE layer as one of many usage layers which depends on the 3rd, I think the conflation of a ABAC authz model built into the usage layer is going to inherently couple things in weird ways that probably aren't correct. I need to understand the different trust boundaries a bit more on the RPC to get a better understanding and see if it makes sense to have the authz model combined with the usage or if it makes sense to separate it. When I get some time in the next week or two I'll do some research on this and see if my thinking here is heading in the right direction or if I'm off basis. |
There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
This issue was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment. |
https://eips.ethereum.org/EIPS/eip-2844
The text was updated successfully, but these errors were encountered: