Skip to content

Conversation

@nazrhom
Copy link
Contributor

@nazrhom nazrhom commented Jan 7, 2025

A wallet connector API. The goal of this CIP is to define a connection API that is independent of functionalities provided by wallet extensions. Future CIPs will introduce extensions to gain parity, and eventually surpass the capabilities offered by CIP-30 today.

See CPS-10 for motivation.

(rendered version on fork)

@Ryun1 Ryun1 added Category: Wallets Proposals belonging to the 'Wallets' category. State: Triage Applied to new PR afer editor cleanup on GitHub, pending CIP meeting introduction. labels Jan 7, 2025
@rphair rphair changed the title CIP-???? | Full-data wallet connector CIP-0144? | Full-data wallet connector Jan 8, 2025
Copy link
Collaborator

@rphair rphair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At initial review in the CIP meeting yesterday we agreed this represents long-awaited progress as a wallet API that we have needed for some time. We feel optimistic this will move ahead after some refinement so agreed to accept its CIP candidate status immediately.

@Ryun1 @Crypto2099 @perturbing we should start tagging wallet devs left & right on this, as well as kicking off some activity in the CIP Discord in both the Wallets and Query Layer threads. - Q: is the Wallets Working Group still meeting, and could they start chewing on this there?

In the meantime @nazrhom please rename the containing directory to CIP-0144 and update the link to your proposal in the original posting with the new pathname. 🎉

@rphair rphair added State: Confirmed Candiate with CIP number (new PR) or update under review. and removed State: Triage Applied to new PR afer editor cleanup on GitHub, pending CIP meeting introduction. labels Jan 8, 2025
```
{
"operation": "enable",
"request": { "$ref": "#/appendix/Extensions" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a thought, would there be a usecase where a dApp doesnt request a whole extension?
perhaps a dApp only wants a couple methods, maybe this would just add unneeded complexity

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in meeting
we can consider this in the future, or when we have more feedback from stakeholders

@rphair
Copy link
Collaborator

rphair commented Feb 18, 2025

@nazrhom now that the last hour's CIP meeting has confirmed we have a new title taxonomy Wallet Connector - for CIP-0144 compliant extensions, as per our meeting discussion could you also add a table — initially populated with

as @Ryun1 has done here for CIP-0030? 🙏

@Ryun1 @Crypto2099 and other wallet reviewers... I would leave it to your consensus about whether or not "candidate" (not yet merged) CIPs should be included here.

}
```

Returns true if the dApp is already connected to the user's wallet, or if requesting access would return true without user confirmation (e.g. the dApp is whitelisted), and false otherwise.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or if requesting access would return true without user confirmation

I find this problematic:

  • This could be an issue to implement for some wallets if they decide to request user confirmation when new extension is requested (e.g. some kind of identity extension, side chain extension)
  • Multi-account wallets might want to provide user with an option to connect a different account on each enable

Also I find the operation name isEnabled a little bit misleading here, as it does not necessarily mean that enable was called and resolved successfully.

What are the use cases of this operation?

Copy link
Contributor Author

@nazrhom nazrhom Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was part was copied verbatim from the current CIP-30. As a general point I have tried to keep the API as close as possible to CIP-30, to make the transition to the new CIP easier. Since we are not backwards compatible with CIP-30 anyway, I could also see the argument for saying we might take this opportunity to make more breaking changes.
I am curious to hear other people's opinions on this: should we strive to be as close as possible to CIP-30 (while still addressing the identified shortcomings cfr. https://github.com/cardano-foundation/CIPs/tree/master/CPS-0010), or should we take this as an opportunity to change the API in other places as well?

I will do some research on the original motivation behind this operation. My guess is that, since the enable call specifies:

The wallet can choose to maintain a whitelist to not necessarily ask the user's permission every time access is requested, but this behavior is up to the wallet and should be transparent to web pages using this API. If a wallet is already connected this function should not request access a second time.

This endpoint is provided so clients can keep track of permissions, should the wallet not already do that.


While this CIP attempts to define an API in a transport agnostic way, implementations will be forced to pick a specific transport. In the spec we have not given specifics on how to namespace and generally structure the api in an implementation. This is both because details depend on the underlying transport that is chosen to implement the API, but also because we wanted to make backwards compatibility with the original CIP-30 proposal as easy as possible.

Each transport specific implementation will make a choice on how to namespace access to the operations. In the following we give a description of how this should work for an implementation using an injected javascript object. Support for different transports can be added to this CIP in form of PRs.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support for different transports can be added to this CIP in form of PRs.

Maybe we could keep this CIP transport-agnostic and have separate CIPs for each transport, including Injected Javascript Object 💡

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense, and had thought the same myself. The argument against this would be to avoid opening too many interconnected CIPs, but I am happy to split it if there is consensus around this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkazlauskas @nazrhom this is a question I would hope to have @Ryun1's insight about.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The argument against this would be to avoid opening too many interconnected CIPs

i feel that is probably okay
since it would be quite nice if this CIP was transport-agnostic


### CPS-10

