The did:ndc Method Specification

A W3C DID Method for the NDA Chain Verifiable Data Registry

1. Introduction

The did:ndc method provides decentralized identifiers for individuals, organizations, assets, and other entities participating in national data management, public administration, and government-authorized activities. It is designed for the government and public-sector identity ecosystem governed and operated by the National Data Center (NDC).

Although did:ndc and did:nda use the same underlying infrastructure, including the NDA Chain blockchain and Verifiable Data Registry (VDR), they serve different identity ecosystems. did:nda supports civilian, commercial, and digital-economy use cases under the governance of the National Data Association, while did:ndc supports identities that require government authority, official accountability, and compliance with applicable laws and regulations. Separate method names make the governing authority, issuance policies, and trust framework of a DID explicit.

The existence of two separate DID methods is therefore intentional. The did:nda and did:ndc prefixes distinguish the identity ecosystem and origin of each DID, allowing users and systems to understand whether it belongs to the civilian and commercial ecosystem or the government and public-sector ecosystem. This distinction makes it possible to apply the appropriate governance framework, issuance and authorization policies, lifecycle-management rules, and trust requirements when a DID is created, resolved, or used.

This system follows W3C DID standards and uses a hybrid architecture: the NDA Chain provides an authoritative record of DID-related data, while richer DID Documents are stored in the VDR and retrieved through the resolver service. This approach combines verifiability and portability with the governance, authorization, and lifecycle-management requirements of public-sector identities.

Resolution is handled by a dedicated resolver service, ensuring that DID Documents are retrievable without querying the blockchain directly for all data, which enhances privacy and efficiency.

2. DID Method Name

The registered method is ndc.

A valid DID starts with:

did:ndc:

3. DID Syntax

A did:ndc DID is formed by the method prefix and a unique identifier derived from an NDA Chain blockchain address.

Regex:

^did:ndc:0x[0-9a-fA-F]{40}$

ABNF:

did-ndc              = "did:ndc:" method-specific-id
method-specific-id   = "0x" 40*HEXDIG
HEXDIG               = DIGIT / "a" / "b" / "c" / "d" / "e" / "f" / "A" / "B" / "C" / "D" / "E" / "F"
DIGIT                = %x30-39

4. Method Operations (CRUD)

This method supports Create, Read, Update and Deactivate operations.

Create (Register)

The creation of a did:ndc Decentralized Identifier involves two phases:
First - generating the identifier and the initial document off-chain,
Second - registering the DID on the NDAChain.

Phase 1: Off-Chain Generation (Identifier & Document)

A did:ndc is implicitly created when a user generates a new ECDSA secp256k1 key pair. This process is performed entirely off-chain. The DID identifier is derived deterministically from the public key using standard Ethereum address generation logic.

The Derivation Algorithm:

  1. Generate Private Key: Create a cryptographically secure 32-byte private key.
  2. Derive Public Key: Calculate the uncompressed public key (65 bytes, starting with 0x04).
  3. Hash: Apply the Keccak-256 hashing algorithm to the last 64 bytes of the public key.
  4. Truncate: Take the last (lowest-order) 20 bytes of the resulting hash.
  5. Address Generation (Encode): Convert these 20 bytes into a 42-character hexadecimal string. This string represents the Account Address and MUST include the 0x prefix (e.g., 0x3f1a...).
  6. Format: Prepend did:ndc: to the Account Address to form the final DID.

Example:

Account Address: 0x3f1a5c2e8b9d7f6a4c1b9e8d7c6b5a49382716f5
Final DID: did:ndc:0x3f1a5c2e8b9d7f6a4c1b9e8d7c6b5a49382716f5

Document Creation & Storage:
The DID Document associated with the DID is generated locally. The document supports the EcdsaSecp256k1VerificationKey2019 verification method. It is stored in the VDR's off-chain database, while the corresponding DID registration information is published to the NDA Chain. When the DID is resolved, the resolver uses this registration information to locate and return the document from the VDR.

