Decentralized Identifiers (DIDs)
Decentralized Identifiers (DIDs) are a cornerstone of the ArcBlock ecosystem, providing a universal and unique addressing system for virtually any entity on the blockchain. Unlike traditional systems where identifiers are limited to users, ArcBlock extends DIDs to represent accounts, tokens, NFTs, applications, and more. This approach creates a cohesive and interconnected digital environment.
These DIDs are designed to be compatible with the W3C DID Core specification, ensuring they are built on open standards. Understanding how DIDs are structured and generated is fundamental to interacting with other core concepts like Wallets and Accounts and Non-Fungible Tokens (NFTs).
DID Notation#
A typical DID on the ArcBlock platform follows a standardized format. Here is an example:
did:abt:z1muQ3xqHQK2uiACHyChikobsiY5kLqtShA
This string can be broken down into three parts:
Part | Example | Description |
---|---|---|
Scheme |
| A standard prefix indicating that this is a DID. |
Method |
| Specifies the ArcBlock DID method. |
Method-Specific ID |
| The unique identifier string, generated using a flexible set of cryptographic algorithms. |
While other blockchains like Bitcoin and Ethereum use fixed hashing algorithms (e.g., secp256k1) to generate addresses, ArcBlock allows developers to choose the combination of algorithms for public key encryption, hashing, and encoding. This information is embedded directly into the DID itself.
DID Type#
The flexibility of ArcBlock DIDs is encoded within the "DID Type," a 2-byte (16-bit) segment at the beginning of the DID's binary representation. This type information specifies the exact combination of algorithms used to generate and secure the DID.
The 16 bits are allocated as follows:
For example, a DID type of 0x0C01
is interpreted as:
Binary | Hex | Value | Interpretation |
---|---|---|---|
| 0x03 | 3 | RoleType: |
| 0x00 | 0 | KeyType: |
| 0x01 | 1 | HashType: |
This embedded information makes each DID self-describing, allowing any system to understand how to interact with it without needing out-of-band configuration.
DID Generation Algorithm#
The process of creating a DID from a secret key involves a series of cryptographic steps. The following diagram illustrates the workflow:
This multi-step process, which includes a checksum, ensures that DIDs are not only unique but also verifiable and resistant to transcription errors.
Appendix: Type Definitions#
The following tables provide a comprehensive list of the available types that can be combined to create a DID. These are derived from the core protocol definitions.
RoleType#
RoleType
defines the intended purpose of the DID.
Name | Value | Description |
---|---|---|
| 0 | Represents a user or entity account. |
| 1 | Represents a node in the network. |
| 2 | Represents a device. |
| 3 | Represents an application. |
| 4 | Represents a smart contract. |
| 5 | Represents an automated agent or bot. |
| 6 | Represents a non-fungible asset (NFT). |
| 7 | Represents a stake transaction or state. |
| 8 | Represents a validator node. |
| 9 | Represents a group of accounts. |
| 10 | Represents a transaction. |
| 11 | Represents a tethered resource. |
| 12 | Represents an atomic swap transaction. |
| 13 | Represents a delegation. |
| 14 | Represents a Verifiable Credential. |
| 15 | Represents a Blocklet. |
| 16 | Represents a store. |
| 17 | Represents a fungible token. |
| 18 | Represents a factory for creating assets or other entities. |
| 19 | Represents an ArcBridge (rollup) chain. |
| 20 | Represents a storage service. |
| 63 | Represents any role type. |
KeyType#
KeyType
specifies the cryptographic algorithm used for public/private key pairs.
Name | Value | Description |
---|---|---|
| 0 | Ed25519 signature algorithm. |
| 1 | The algorithm used by Bitcoin and others. |
| 2 | An Ethereum-compatible key type. |
HashType#
HashType
defines the hashing function used in the generation process.
Name | Value | Description |
---|---|---|
| 0 | Keccak hashing algorithm. |
| 1 | SHA-3 (Secure Hash Algorithm 3). |
| 2 | SHA-2 (Secure Hash Algorithm 2). |
| 6 | Keccak with a 384-bit output. |
| 7 | SHA-3 with a 384-bit output. |
| 13 | Keccak with a 512-bit output. |
| 14 | SHA-3 with a 512-bit output. |
With a solid understanding of how DIDs function as the foundational identity layer, you are now ready to explore what these identities can create and own. To learn more, proceed to the next section on Non-Fungible Tokens (NFTs).