-
Notifications
You must be signed in to change notification settings - Fork 328
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
CIP-0093? | Authenticated Web3 HTTP requests #442
Conversation
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.
This is a sensible and useful proposal (thanks @matiwinnetou @jmagan for the proofreading):
UPDATE: I added a new implementation with Next JS and Auth JS. |
Co-authored-by: Matthias Benkort <[email protected]>
I have changed the url property to uri as I believe uri is a more general term. |
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.
@jmagan thanks for the updates. I'm basing my own review, to get ready to promote this to a candidate, on @KtorZ's last review (#442 (review)) so my comments are above in that review. Most issues have been progressed but a few are still unresolved in my opinion.
I think this is currently ready to be marked as a candidate because the pending review items deal with the explanations in the CIP document rather than the soundness of the proposal itself.
So I'd be ready to green-check this as soon as the nitpick below & items still marked unresolved in #442 (review) are addressed and a candidate CIP number is assigned.
Co-authored-by: Robert Phair <[email protected]>
@rphair I did my best in order to improve the quality of this CIP. I hope the changes are good enough. We could talk to include it in a CIP Editor Meeting when you consider it done. Thanks for your time and your valuable feedback. 🙂 |
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.
@jmagan thanks, I'm marking the issues above resolved because I think they've been addressed; @KtorZ @matiwinnetou please re-open if you think otherwise:
#442 (comment)
#442 (comment)
#442 (comment)
#442 (comment)
#442 (comment)
I've suggested it for our Review agenda for the meeting # 66 in 6 days to consider promotion to a CIP candidate.
@jmagan this is up for Review on our CIP meeting agenda in 20 minutes (see Discord channel)... hope you can participate; will post feedback here in case you can't make it. |
Consensus at CIP meeting today is to promote this to a CIP candidate & assign a CIP number (cc @KtorZ). |
Hey @matiwinnetou, I've incorporated the suggested changes:
I hope this covers all the modifications you requested! Let me know if there's anything else I can assist you with. |
@jmagan thanks for attending today's CIP editors' meeting and allowing us to move this forward to There was a suggestion that the Cardano Foundation (mentioning @matiwinnetou) is using a part of this mechanism in an application, but we agreed today not to require it in Path to Active which only requires implementation in wallets. If it should be merged as |
I find signData to be a bit of a dead-end when it comes to hardware wallets. Many users are moving to hardware wallets, but everyone using signData for things limits dApp reach considerably. Signing an expired transaction (TTL in the past) with the necessary information achieves the same results and is accessible to hardware wallets in addition to software wallets. It's also easy for wallets to display an expired tag on these types of transactions that are being signed. |
Hello @AndrewWestberg, I'm huge fan of your videos. Actually, I was talking about this today in the CIP Editor Meetings channel on Discord. The CIP-8 already approachs this issue and the wallet can pass to the hardware wallet a hash of the unprotected headers:
Maybe, some CIP-30 modification is necessary in order to choose the hash version of the payload. |
@jmagan thanks for discussing this at today's CIP Editors' meeting. My understanding of the reservations expressed is that we should take off the
I apologise for the rough description & if you can to go into detail about those reservations for the record here then please do so. We also noted that the change to CIP8 would be nontrivial and time-consuming relative to the work you can put into this CIP. Therefore I'm taking off the |
Hi @rphair, thank you for your comments. I'm planning to address the reasons for not using CIP-8 in the CIP's rationale. Essentially, I will explain that adopting that approach would necessitate modifying both CIP-8 and CIP-30, as well as waiting for corresponding wallet implementations. In contrast, the current implementation is ready to be deployed, allowing us to provide immediate value to the Cardano Web3 ecosystem. However, this doesn't mean that this CIP is intended as a temporary solution while those CIPs are being modified, potentially leading to their deprecation or use as legacy in the future. Regarding the choice of JSON over CBOR, the CIP already discusses this matter. The requirement for the string to be human-readable is the primary factor, which CBOR does not fulfill. Additionally, JSON is more user-friendly for web developers, who are the target users of this CIP. |
@jmagan I am happy to hear that the suggestions about CIP-8 don't need to block this proposal from being merged. Your documenting that part of the rationale will help people decide whether to follow your suggested implementation or to use CIP-8 instead and perhaps write their own "competitive" CIP for it. From my own experience I agree with your point about the human readability being an important factor for web implementations... similar decisions were made to favour human readable formats in our NFT related CIPs. Given your last response I think it's appropriate to leave the |
Hi @rphair. I had a discussion this morning with @matiwinnetou, and we concluded that the current version of this CIP holds value and can be implemented as is. We also carefully considered the concerns raised by @SebastienGllmt, and we agree that making this CIP idiomatic with Cardano using CBOR would be ideal. Our proposed solution is to proceed with this CIP while simultaneously working on modifying CIP-8 and CIP-30 to define the Payload format as either JSON or CBOR. This approach would allow sufficient time for browser developers to meet the requirements for human readability and make necessary adjustments to the wallet API. Consequently, we can introduce a version 2 of this CIP incorporating COSESign and CBOR, accommodating both realms and ensuring broad support. |
Hi @rphair, I have made the requested modifications. I have added an extension to the rationale section to address the CBOR and JSON dilemma. Additionally, I have included a suggestion from @matiwinnetou to allow numeric strings in the timestamp and slot fields. Extended rationale:
New JSON Schema: {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"uri": {
"type": "string",
"format": "uri"
},
"action": {
"type": "string"
},
"actionText": {
"type": "string"
},
"timestamp": {
"anyOf": [
{
"type": "integer"
},
{ "type": "string", "pattern": "^\\d+$" }
]
},
"slot": {
"anyOf": [
{
"type": "integer"
},
{ "type": "string", "pattern": "^\\d+$" }
]
}
},
"required": ["uri", "action"],
"oneOf": [{ "required": ["timestamp"] }, { "required": ["slot"] }],
"additionalProperties": {
"type": ["string", "object"]
}
} |
@jmagan thanks for taking care of this & I believe the new Alternative implementations section satisfies the conversation that came up in this week's CIP meeting. It also seems logical to me that you've also ticked off the two conversation & review items under "Implementation plan" because we've now done this extensively on GitHub and the meetings. So I guess this is cleanly back to |
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.
Well written and discussed proposal, good work @jmagan! 🚀
OK @KtorZ I think the proposer has done a great job adapting this proposal to challenges whenever necessary and so it's ready to hit the |
* Initial draft * fix: spelling * fix: Implementation plan indention feat: Path to active * Next JS reference implementation * Apply suggestions from code review Co-authored-by: Matthias Benkort <[email protected]> * KtorZ suggestions * Change in diagram * Rationale improvements * Payload JSON Schema spec * Payload JSON Schema spec * Remove document title Co-authored-by: Robert Phair <[email protected]> * rphair suggestions * add PR link Co-authored-by: Ryan Williams <[email protected]> * correct markdown syntax for license link Co-authored-by: Ryan Williams <[email protected]> * numbering * Add versioning * Add versioning * assign CIP number but still need directory renamed * refactor: cip-0093 directory creation * feat: matiwinnetou's feedback * feat: strings for timestamp and extended rationale * fix: missing word --------- Co-authored-by: Matthias Benkort <[email protected]> Co-authored-by: Robert Phair <[email protected]> Co-authored-by: Ryan Williams <[email protected]>
* Initial draft * fix: spelling * fix: Implementation plan indention feat: Path to active * Next JS reference implementation * Apply suggestions from code review Co-authored-by: Matthias Benkort <[email protected]> * KtorZ suggestions * Change in diagram * Rationale improvements * Payload JSON Schema spec * Payload JSON Schema spec * Remove document title Co-authored-by: Robert Phair <[email protected]> * rphair suggestions * add PR link Co-authored-by: Ryan Williams <[email protected]> * correct markdown syntax for license link Co-authored-by: Ryan Williams <[email protected]> * numbering * Add versioning * Add versioning * assign CIP number but still need directory renamed * refactor: cip-0093 directory creation * feat: matiwinnetou's feedback * feat: strings for timestamp and extended rationale * fix: missing word --------- Co-authored-by: Matthias Benkort <[email protected]> Co-authored-by: Robert Phair <[email protected]> Co-authored-by: Ryan Williams <[email protected]>
@jmagan is it possible that the libs you provide for cip93 reference implementation do not support hashed payload content? |
Hi @gitmachtl, yes. I'll take a look to it. It's an important feature to be implemented. Can you give me further details about the packages you are using or some way to reproduce the error? |
@jmagan turnes out that the used https://github.com/cardano-foundation/cip30-data-signature-parser functions did not support the |
i have implemented the CIP8/30 specs pretty early on in https://github.com/gitmachtl/cardano-signer and therefore i went with the full specs for it. from time to time i stumble across implementations that do now have the information about a hashed payload in it. but its clearly stated in the CIP here: Line 255 in f389cda
and now that hardware wallets also implemented message signing, this can cause issues. because the message length for hardware wallets to sign is super limited. therefore the message/payload must be hashed and the COSE_Sign1 signature than includes the |
@gitmachtl I've spoken with @matiwinnetou and the problem was addressed and there are multiple PRs almost ready to merge. It will be fixed soon. |
(rendered CIP document in branch)