Phase 2: On-Chain Registration

The issuance of the DID will be certified by the NDAChain blockchain network through the publishing of a DID registration transaction.

The transaction contains the hash of the DID Document. This transaction must be signed by the private key corresponding to the DID, proving immediate control over the DID identifier. This transaction simultaneously anchors the DID's off-chain pointer to the chain.

Once the registration transaction is confirmed on NDAChain, the DID is considered fully created and globally certified.

Read (Resolve)

A did:ndc is resolved by querying the NDA DID Resolver service. The resolver fetches the DID Document associated with the DID from its off-chain storage (e.g., application cache, dedicated database) and returns it to the client. See Section 6 for resolution details.

Update (Replace)

DID Documents can be updated. The controller of the DID (who holds the associated private key) can authorize changes to the DID Document, such as rotating verification keys, adding new keys, removing or revoking old keys, adding or removing service endpoints, or modifying authentication and assertionMethod relationships. Updates are submitted to the NDA DID Resolver service API and must be cryptographically signed by the controller to prove ownership.

Deactivate (Revoke)

Deactivation is achieved by revoking the DID. The controller updates the DID Document to remove or revoke all verificationMethod and service entries. A deactivated DID cannot be reactivated.

5. Method-Specific Identifiers

The did:ndc method-specific identifier is a blockchain address from the NDA Chain.

6. DID Resolution

Resolution is performed via an HTTP GET request to the NDA DID Resolver service.

Reference Endpoint:

GET https://resolver.ndcdid.vn/1.0/identifiers/{did}

Example Request:

GET https://resolver.ndcdid.vn/1.0/identifiers/did:ndc:0xdfc8044a202f08b9c8df2e42f746355575816828

Response: On success, the service returns a 200 OK with the DID Document (in application/ld+json format) as the response body.

Resolution error examples:

7. DID Document

When a did:ndc is resolved, the resulting DID Document is a JSON-LD object that conforms to the W3C DID Core v1.0 specification.

The document includes multiple contexts:

Verification Methods

The did:ndc method supports the following verification methods:

Example DID Document

{
  "@context": [
    "https://www.w3.org/ns/did/v1",
    "https://w3id.org/security/v1",
    "https://www.w3.org/ns/cid/v1"
  ],
  "id": "did:ndc:0xdfc8044a202f08b9c8df2e42f746355575816828",
  "controller": "did:ndc:0xdfc8044a202f08b9c8df2e42f746355575816828",
  "verificationMethod": [
    {
      "id": "did:ndc:0xdfc8044a202f08b9c8df2e42f746355575816828#keys-1",
      "type": "EcdsaSecp256k1VerificationKey2019",
      "controller": "did:ndc:0xdfc8044a202f08b9c8df2e42f746355575816828",
      "publicKeyHex": "04abf141154b386b0203f7e0e7a1c4e7f805f833b9b3e1f0e8f0c3d8e5f0a2a1a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c"
    },
    {
      "id": "did:ndc:0xdfc8044a202f08b9c8df2e42f746355575816828#keys-2",
      "type": "Multikey",
      "controller": "did:ndc:0xdfc8044a202f08b9c8df2e42f746355575816828",
      "publicKeyMultibase": "zQ3shokFTS3brHcDQrn82RUDfCZESWL1ZdCEJwekUDPQiYBme"
    }
  ],
  "authentication": [
    "did:ndc:0xdfc8044a202f08b9c8df2e42f746355575816828#keys-1"
  ],
  "assertionMethod": [
    "did:ndc:0xdfc8044a202f08b9c8df2e42f746355575816828#keys-1",
    "did:ndc:0xdfc8044a202f08b9c8df2e42f746355575816828#keys-2"
  ]
}

8. Governance

9. Privacy & Security Considerations

Security Considerations

Privacy Considerations

10. Lifecycle

11. W3C Registration

12. Test Vectors

13. References