new did doc branch

This commit is contained in:
Oliver Eggert
2023-12-15 22:06:28 -08:00
parent ca0c678ea5
commit 51c4ac8ea5
7 changed files with 301 additions and 0 deletions

View File

@@ -207,6 +207,7 @@
"DeletableAccounts",
"DepositAuth",
"DepositPreauth",
"DID",
"DisallowIncoming",
"EnforceInvariants",
"Escrow",

View File

@@ -0,0 +1,82 @@
---
html: decentralized-identifiers.html
parent: accounts.html
blurb: Decentralized identifiers enable verifiable, decentralized digital identities.
status: not_enabled
labels:
- DID
---
# Decentralized Identifiers
_(Requires the [DID amendment][] :not_enabled:)_
A Decentralized Identifier (DID) is a new type of identifier defined by the World Wide Web Consortium (W3C) that enables verifiable, digital identities. DIDs are fully under the control of the DID owner, independent from any centralized registry, identity provider, or certificate authority.
The key principles of a DID are:
- **Decentralization:** No central issuing agency controls the DID, enabling the owner to update, resolve, or deactivate it.
- **Cryptographically Verifiable:** DIDs are verified through cryptographic proofs, making them tamper-evident and secure.
- **Interoperability:** DIDs are open to any solution that recognizes the W3C DID standard. This means a DID can be used to authenticate and establish trust in various digital transactions and interactions.
**Note:** The implementation of DIDs on the XRP Ledger conforms to the requirements in the [DID v1.0 specification](https://www.w3.org/TR/did-core/).
## How It Works
1. An XRPL account holder generates a DID that is controlled by the account.
2. The DID is associated with a DID document as defined by W3C specifications.
3. The DID is used for digital tasks such as:
- Signing digital documents.
- Making secure online transactions.
- Logging into websites.
4. The verifier resolves the DID to its document to verify the subject's identity.
## DID Documents
DID documents contain the necessary information to cryptographically verify the identity of the subject described by a DID document. The subject can be a person, organization, or thing. For example, a DID document could contain cryptographic public keys that the DID subject can use to authenticate itself and prove its association with the DID.
**Note:** DID documents usually serialize to a JSON or JSON-LD representation.
On the XRP Ledger, there are several ways to associate a DID to a DID document:
1. Store a reference to the document in the `URI` field of the `DID` object, which points to a document stored on another decentralized storage network, such as IPFS or STORJ.
2. Store a minimal DID document in the `DIDDocument` field of the `DID` object.
3. Specify a minimal _implicit_ DID document generated from the DID and other available public information.
**Note:** Simpler use cases may only need signatures and simple authorization tokens. In cases where there isn't explicitly a DID document on the ledger, an implicit document is used instead. For example, the implicit DID Document of `did:xrpl:1:0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020` enables only a single key `0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020` to authorize changes on the DID document or sign credentials in the name of the DID.
### Sample XRPL DID Document
```json
{
"@context": "https://w3id.org/did/v1",
"id": "did:xrpl:1:rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"publicKey": [
{
"id": "did:xrpl:1:rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn#keys-1",
"type": ["CryptographicKey", "EcdsaKoblitzPublicKey"],
"curve": "secp256k1",
"expires": 15674657,
"publicKeyHex": "04f42987b7faee8b95e2c3a3345224f00e00dfc67ba882..."
}
]
}
```
To learn more about the core properties of a DID document, see: [Decentralized Identifiers (DIDs) v1.0](https://www.w3.org/TR/did-core/#core-properties).
## Privacy and Security Concerns
- Whoever controls the private keys of an XRPL account, controls the DID and reference to the DID document it resolves to. Take care to ensure your private keys aren't compromised.
- You can include any content in a DID document, but should limit it to verification methods and service points. Since DIDs on XRPL can be resolved by anyone, you shouldn't include any personal information.
- IPFS allows anyone to store content on the nodes in a distributed network. A common misconception is that anyone can edit that content; however, the content-addressability of IPFS means any edited content will have a different address from the original. While any entity can copy a DID document anchored with an XRPL account's `DIDDocument` or `URI` fields, they can't change the document itself unless they control the private key that created the corresponding `DID` object.
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}
{% include '_snippets/tx-type-links.md' %}
{% include '_snippets/rippled_versions.md' %}

View File

@@ -0,0 +1,71 @@
---
html: did.html
parent: ledger-entry-types.html
blurb: The definition and details of a Decentralized Identifier (DID).
labels:
- DID
status: not_enabled
---
# DID
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/protocol/impl/LedgerFormats.cpp#L330-L341 "Source")
_(Requires the [DID amendment][] :not_enabled:)_
A `DID` ledger entry holds references to, or data associated with, a single [DID](decentralized-identifiers.html).
## Example DID JSON
```json
{
"Account": "rpfqJrXg5uidNo2ZsRhRY6TiF1cvYmV9Fg",
"DIDDocument": "646F63",
"Data": "617474657374",
"Flags": 0,
"LedgerEntryType": "DID",
"OwnerNode": "0",
"PreviousTxnID": "A4C15DA185E6092DF5954FF62A1446220C61A5F60F0D93B4B09F708778E41120",
"PreviousTxnLgrSeq": 4,
"URI": "6469645F6578616D706C65",
"index": "46813BE38B798B3752CA590D44E7FEADB17485649074403AD1761A2835CE91FF"
}
```
## DID Fields
In addition to the [common fields](ledger-entry-common-fields.html), `{{currentpage.name}}` entries have the following fields:
| Field | JSON Type | [Internal Type][] | Required? | Description |
|:--------------------|:----------|:------------------|:----------|--------------|
| `Account` | String | AccountID | Yes | The account that controls the DID. |
| `DIDDocument` | String | Blob | No | The W3C standard DID document associated with the DID. The `DIDDocument` field isn't checked for validity and is limited to a maximum length of 256 bytes. |
| `Data` | String | Blob | No | The public attestations of identity credentials associated with the DID. The `Data` field isn't checked for validity and is limited to a maximum length of 256 bytes. |
| `LedgerEntryType` | String | UInt16 | Yes | The value `0x0049`, mapped to the string `DID`, indicates that this object is a DID object. |
| `OwnerNode` | String | UInt64 | Yes | A hint indicating which page of the sender's owner directory links to this entry, in case the directory consists of multiple pages. |
| `PreviousTxnID` | String | Hash256 | Yes | The identifying hash of the transaction that most recently modified this object. |
| `PreviousTxnLgrSeq` | Number | UInt32 | Yes | The index of the ledger that contains the transaction that most recently modified this object. |
| `URI` | String | Blob | No | The Universal Resource Identifier that points to the corresponding DID document or the data associated with the DID. This field can be an HTTP(S) URL or IPFS URI. This field isn't checked for validity and is limited to a maximum length of 256 bytes. |
## {{currentpage.name}} Reserve
The account that creates the `{{currentpage.name}}` object incurs one owner reserve.
## {{currentpage.name}} Flags
There are no flags defined for `{{currentpage.name}}` entries.
## DID ID Format
The ID of a `DID` entry is the [SHA-512Half][] of the following values, concatenated in order:
1. The `DID` space key (`0x0049`).
2. The AccountID that controls the DID.
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}
{% include '_snippets/tx-type-links.md' %}
{% include '_snippets/rippled_versions.md' %}

