Skip to content

Commit 2510bff

Browse files
committed
Migrate Credentials docs from opensource.ripple.com
Apply suggestions from @tequdev review Co-authored-by: tequ <git@tequ.dev> Add credential transactions and amendment to common links Add not-enabled warnings on Credentials docs.
1 parent 06ccef2 commit 2510bff

File tree

15 files changed

+629
-114
lines changed

15 files changed

+629
-114
lines changed

docs/_snippets/common-links.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,20 @@
6565
[CheckCreateトランザクション]: /docs/references/protocol/transactions/types/checkcreate.md
6666
[Checks amendment]: /resources/known-amendments.md#checks
6767
[Clawback amendment]: /resources/known-amendments.md#clawback
68+
[Clawbackの修正]: /resources/known-amendments.md#clawback
69+
[Credentials amendment]: /resources/known-amendments.md#credentials
70+
[CredentialCreate transaction]: /docs/references/protocol/transactions/types/credentialcreate.md
71+
[CredentialCreate transactions]: /docs/references/protocol/transactions/types/credentialcreate.md
72+
[CredentialCreate]: /docs/references/protocol/transactions/types/credentialcreate.md
73+
[CredentialCreateトランザクション]: /docs/references/protocol/transactions/types/credentialcreate.md
74+
[CredentialAccept transaction]: /docs/references/protocol/transactions/types/credentialaccept.md
75+
[CredentialAccept transactions]: /docs/references/protocol/transactions/types/credentialaccept.md
76+
[CredentialAccept]: /docs/references/protocol/transactions/types/credentialaccept.md
77+
[CredentialAcceptトランザクション]: /docs/references/protocol/transactions/types/credentialaccept.md
78+
[CredentialDelete transaction]: /docs/references/protocol/transactions/types/credentialdelete.md
79+
[CredentialDelete transactions]: /docs/references/protocol/transactions/types/credentialdelete.md
80+
[CredentialDelete]: /docs/references/protocol/transactions/types/credentialdelete.md
81+
[CredentialDeleteトランザクション]: /docs/references/protocol/transactions/types/credentialdelete.md
6882
[Crypto-Conditions Specification]: https://tools.ietf.org/html/draft-thomas-crypto-conditions-04
6983
[CryptoConditions amendment]: /resources/known-amendments.md#cryptoconditions
7084
[CryptoConditionsSuite amendment]: /resources/known-amendments.md#cryptoconditionssuite
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
3+
seo:
4+
description: Create and manage credentials on the blockchain, which can provide authorization for payments or other features, while respecting privacy and decentralization.
5+
status: not_enabled
6+
---
7+
# Credentials
8+
9+
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](../../concepts/accounts/depositauth.md)). 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.
10+
11+
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.
12+
13+
_(Requires the [Credentials amendment][] {% not-enabled /%})_
14+
15+
## Overview
16+
17+
_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.
18+
19+
This feature set is designed for an ecosystem of parties with the following roles:
20+
21+
- _Authorizers_ who want to limit specific actions or interactions to users who possess the correct credentials.
22+
- _Issuers_ who provide credentials to users who meet their criteria.
23+
- _Users_ who obtain credentials from issuers and use those credentials to interact with authorizers.
24+
25+
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:
26+
27+
- That a user is not a subject of sanctions by a particular nation or set of nations.
28+
- That a user has accredited investor status in the US.
29+
- That a user has reached a specific level in a particular video game.
30+
31+
### Uses
32+
33+
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.
34+
35+
Credentials stored in the XRP Ledger can also be used to authorize off-ledger activities, especially in association with a decentralized identifier.
36+
37+
## Usage Flow
38+
39+
A typical flow to use Credentials involves three parties with different roles, as described in the following example:
40+
41+
* 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.
42+
* Isabel is a credential issuer who vets accounts and issues credentials attesting that the accounts are who they say they are.
43+
* Alice is a user who wants to interact with Verity.
44+
45+
All three parties need XRP Ledger accounts. The flow works as follows:
46+
47+
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.
48+
2. Alice submits whatever documents are necessary to Isabel privately, off-chain.
49+
3. Isabel examines Alice's documents and creates a credential attesting to Alice's trustworthiness.
50+
4. Alice accepts the credential, making it valid.
51+
5. Alice can now interact with/send funds to Verity.
52+
53+
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.
54+
55+
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,19 +34,20 @@ 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
- [Get MPT Issuance Object](#get-mpt-issuance-object)
5253
- [Get MPToken Object](#get-mptoken-object)
@@ -56,9 +57,10 @@ In addition to the general fields above, you must specify *exactly 1* of the fol
5657
{% 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 %}
5758

5859

59-
### Get Ledger Object by ID
60+
### Get Ledger Entry by ID
61+
<a id="get-ledger-object-by-id"></a><!-- legacy ID -->
6062

61-
Retrieve any type of ledger object by its unique ID.
63+
Retrieve any type of ledger entry by its unique ID.
6264

6365
| Field | Type | Description |
6466
|:--------|:-------|:----------------------------------------------------------|
@@ -111,7 +113,8 @@ You can use this type of request to get any singleton ledger entry, if it exists
111113

112114

113115

114-
### Get AccountRoot Object
116+
### Get AccountRoot Entry
117+
<a id="get-accountroot-object"></a><!-- legacy ID -->
115118

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

@@ -158,7 +161,8 @@ rippled json ledger_entry '{ "account_root": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59
158161

159162

160163

161-
### Get AMM Object
164+
### Get AMM Entry
165+
<a id="get-amm-object"></a><!-- legacy ID -->
162166

163167
_(Added by the [AMM amendment][])_
164168

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

226230

227-
### Get Bridge Object
231+
### Get Bridge Entry
232+
<a id="get-bridge-object"></a><!-- legacy ID -->
228233

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

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

296301

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

299358
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.
300359

@@ -350,7 +409,8 @@ rippled json ledger_entry '{ "directory": { "owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwu
350409

351410

352411

353-
### Get Offer Object
412+
### Get Offer Entry
413+
<a id="get-offer-object"></a><!-- legacy ID -->
354414

355415
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.
356416

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

406466

407-
### Get Oracle Object
467+
### Get Oracle Entry
468+
<a id="get-oracle-object"></a><!-- legacy ID -->
408469

409470
_(Requires the [PriceOracle amendment][])_
410471

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

462523

463-
### Get RippleState Object
524+
### Get RippleState Entry
525+
<a id="get-ripplestate-object"></a><!-- legacy ID -->
464526

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

@@ -519,7 +581,8 @@ rippled json ledger_entry '{ "ripple_state": { "accounts": ["rf1BiGeXwwQoi8Z2ueF
519581

520582

521583

522-
### Get Check Object
584+
### Get Check Entry
585+
<a id="get-check-object"></a><!-- legacy ID -->
523586

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

@@ -564,7 +627,8 @@ rippled json ledger_entry '{ "check": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D79
564627

565628

566629

567-
### Get Escrow Object
630+
### Get Escrow Entry
631+
<a id="get-escrow-object"></a><!-- legacy ID -->
568632

569633
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.
570634

@@ -617,7 +681,8 @@ rippled json ledger_entry '{ "escrow": { "owner": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9
617681

618682

619683

620-
### Get PayChannel Object
684+
### Get PayChannel Entry
685+
<a id="get-paychannel-object"></a><!-- legacy ID -->
621686

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

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

663728

664-
### Get DepositPreauth Object
729+
### Get DepositPreauth Entry
730+
<a id="get-depositpreauth-object"></a><!-- legacy ID -->
665731

666732
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).
667733

668-
| Field | Type | Description |
669-
|:-----------------------------|:---------------------|:-----------------------|
670-
| `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. |
671-
| `deposit_preauth.owner` | String - [Address][] | _(Required if `deposit_preauth` is specified as an object)_ The account that provided the preauthorization. |
672-
| `deposit_preauth.authorized` | String - [Address][] | _(Required if `deposit_preauth` is specified as an object)_ The account that received the preauthorization. |
734+
| Field | Type | Required? | Description |
735+
|:-----------------------------|:---------------------|:----------|-------------|
736+
| `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. |
737+
| `deposit_preauth.owner` | String - [Address][] | Yes | The account that provided the preauthorization. |
738+
| `deposit_preauth.authorized` | String - [Address][] | No | The account that received the preauthorization. |
739+
| `deposit_preauth.authorized_credentials` | Array | No | A set of credentials that received the preauthorization. |
740+
741+
Each member of the `deposit_preauth.authorized_credentials` array, if provided, must include the following nested fields:
742+
743+
| Field | Type | Required? | Description |
744+
|:------------------|:---------------------|:----------|:------------|
745+
| `issuer` | String - [Address][] | Yes | The address of the account that issued the credential. |
746+
| `credential_type` | String - Hexadecimal | Yes | The type of the credential, as issued. |
673747

674748
{% tabs %}
675749

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

715789

716-
### Get Ticket Object
790+
### Get Ticket Entry
791+
<a id="get-ticket-object"></a><!-- legacy ID -->
717792

718793
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][])_
719794

0 commit comments

Comments
 (0)