-
Notifications
You must be signed in to change notification settings - Fork 211
CAIP-XXX: Chain-Agnostic Wallet Address Request URI Scheme #366
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
base: main
Are you sure you want to change the base?
CAIP-XXX: Chain-Agnostic Wallet Address Request URI Scheme #366
Conversation
CAIPs/caip-xxx.md
Outdated
|
|
||
| Implementations should: | ||
|
|
||
| Register `wallet:` URI handlers. |
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.
yowza!
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.
What do you mean by this? I'd be happy to use any other chain-agnostic URI but I haven't seen one anywhere. Is there a better way?
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.
there's a couple, but it's the same amount of work distributed across difference governance surfaces, debatably 😅
i think konrad probably already sent you this, but preserving it here for future martian anthropologists:
https://kkonrad.substack.com/p/stop-inventing-custom-uris-use-urls
let's talk tomorrow on zoom and figure out what version of this is most productive for ya!
|
Hey! So, to answer your question, I think an array might be nice, because it's pretty bad UX to send back your preferred address only to have... nothing happen because the dapp/POS-machine/etc doesn't speak that chain/namespace. I would probably prefer "ranked by preference" (from most to least preferred) since JSON (and by extension JSON-RPC) doesn't canonicalize/sort arrays by default when serializing, but that may be a minority view, some people hate the overdetermining/re-semanticizing of JSON array order, which can be unstable (or force-sorted in some programming languages or frameworks). More broadly, though, I'm a little confused here on the context. It feels like you're defining a genuinely useful API/handle-able URI protocol, but
|
|
I like the idea of using This is more of a call/response protocol. Also thinking it could be Do you have any examples of other CAIP's I could follow to define a protocol separately? I'm not sure how to do that. |
|
Interesting approach! Have you seen #358? It handles the problem in a different way |
|
@lukaisailovic this is great! This seems like it would be a great next step after requesting the wallet address, as then the requester could look up the senders tokens and send a CAIP-358 request for any tokens that the sender has that the requester supports. Without knowing what tokens the sender has available it seems like a shot in the dark with the exponentially growing number of tokens/chains out there. Which is why I think it helps a lot to gather that information first. |
|
@timjrobinson The goal of 358 was intentionally not to request the address beforehand. It allows the recipient to specify which tokens are accepted and then wallet to complete the request in any one of them. It eliminates one more round trip, which is significant for the speed of checkout. Also we can make some assumptions, like most likely token will be stablecoin, chains etc and growing number of wallets support some aspect of Chain/Token Abstraction (swap before execute) which makes it extremely likely for wallet to complete at least one of the payment requests. |
|
|
||
| ## Rationale | ||
|
|
||
| This allows a user to use NFC or other simple intent methods to provide their wallet address without manual copying, scanning, or complex integrations. The [CAIP-10][] standard is chosen as it clearly indicates the blockchain namespace and reference. |
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 allows a user to use NFC or other simple intent methods to provide their wallet address without manual copying, scanning, or complex integrations. The [CAIP-10][] standard is chosen as it clearly indicates the blockchain namespace and reference. | |
| This allows a user to use NFC or other transports as a channel over which an application can query and a wallet can provideaddress without manually copying, scanning, or complex integrations. The [CAIP-10][] standard is chosen as it clearly indicates the blockchain namespace and reference. |
|
|
||
| ## Motivation | ||
|
|
||
| Currently there is no way for a service to request an address from a wallet in a chain agnostic way. This makes chain agnostic payments hard because the requester does not know what chains/tokens the payer supports before sending out a payment request. By requesting a wallet address the requester can look up the payers available tokens out of band (or via something like [EIP-7811][]) and then send them an appropriate chain-specific payment request. |
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.
| Currently there is no way for a service to request an address from a wallet in a chain agnostic way. This makes chain agnostic payments hard because the requester does not know what chains/tokens the payer supports before sending out a payment request. By requesting a wallet address the requester can look up the payers available tokens out of band (or via something like [EIP-7811][]) and then send them an appropriate chain-specific payment request. | |
| Currently there is no way for a service to request an address from a wallet in a chain-agnostic way, except in the negotiations to open a CAIP-25 connection. This makes chain agnostic payments hard because the requester does not know what chains/tokens the payer supports before sending out a payment request. By requesting a wallet address the requester can look up the payers available tokens out of band (or via something like [EIP-7811][]) and then send them an appropriate chain-specific payment request. |
|
|
||
| ## Abstract | ||
|
|
||
| This CAIP introduces a chain-agnostic URI command (`web3://wallet_getAccounts`) designed to request an array of wallet addresses from any wallet application or service. It returns an array of standardised CAIP-10 format wallet addresses, which clearly specifies the blockchain namespace, chain reference, and wallet address. |
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.
If this is an NFC-only or transport-agnostic protocol, the abstract should probably mention it!
And either way, a # Test Cases section (with both success cases and failure cases) would help, to make explicit what this query/return actually looks like as an NFC exchange, a JSON-RPC call/response, an HTTP GET/response, etc.
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.
@timjrobinson did you get any interest from implementers to take this over the line? I feel like it's 99% of the way there, just a few gaps to make this worth publishing as a draft to leave a hook in the [more public] water[s]...
Co-authored-by: Bumblefudge <[email protected]>
This CAIP adds a chain agnostic
wallet:addressURI for wallets, which they respond to with their CAIP-10 address.I created this for a real life payment terminal to be able to request via NFC the customers wallet address so that it can determine the best chain/token to send a payment request for. Without this URI the merchant is unable to know what assets a customer has to pay with and so cannot send a good payment request.
Open Question: Should this be
wallet:addressesand wallets can return more than one address? How should that be formatted, comma separated?