View File

@@ -0,0 +1,46 @@
---
html: diddelete.html
parent: transaction-types.html
blurb: Delete a DID.
labels:
- DID
status: not_enabled
---
# DIDDelete
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/DID.cpp "Source")
_(Requires the [DID amendment][] :not_enabled:)_
Delete the [DID ledger entry](did.html) associated with the specified `Account` field.
**Note:** This transaction only uses the [common fields][].
## Example {{currentpage.name}} JSON
```json
{
"TransactionType": "DIDDelete",
"Account": "rp4pqYgrTAtdPHuZd1ZQWxrzx45jxYcZex",
"Fee": "12",
"Sequence": 391,
"SigningPubKey":"0293A815C095DBA82FAC597A6BB9D338674DB93168156D84D18417AD509FFF5904",
"TxnSignature":"3044022011E9A7EE3C7AE9D202848390522E6840F7F3ED098CD13E..."
}
```
## Error Cases
Besides errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
| Error Code | Description |
|:--------------------|:---------------------------------------------|
| `tecNO_ENTRY` | The account doesn't have a DID. |
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}
{% include '_snippets/tx-type-links.md' %}
{% include '_snippets/rippled_versions.md' %}

View File

@@ -0,0 +1,58 @@
---
html: didset.html
parent: transaction-types.html
blurb: Create or update a DID.
labels:
- DID
status: not_enabled
---
# DIDSet
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/DID.cpp "Source")
_(Requires the [DID amendment][] :not_enabled:)_
Creates a new [DID ledger entry](did.html) or updates the fields of an existing one.
## Example {{currentpage.name}} JSON
```json
{
"TransactionType": "DIDSet",
"Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Fee": "10",
"Sequence": 391,
"URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469",
"Data": "",
"SigningPubKey":"0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020"
}
```
{% include '_snippets/tx-fields-intro.md' %}
| Field | JSON Type | [Internal Type][] | Required? | Description |
|:--------------|:----------|:------------------|:----------|:------------|
| `Data` | String | Blob | No | The public attestations of identity credentials associated with the DID. |
| `DIDDocument` | String | Blob | No | The DID document associated with the DID. |
| `URI` | String | Blob | No | The Universal Resource Identifier associated with the DID. |
You must include either `Data`, `DIDDocument`, or `URI` when you submit the `DIDSet` transaction. If all three fields are missing, the transaction fails.
**Note:** To delete the `Data`, `DIDDocument`, or `URI` field from an existing DID ledger entry, add the field as an empty string.
## Error Cases
Besides errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
| Error Code | Description |
|:--------------------|:---------------------------------------------|
| `tecEMPTY_DID` | The transaction will create an empty DID ledger entry. Check that your updates don't remove the `Data`, `DIDDocument`, and `URI` fields. |
| `temEMPTY_DID` | The transaction is malformed and missing any DID information. Include either the `Data`, `DIDDocument`, or `URI` fields. |
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}
{% include '_snippets/tx-type-links.md' %}
{% include '_snippets/rippled_versions.md' %}

