Skip to content

Commit 52c3ac6

Browse files
committed
Migrate Credentials docs from opensource.ripple.com
1 parent 1b517c8 commit 52c3ac6

File tree

14 files changed

+599
-119
lines changed

14 files changed

+599
-119
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Credentials
2+
3+
The Credentials feature is a set of tools for managing authorization and compliance requirements using the XRP Ledger blockchain, while respecting privacy and decentralization. This feature extends and interconnects with other features of the XRP Ledger including [Deposit Authorization](https://xrpl.org/docs/concepts/accounts/depositauth). The goal of this feature is to streamline the process of compliance checks such as [KYC (Know Your Customer)](https://en.wikipedia.org/wiki/Know_your_customer) and to enable further trust-based applications within the XRP Ledger ecosystem.
4+
5+
The design of the Credentials standard draws from the [W3C Verifiable Credentials standard](https://www.w3.org/TR/vc-data-model-2.0/). It is intended to be compatible to an extent that makes sense in the context of the XRP Ledger. There are some differences in data structures and formatting: for example, the subject of a credential is identified by an XRP Ledger address rather than a URL.
6+
7+
## Overview
8+
9+
_Credentials_ are signed statements that can be stored in the ledger and can attest to a user's identity, legal status, or other status. This feature includes issuance, storage, and verification of credentials directly on the XRP Ledger, while still supporting the privacy needs of users.
10+
11+
This feature set is designed for an ecosystem of parties with the following roles:
12+
13+
- _Authorizers_ who want to limit specific actions or interactions to users who possess the correct credentials.
14+
- _Issuers_ who provide credentials to users who meet their criteria.
15+
- _Users_ who obtain credentials from issuers and use those credentials to interact with authorizers.
16+
17+
Each credential applies to a specific user's XRP Ledger account, and is attested by a specific credential issuer. The exact qualifications that a credential entails are open-ended, and defined by their issuers. They can range from trivial to serious, or broad to narrow. Some examples of things a credential could state:
18+
19+
- That a user is not a subject of sanctions by a particular nation or set of nations.
20+
- That a user has accredited investor status in the US.
21+
- That a user has reached a specific level in a particular video game.
22+
23+
### Uses
24+
25+
Within the XRP Ledger, you can use Deposit Authorization to automatically allow senders with the correct set of credentials, instead of approving sending accounts individually. Future amendments could further extend credentials to gate access to other features such as holding tokens, participating in lending pools, or contributing to an AMM.
26+
27+
Credentials stored in the XRP Ledger can also be used to authorize off-ledger activities, especially in association with a decentralized identifier.
28+
29+
## Usage Flow
30+
31+
A typical flow to use Credentials involves three parties with different roles, as described in the following example:
32+
33+
* Verity is a regulated business that wants to interact only with properly KYC'd accounts, to ensure legal compliance. This makes Verity an _authorizer_ because they configure which accounts are allowed (authorized) to interact with them.
34+
* Isabel is a credential issuer who vets accounts and issues credentials attesting that the accounts are who they say they are.
35+
* Alice is a user who wants to interact with Verity.
36+
37+
All three parties need XRP Ledger accounts. The flow works as follows:
38+
39+
1. Verity sets up their account so that only authorized accounts can interact with them. Since they trust Isabel to properly vet accounts and issue relevant credentials, they configure their account to accept credentials issued by Isabel.
40+
2. Alice submits whatever documents are necessary to Isabel privately, off-chain.
41+
3. Isabel examines Alice's documents and creates a credential attesting to Alice's trustworthiness.
42+
4. Alice accepts the credential, making it valid.
43+
5. Alice can now interact with/send funds to Verity.
44+
45+
Importantly, the documents that Alice sends to Isabel can include personally identifiable or private information that's needed to verify Alice's identity, but this information is never published or stored on the blockchain and Verity does not need to see it. Also, other businesses that trust Isabel can accept the same credentials so Alice does not need to repeatedly re-verify for every party she wants to interact with.
46+
47+
To revoke a credential, Isabel can delete it from the ledger. Alice can also delete her own credentials.

docs/references/http-websocket-apis/public-api-methods/ledger-methods/ledger_entry.md

Lines changed: 107 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,31 @@ In addition to the general fields above, you must specify *exactly 1* of the fol
3434
- [ledger\_entry](#ledger_entry)
3535
- [Request Format](#request-format)
3636
- [General Fields](#general-fields)
37-
- [Get Ledger Object by ID](#get-ledger-object-by-id)
38-
- [Get AccountRoot Object](#get-accountroot-object)
39-
- [Get AMM Object](#get-amm-object)
40-
- [Get Bridge Object](#get-bridge-object)
41-
- [Get DirectoryNode Object](#get-directorynode-object)
42-
- [Get Offer Object](#get-offer-object)
43-
- [Get Oracle Object](#get-oracle-object)
44-
- [Get RippleState Object](#get-ripplestate-object)
45-
- [Get Check Object](#get-check-object)
46-
- [Get Escrow Object](#get-escrow-object)
47-
- [Get PayChannel Object](#get-paychannel-object)
48-
- [Get DepositPreauth Object](#get-depositpreauth-object)
49-
- [Get Ticket Object](#get-ticket-object)
37+
- [Get Ledger Entry by ID](#get-ledger-entry-by-id)
38+
- [Get AccountRoot Entry](#get-accountroot-entry)
39+
- [Get AMM Entry](#get-amm-entry)
40+
- [Get Bridge Entry](#get-bridge-entry)
41+
- [Get Credential Entry](#get-credential-object)
42+
- [Get DirectoryNode Entry](#get-directorynode-object)
43+
- [Get Offer Entry](#get-offer-object)
44+
- [Get Oracle Entry](#get-oracle-object)
45+
- [Get RippleState Entry](#get-ripplestate-object)
46+
- [Get Check Entry](#get-check-object)
47+
- [Get Escrow Entry](#get-escrow-object)
48+
- [Get PayChannel Entry](#get-paychannel-object)
49+
- [Get DepositPreauth Entry](#get-depositpreauth-object)
50+
- [Get Ticket Entry](#get-ticket-object)
5051
- [Get NFT Page](#get-nft-page)
5152
- [Response Format](#response-format)
5253
- [Possible Errors](#possible-errors)
5354

5455
{% admonition type="warning" name="Caution" %}If you specify more than 1 of these type-specific fields in a request, the server retrieves results for only 1 of them. It is not defined which one the server chooses, so you should avoid doing this.{% /admonition %}
5556

5657

57-
### Get Ledger Object by ID
58+
### Get Ledger Entry by ID
59+
<a id="get-ledger-object-by-id"></a><!-- legacy ID -->
5860

59-
Retrieve any type of ledger object by its unique ID.
61+
Retrieve any type of ledger entry by its unique ID.
6062

6163
| Field | Type | Description |
6264
|:--------|:-------|:----------------------------------------------------------|
@@ -109,7 +111,8 @@ You can use this type of request to get any singleton ledger entry, if it exists
109111

110112

111113

112-
### Get AccountRoot Object
114+
### Get AccountRoot Entry
115+
<a id="get-accountroot-entry"></a><!-- legacy ID -->
113116

114117
Retrieve an [AccountRoot entry](../../../protocol/ledger-data/ledger-entry-types/accountroot.md) by its address. This is roughly equivalent to the [account_info method][].
115118

@@ -156,7 +159,8 @@ rippled json ledger_entry '{ "account_root": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59
156159

157160

158161

159-
### Get AMM Object
162+
### Get AMM Entry
163+
<a id="get-amm-entry"></a><!-- legacy ID -->
160164

161165
_(Added by the [AMM amendment][])_
162166

@@ -222,7 +226,8 @@ rippled json ledger_entry '{ "amm": { "asset": { "currency": "XRP" }, "asset2":
222226
[Try it! >](/resources/dev-tools/websocket-api-tool?server=wss%3A%2F%2Fs.devnet.rippletest.net%3A51233%2F#ledger_entry-amm)
223227

224228

225-
### Get Bridge Object
229+
### Get Bridge Entry
230+
<a id="get-bridge-object"></a><!-- legacy ID -->
226231

227232
_(Requires the [XChainBridge amendment][] {% not-enabled /%})_
228233

@@ -292,7 +297,61 @@ rippled json ledger_entry '{ "bridge_account": "rnQAXXWoFNN6PEqwqsdTngCtFPCrmfuq
292297
[Try it! >](/resources/dev-tools/websocket-api-tool?server=wss%3A%2F%2Fs.devnet.rippletest.net%3A51233%2F#ledger_entry-bridge)
293298

294299

295-
### Get DirectoryNode Object
300+
### Get Credential Entry
301+
302+
Retrieve a [Credential entry][], which represents an attestation by one account about another account.
303+
304+
| Field | Type | Required? | Description |
305+
|:-----------------------------|:---------------------|:----------|-------------|
306+
| `credential` | Object or String | Yes | Specify the Credential to retrieve. If a string, must be the [ledger entry ID][] of the entry, as hexadecimal. If an object, requires `subject`, `issuer`, and `credential_type` sub-fields. |
307+
| `credential.subject` | String - [Address][] | Yes | The account that is the subject of the credential. |
308+
| `credential.issuer` | String - [Address][] | Yes | The account that issued the credential. |
309+
| `credential.credential_type` | String - Hexadecimal | Yes | The type of the credential, as issued. |
310+
311+
WebSocket:
312+
313+
```json
314+
{
315+
"id": "example_get_credential",
316+
"command": "ledger_entry",
317+
"credential": {
318+
"subject": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8",
319+
"issuer": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
320+
"credential_type": "6D795F63726564656E7469616C"
321+
},
322+
"ledger_index": "validated"
323+
}
324+
```
325+
326+
JSON-RPC:
327+
328+
```json
329+
{
330+
"method": "ledger_entry",
331+
"params": [{
332+
"credential": {
333+
"subject": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8",
334+
"issuer": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
335+
"credential_type": "6D795F63726564656E7469616C"
336+
},
337+
"ledger_index": "validated"
338+
}]
339+
}
340+
```
341+
342+
Commandline:
343+
344+
```bash
345+
rippled json ledger_entry '{ "credential": {"subject": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8", "issuer": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX","credential_type": "6D795F63726564656E7469616C"}, "ledger_index": "validated" }'
346+
```
347+
348+
<!-- TODO: create working example in tool
349+
[Try it! >](/resources/dev-tools/websocket-api-tool#ledger_entry-credential)
350+
-->
351+
352+
353+
### Get DirectoryNode Entry
354+
<a id="get-directorynode-object"></a><!-- legacy ID -->
296355

297356
Retrieve a [DirectoryNode](../../../protocol/ledger-data/ledger-entry-types/directorynode.md), which contains a list of other ledger objects. Can be provided as string (object ID of the Directory) or as an object.
298357

@@ -348,7 +407,8 @@ rippled json ledger_entry '{ "directory": { "owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwu
348407

349408

350409

351-
### Get Offer Object
410+
### Get Offer Entry
411+
<a id="get-offer-object"></a><!-- legacy ID -->
352412

353413
Retrieve an [Offer entry](../../../protocol/ledger-data/ledger-entry-types/offer.md), which defines an offer to exchange currency. Can be provided as string (unique index of the Offer) or as an object.
354414

@@ -402,7 +462,8 @@ rippled json ledger_entry '{ "offer": { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJY
402462
[Try it! >](/resources/dev-tools/websocket-api-tool#ledger_entry-offer)
403463

404464

405-
### Get Oracle Object
465+
### Get Oracle Entry
466+
<a id="get-oracle-object"></a><!-- legacy ID -->
406467

407468
_(Requires the [PriceOracle amendment][])_
408469

@@ -458,7 +519,8 @@ rippled json ledger_entry '{ "oracle": { "account": "rNZ9m6AP9K7z3EVg6GhPMx36V4Q
458519
[Try it! >](/resources/dev-tools/websocket-api-tool?server=wss%3A%2F%2Fs.devnet.rippletest.net%3A51233%2F#ledger_entry-oracle)
459520

460521

461-
### Get RippleState Object
522+
### Get RippleState Entry
523+
<a id="get-ripplestate-object"></a><!-- legacy ID -->
462524

463525
Retrieve a [RippleState entry][], which tracks a (non-XRP) currency balance between two accounts.
464526

@@ -517,7 +579,8 @@ rippled json ledger_entry '{ "ripple_state": { "accounts": ["rf1BiGeXwwQoi8Z2ueF
517579

518580

519581

520-
### Get Check Object
582+
### Get Check Entry
583+
<a id="get-check-object"></a><!-- legacy ID -->
521584

522585
Retrieve a [Check entry](../../../protocol/ledger-data/ledger-entry-types/check.md), which is a potential payment that can be cashed by its recipient.
523586

@@ -562,7 +625,8 @@ rippled json ledger_entry '{ "check": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D79
562625

563626

564627

565-
### Get Escrow Object
628+
### Get Escrow Entry
629+
<a id="get-escrow-object"></a><!-- legacy ID -->
566630

567631
Retrieve an [Escrow entry](../../../protocol/ledger-data/ledger-entry-types/escrow.md), which holds XRP until a specific time or condition is met. Can be provided as string (object ID of the Escrow) or as an object.
568632

@@ -615,7 +679,8 @@ rippled json ledger_entry '{ "escrow": { "owner": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9
615679

616680

617681

618-
### Get PayChannel Object
682+
### Get PayChannel Entry
683+
<a id="get-paychannel-object"></a><!-- legacy ID -->
619684

620685
Retrieve a [PayChannel entry](../../../protocol/ledger-data/ledger-entry-types/paychannel.md), which holds XRP for asynchronous payments.
621686

@@ -659,15 +724,24 @@ rippled json ledger_entry '{ "payment_channel": "C7F634794B79DB40E87179A9D1BF05D
659724
[Try it! >](/resources/dev-tools/websocket-api-tool#ledger_entry-paychannel)
660725

661726

662-
### Get DepositPreauth Object
727+
### Get DepositPreauth Entry
728+
<a id="get-depositpreauth-object"></a><!-- legacy ID -->
663729

664730
Retrieve a [DepositPreauth entry](../../../protocol/ledger-data/ledger-entry-types/depositpreauth.md), which tracks preauthorization for payments to accounts requiring [Deposit Authorization](../../../../concepts/accounts/depositauth.md).
665731

666-
| Field | Type | Description |
667-
|:-----------------------------|:---------------------|:-----------------------|
668-
| `deposit_preauth` | Object or String | Specify the DepositPreauth to retrieve. If a string, must be the [ledger entry ID](../../../protocol/ledger-data/common-fields.md) of the DepositPreauth entry, as hexadecimal. If an object, requires `owner` and `authorized` sub-fields. |
669-
| `deposit_preauth.owner` | String - [Address][] | _(Required if `deposit_preauth` is specified as an object)_ The account that provided the preauthorization. |
670-
| `deposit_preauth.authorized` | String - [Address][] | _(Required if `deposit_preauth` is specified as an object)_ The account that received the preauthorization. |
732+
| Field | Type | Required? | Description |
733+
|:-----------------------------|:---------------------|:----------|-------------|
734+
| `deposit_preauth` | Object or String | Yes | Specify the DepositPreauth to retrieve. If a string, must be the [ledger entry ID][] of the DepositPreauth entry, as hexadecimal. If an object, requires `owner` sub-field and either `authorized` or `authorize_credentials` sub-field. |
735+
| `deposit_preauth.owner` | String - [Address][] | Yes | The account that provided the preauthorization. |
736+
| `deposit_preauth.authorized` | String - [Address][] | No | The account that received the preauthorization. |
737+
| `deposit_preauth.authorized_credentials` | Array | No | A set of credentials that received the preauthorization. |
738+
739+
Each member of the `deposit_preauth.authorized_credentials` array, if provided, must include the following nested fields:
740+
741+
| Field | Type | Required? | Description |
742+
|:------------------|:---------------------|:----------|:------------|
743+
| `issuer` | String - [Address][] | Yes | The address of the account that issued the credential. |
744+
| `credential_type` | String - Hexadecimal | Yes | The type of the credential, as issued. |
671745

672746
{% tabs %}
673747

@@ -711,7 +785,8 @@ rippled json ledger_entry '{ "deposit_preauth": { "owner": "rf1BiGeXwwQoi8Z2ueFY
711785
[Try it! >](/resources/dev-tools/websocket-api-tool#ledger_entry-depositpreauth)
712786

713787

714-
### Get Ticket Object
788+
### Get Ticket Entry
789+
<a id="get-ticket-object"></a><!-- legacy ID -->
715790

716791
Retrieve a [Ticket entry](../../../protocol/ledger-data/ledger-entry-types/ticket.md), which represents a [sequence number][] set aside for future use. _(Added by the [TicketBatch amendment][])_
717792

0 commit comments

Comments
 (0)