Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d75e96d
constrain to CAIP-25 session explicitly
Mar 2, 2023
4c4ae73
typo
bumblefudge Mar 3, 2023
be1aa1c
typo
bumblefudge Mar 3, 2023
95c5268
strawman CAIP-217
Mar 29, 2023
407691f
fine-tuning simple CAIP-217
Mar 29, 2023
2e54eaa
simplified CAIP-27
Mar 29, 2023
aa9506d
simplified CAIP-25
Mar 29, 2023
ac80b88
typo
bumblefudge Apr 5, 2023
e79a945
formatting tweak
bumblefudge Apr 5, 2023
0ef0acc
typo
bumblefudge Apr 5, 2023
03884a6
typo
bumblefudge Apr 5, 2023
9300226
typo
bumblefudge Apr 5, 2023
c1aaf10
language fine-tuning
Apr 6, 2023
f3cb8fc
make accounts optionality and semantics more explicit
Apr 12, 2023
66b56ff
make informational version of CAIP-211
Apr 12, 2023
859551d
add abstract to informational version of CAIP-211
Apr 12, 2023
d92e474
add wallet methods to caip-25
pedrouid Apr 13, 2023
48e0e3d
typo
pedrouid Apr 13, 2023
01459af
resolve
pedrouid Apr 13, 2023
555c005
fine-tune abstract
Apr 13, 2023
7f4801b
typo
Apr 13, 2023
5afcb22
Merge pull request #224 from ChainAgnostic/feat/caip-25-include-examp…
pedrouid Apr 13, 2023
0e72bb6
add security considerations with negotiation example
Apr 13, 2023
0fea9db
resolve conflicts
Apr 13, 2023
8a92f2b
to clarify scopes object semantics
May 19, 2023
5076373
to clarify the syntax of string to which each object is keyed
May 19, 2023
1037853
to clarify the semantics of the whole object in # spec section
May 19, 2023
96e7760
to clarify that responses are specified per namespace, not here
May 19, 2023
5097a2d
to clarify that 2 of 3 options in caip25 example are corner cases
May 19, 2023
0de8414
remove hard requirement on as-yet unmergeddefined CAIP-170
May 19, 2023
e45f802
restore property 5 in caip171
May 19, 2023
5fcdf9b
Merge branch 'master' into feat/update-caip27-to-be-constrained-by-25
bumblefudge May 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 27 additions & 17 deletions CAIPs/caip-27.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,28 @@ discussions-to: https://github.com/ChainAgnostic/CAIPs/pull/27
status: Draft
type: Standard
created: 2020-12-12
updated: 2022-11-16
updated: 2023-03-02
requires: ["2", "25", "171"]
---

## Simple Summary

CAIP-27 defines a standard JSON-RPC method for requesting methods mapped to a
target chain.
CAIP-27 defines a standard JSON-RPC method for routing method calls through a
CAIP-25 session object.

## Abstract

This proposal has the goal to define a standard method for decentralization
applications to request JSON-RPC methods from cryptocurrency wallets directed to
a given target chain.
applications to request JSON-RPC methods from user agents (such as
cryptocurrency wallets) directed to a given previously-authorized target network
(such as a specific blockchain).

## Motivation

The motivation comes from the ambiguity that comes from interfacing with
multi-chain cryptocurrency wallets which may support the same methods for
different chains and there is no indication of the chain that is being targeted
by the decentralized application.
The motivation comes from the ambiguity that comes from interfacing with a
multi-network agent (e.g. a cryptocurrency wallets which supports the same
method on multiple chains in a namespace, or supports methods with the same name
on multiple namespaces).

## Specification

Expand All @@ -44,8 +45,9 @@ The application would interface with a provider to make request as follows:
"jsonrpc": "2.0",
"method": "caip_request",
Comment thread
bumblefudge marked this conversation as resolved.
Outdated
"params": {
"chainId": "eip155:1",
"session": "0xdeadbeef",
Comment thread
bumblefudge marked this conversation as resolved.
Outdated
"scope": "eip155",
"chainId": "eip155:1",
Comment thread
bumblefudge marked this conversation as resolved.
Outdated
"request": {
"method": "personal_sign",
"params": [
Expand All @@ -57,15 +59,23 @@ The application would interface with a provider to make request as follows:
}
```

The JSON-RPC method is labelled as `caip_request` and expects three parameters:
The JSON-RPC method is labelled as `caip_request` and expects
Comment thread
bumblefudge marked this conversation as resolved.
Outdated
three **required parameters** and
one *optional parameter*:

- chainId - [CAIP-2][]-defined `chainId` to identify both a namespace and a
specific chain or network within it
- session - [CAIP-171][] `SessionToken` to identify the session opened or
- **session** - [CAIP-171][] `SessionToken` to identify the session opened or
updated by a [CAIP-25][] interaction.
- request - an object containing the fields:
- method - JSON-RPC method to request
- params - JSON-RPC parameters to request
- **scope** - a `scopeObject` authorized by a [CAIP-25][] response and persisted in
the session by both caller and respondent
- *chainId* - [CAIP-2][]-defined `chainId` including both namespace and a
Comment thread
pedrouid marked this conversation as resolved.
Outdated
specific chain or network within it, if `scope` is an entire namespace
- **request** - an object containing the fields:
- **method** - JSON-RPC method to request
- **params** - JSON-RPC parameters to request (may be empty but must be set)

NOTE: a respondent MUST check the scope, chainId (if application), and method
against their [CAIP-25][] session object before executing or responding to such
a request.

### Response

Expand Down