View File

@@ -16,6 +16,7 @@ The following is a comprehensive list of all known [amendments](amendments.html)
| Name | Introduced | Status |
|:----------------------------------|:-----------|:------------------------------|
| [DID][] | v2.0.0 | [Open for Voting: 2023-12-04](https://xrpl.org/blog/2023/rippled-2.0.0.html "BADGE_80d0e0") |
| [AMM][] | v1.12.0 | [Open for Voting: 2023-09-06](https://xrpl.org/blog/2023/rippled-1.12.0.html "BADGE_80d0e0") |
| [Clawback][] | v1.12.0 | [Open for Voting: 2023-09-06](https://xrpl.org/blog/2023/rippled-1.12.0.html "BADGE_80d0e0") |
| [XRPFees][] | v1.10.0 | [Open for Voting: 2023-03-14](https://xrpl.org/blog/2023/rippled-1.10.0.html "BADGE_80d0e0") |
@@ -105,6 +106,28 @@ The following is a list of known [amendments](amendments.html) that have been re
## Details about Known Amendments
### DID
[DID]: #did
| Amendment | DID |
|:-------------|:----|
| Amendment ID | TBD |
| Status | Open for Voting |
| Default Vote (Latest stable release) | No |
| Pre-amendment functionality retired? | No |
Adds to the ledger Decentralized Identifier (DID) functionality that conforms to the [World Wide Web Consortium](https://www.w3.org/press-releases/2022/did-rec/) standard. DIDs provide a digital identity, not dependent on a centralized authority and controlled by the DID subject.
Adds new transactions:
- DIDDelete - Delete the DID associated with your XRPL account.
- DIDSet - Create a new DID or update an existing one.
Adds a new `DID` ledger entry type.
Adds several new transaction result codes.
### AMM
[AMM]: #amm

View File

@@ -1366,6 +1366,11 @@ pages:
targets:
- ja
- md: concepts/accounts/decentralized-identifiers.md
targets:
- en
- ja
## REDIRECTS FROM OLD CONCEPT PAGES/LANDINGS -------------------------------
- name: Intro to Consensus
@@ -2429,6 +2434,11 @@ pages:
targets:
- ja
- md: references/protocol/ledger-data/ledger-entry-types/did.md
targets:
- en
- ja
- md: references/protocol/ledger-data/ledger-entry-types/directorynode.md
targets:
- en
@@ -2655,6 +2665,16 @@ pages:
targets:
- ja
- md: references/protocol/transactions/types/diddelete.md
targets:
- en
- ja
- md: references/protocol/transactions/types/didset.md
targets:
- en
- ja
- md: references/protocol/transactions/types/escrowcancel.md
targets:
- en