[CPS-0010](https://github.com/Ryun1/CIPs/blob/cps-wallet-connector/CPS-0010/README.md) discusses several limitations of CIP-30. In this CIP we try to solve the issues pointed out in that CPS. There are still some areas to improve on: things like the event listener API are intentionally left out of this CIP to prevent bloat of scope. We welcome future CIPs, or updates to this CIP to refine any limitation that is not tackled in this document.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still some areas to improve on: things like the event listener API are intentionally left out of this CIP to prevent bloat of scope

I think we should have some primitives for defining events in the base spec/cip. As far as I understand, request has to be a plain object as you can't define callbacks in a JSON schema.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be curious to hear more about your thoughts on the possible event API. The reason it was originally excluded was that I thought it would work better as an extension to this CIP, as it is a completely new API and it requires a discussion around which events we would like, etc. But I would be happy to start the discussion in this CIP and then we can decide if we want to add this in this CIP or keep it for a future one

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that extensions:

  • would be defining their schemas for base operation payloads (request/response/error)
  • probably shouldn't be adding new base operations, as it adds new requirements for transport CIPs/implementations

Given this CIP (and naming of request/response operations), transport specifications would probably imply only a single value resolved from a 'request' - a typical pull-based API structure, e.g. injected javascript object transport implementation would probably map requests/responses into a promise based API like api.cip123.operation(r: Request) => Promise<Response>

If you wanted to add an extension for events, you couldn't really do it by adding an on 'request', because transports would generically expect it to resolve with only a single value like all other requests.

Am I missing something - could you create an extension for events given this base CIP?

```
{
"operation": "enable",
"request": { "$ref": "#/appendix/Extensions" },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing dapps are always in context of a specific network. Could we add chain id in the enable request?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a great idea! We should definitely build upon CIP-34 to identify the network. One question that I have is: should a wallet only support a single network at a time, or should it be able to speak to different networks at the same time?

Supporting multiple networks at the same time would complicate the API a bit (we would have to somehow track what network we want to run an operation on) I am not sure if there are use cases for this that would justify the additional complexity, but I would be curious to hear feedback from different stakeholders on this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel that one Cardano network at a time, is probably okay
and matches existing implementations

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, one network should be enough for now. Although it would be interesting to learn about Hydra use cases

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

point from CIP editors meeting;

  • methods for L2s or state channels are probably better suited as extensions as they may have their own unique constraints
  • but it would still make sense to add a network field to the enable call, to allow the dApp to request a given network connection

@rphair
Copy link
Collaborator

rphair commented Jul 18, 2025

I just posted on Discord in response to query about this proposal's status:


You are right that the work stopped in February. Without the author (@nazrhom) being involved in the submission anymore, and nobody to respond to suggestions & questions that came after then (with a few points unresolved at that time), this CIP has been stalled.

Normally editors would mark a proposal Waiting for Author at that point but I think we've ever since been hoping someone else at MLabs would take up the mantle of this proposal again. I will mark it that way now: which sometimes helps attract support for a CIP that's no longer being advocated.

In my opinion it was mature & likely would be ready for merge after it can be taken up by another advocate, even if outside of MLabs: bringing appropriate experience in the wallet industry & responsibility for some related implementations of this API.

Alternatively, if a number of such devs got together to certify this proposal is ready to go "as-is", we might merge it if there are enough confirmations on GitHub... plus answers provided to at least the review points that begin here: #957 (review)

@rphair rphair added State: Waiting for Author Proposal showing lack of documented progress by authors. and removed State: Confirmed Candiate with CIP number (new PR) or update under review. labels Jul 18, 2025
@mpizenberg
Copy link

Just to say 👋

This is a subject I’m super interested in, and really want to help improve both sides of the equation: user UX and dapps capabilities. I would be happy to contribute and help restart the discussions on this subject in a couple months. I’m currently busy on a couple things, but this is super important and will be critical for adoption and retention, both of users and devs.

@Ryun1
Copy link
Collaborator

Ryun1 commented Jul 22, 2025

@mpizenberg

im also keen to move this along
happy to collaborate on this when possible 💪

@nazrhom
Copy link
Contributor Author

nazrhom commented Aug 8, 2025

Hi @Ryun1 @rphair I am sorry for not replying here sooner but have been busy with other work. Good news is I have received approval from MLabs to spend some time pushing this CIP forward: addressing comments, making the required changes, etc. So I am keen to pick this up. I am wrapping up another project but should be able to start making some progress here towards the end of August.

@mpizenberg I would be happy to collaborate with you on this!

@nazrhom
Copy link
Contributor Author

nazrhom commented Aug 8, 2025

@mkazlauskas Thank you very much for your feedback on the PR, I am sorry for the incredibly late reply. I will reply to each point in individual comments, but just wanted to thank you for looking into this!

@Ryun1 Ryun1 removed the State: Waiting for Author Proposal showing lack of documented progress by authors. label Sep 1, 2025
@Ryun1
Copy link
Collaborator

Ryun1 commented Sep 1, 2025

Putting this one into Review for CIP Editors meeting # 118 tomorrow💪 https://hackmd.io/@cip-editors/118

@rphair rphair added the State: Confirmed Candiate with CIP number (new PR) or update under review. label Sep 1, 2025
@mpizenberg
Copy link

@Ryun1 where can I find links to join the call (if that’s possible at all)?

@Ryun1
Copy link
Collaborator

Ryun1 commented Sep 1, 2025

@mpizenberg

where can I find links to join the call (if that’s possible at all)?

of course!
All meetings are via the CIPs discord (see invite)

meetings are every other Tuesday at 4pm UTC
see invite for tomorrow's call

Add extensions table
- `Refused`: (-3) The request was refused due to lack of access - e.g. wallet disconnects.
- `AccountChange`: (-4) The account has changed. The dApp should call wallet.enable() to reestablish connection to the new account. The wallet should not ask for confirmation as the user was the one who initiated the account change in the first place.
- `NotSatisfiable`: (-5) The request is structurally correct, but the wallet can not satisfy it for some reason.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would a new error be needed
for the case where a dApp requests a network at enable time
but the wallet is not connected to it?

nazrhom and others added 3 commits September 10, 2025 14:27
Co-authored-by: Robert Phair <[email protected]>
Add chainId to enable call. Also add new error type if the requested network is not avialable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Wallets Proposals belonging to the 'Wallets' category. State: Confirmed Candiate with CIP number (new PR) or update under review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants