Requirements

This section outlines the system’s functional and non-functional requirements, defining what the system must achieve and the constraints it must operate within. Update this section when requirements are added, modified, or removed to ensure alignment with stakeholder needs and project goals.

Functional

FR 001: Support Multibase key formats

Description

The SDK should be able to support keys presented in multibase format. Supporting means able to resolve and mange keys in multibase format.

Status

Draft

Acceptance Criteria

  • The SDK should be able to resolve a DID Document with a key in multibase format.

  • The SDK should be able to add a key in multibase format to a DID Document.

  • The SDK should be able to use a key in multibase format to sign a DID Document.

  • The SDK should be able to use a key in multibase format to verify a DID Document signature.

  • The SDK should be able to use a key in multibase format to sign a transaction.

FR 002: Manually Hedera Node Selection

Description

Some of the public nodes are not production ready and may not be available at all times. The SDK should provide an option to manually select the Hedera Node to interact with. Also some clients may want to interact with nodes that are geographically closer to them or have ownership of the nodes.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to manually select the Hedera Node to interact with.

  • This option should be available in the resolver and registration APIs.

FR 003: Transaction And Operation Should Be Able To Be Serialized

Description

Any operation or transaction performed using the SDK should be able to be serialized. Serializing a transaction or operation involves converting it into a format that can be stored or transmitted.

Status

Draft

Acceptance Criteria

  • The SDK should provide a method to serialize a transaction or operation.

  • The SDK should provide a method to deserialize a transaction or operation.

  • The serialized transaction or operation should be ready to be stored or transmitted.

  • The deserialization of a transaction should not lose any information.

  • The deserialized transaction should be the same as the original transaction.

FR 004: Transaction And Operation Should Be Able To Be Frozen

Description

Any operation or transaction performed using the SDK should be able to be frozen. Freezing a transaction or operation involves blocking the possibility of further editing, thus putting it in a state ready to be signed and executed. In this way, we will be able to avoid consistency problems.

Status

Draft

Acceptance Criteria

  • The SDK should provide a method to freeze a transaction or operation.

  • The SDK should provide a method to check if a transaction or operation is frozen.

  • The frozen state of a transaction or operation should be immutable.

  • The frozen state of a transaction or operation should be irreversible.

  • The frozen transaction or operation should be ready to be signed and executed.

FR 005: Transaction And Operation Should Be Able To Sign With External Keys

Description

Any operation or transaction performed using the SDK should be able to be signed with external keys. Signing a transaction or operation with external keys involves using a key pair that is not managed by the SDK. This way, we will be able to sign transactions or operations with keys stored in a hardware wallet or any other external key management system.

Status

Draft

Acceptance Criteria

  • The SDK should give ability to sign a transaction or operation with external keys.

  • The SDK should provide a asynchronous method to sign a transaction or operation.

FR 006: Transaction And Operation Should Be Able To Sign With Private Keys

Description

Any operation or transaction performed using the SDK should be able to be signed with private keys. Signing a transaction or operation with provided private keys. This will help be more compatible with previous SDK version and provide more flexibility to the users.

Status

Draft

Acceptance Criteria

  • The SDK should provide a method to sign a transaction or operation with private keys.

  • User should be able to provide a private key in various formats like hex, base64, etc. preferably in multibase format.

  • The SDK should handle the signing process and return the signed transaction or operation.

FR 007: Support Ed25519VerificationKey2018

Description

The SDK should support an Ed25519VerificationKey2018 verification key type. Support should be provided for resolving the DID Document.

Status

Draft

Acceptance Criteria

  • The SDK should be able to resolve a DID Document with an Ed25519VerificationKey2018 verification key.

FR 008: Support Ed25519VerificationKey2020

Description

The SDK should support an Ed25519VerificationKey2020 verification key type. Support should be provided for resolving, creating, updating, and revoking the verification key from the DID Document.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to add an Ed25519VerificationKey2020 verification key to a DID Document.

  • The SDK should provide an option to revoke an Ed25519VerificationKey2020 verification key from a DID Document.

  • The SDK should be able to resolve a DID Document with an Ed25519VerificationKey2020 verification key.

FR 009: Resolve DID Document

Description

The SDK should provide a method to resolve a DID Document from Hedera Hashgraph Decentralized Identifier (DID) method. Resolver should be fully compatible with the DID specification.

Status

Draft

Acceptance Criteria

  • The SDK should provide a method to resolve a DID Document from Hedera Hashgraph Decentralized Identifier (DID) method.

  • The resolver should be fully compatible with the DID specification.

  • The resolver should be fully compatible with the DID Hedera method specification.

  • The resolver should be able to resolve a DID Document from a DID.

  • The resolver should be able to resolve a DID Document from a DID URL.

  • The resolver interface should be compatible with did-resolver npm package.

  • The resolver should resolve a DID Document in full profile representation, with metadata and options.

FR 010: Resolve DID Document In JSON LD Format

Description

The SDK should provide a way to resolve a DID Document in JSON-LD format. JSON-LD representation of a DID Document is a standard way to represent a DID Document in a machine-readable format. The SDK should add proper JSON-LD context to the resolved DID Document.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to resolve a DID Document in JSON-LD format.

  • The SDK should add proper JSON-LD context to the resolved DID Document.

FR 011: Dereference DID Document Service

Description

The SDK should provide an option to dereference a DID Document service. Dereferencing a service means resolving the service endpoint to a specific URL. The resolved URL should be fully compatible with the DID specification. Dereferencing should be supported by DID URL. Optional user can pass additional parameter relativeRef to resolve the service endpoint with relative reference. Resolved service endpoint should be a valid URL.

Example of a DID URL with relative reference:

did:hedera:testnet:z8brLDSMuByWYqd1A7yUhaiL8T2LKcxeUdihD4GmHdzar_0.0.4388790?service=service-1&relativeRef=/path/to/endpoint

or

did:hedera:testnet:z8brLDSMuByWYqd1A7yUhaiL8T2LKcxeUdihD4GmHdzar_0.0.4388790?service=service-1

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to dereference a DID Document service.

  • The SDK should be compatible with the DID specification.

  • The SDK should support dereferencing a service endpoint with relative reference.

  • The resolved service endpoint should be a valid URL.

FR 012: Resolve DID Document In JSON Format

Description

The SDK should provide a way to resolve a DID Document in JSON format. JSON representation of a DID Document is a standard way to represent a DID Document in a machine-readable format. The SDK should be compatible with the JSON format of the DID Document.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to resolve a DID Document in JSON format.

  • The SDK should be compatible with the JSON format of the DID Document.

FR 013: Resolve DID Document In CBOR Format

Description

The SDK should provide an option to resolve a DID Document in Concise Binary Object Representation (CBOR) format in hexadecimal encoding. The resolved DID Document should be fully compatible with the DID specification.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to resolve a DID Document in CBOR format.

  • The SDK should be compatible with the CBOR format of the DID Document.

FR 014: Dereference DID Document Fragment

Description

The SDK should provide an option to dereference a DID Document fragment. Dereferencing a fragment means resolving the fragment of a DID Document and not just the whole document. Fragment can be a service, verification method or any verification relationship. The resolved fragment should be fully compatible with the DID specification. Dereferencing should be supported by DID URL. Resolved fragment should be a valid service type of verification method type.

Example of a DID URL with fragment:

did:hedera:testnet:z8brLDSMuByWYqd1A7yUhaiL8T2LKcxeUdihD4GmHdzar_0.0.4388790#service-1

or

did:hedera:testnet:z8brLDSMuByWYqd1A7yUhaiL8T2LKcxeUdihD4GmHdzar_0.0.4388790#key-1

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to dereference a DID Document fragment.

  • The SDK should be compatible with the DID specification.

FR 015: Manage Service

Description

The SDK should provide an option to manage the services of a DID Document. Clients should be able to add and revoke services from the DID Document. The SDK should be compatible with the Hedera DID method specification.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to add a service to a DID Document.

  • The SDK should provide an option to revoke a service from a DID Document.

  • The SDK should support following Key Management modes:

    • Internal Secret Mode

    • External Secret Mode

    • Client-managed Secret Mode

FR 016: Register A DID

Description

Register a DID and associated DID document, according to a Hedera DID method specification. Clients should be able to register a DID using provided Private Key or be able to delegate the signing to the external service.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to register a DID.

  • The SDK should be compatible with the Hedera DID method specification.

  • The SDK should provide an option to register a DID using a provided Private Key.

  • The SDK should provide an option to delegate the signing to an external service.

  • The SDK should support following Key Management modes:

    • Internal Secret Mode

    • External Secret Mode

    • Client-managed Secret Mode

FR 017: Batch Update To DID Document

Description

Update the DID Document with multiple operations in a single transaction. Clients should be able to make multiple updates to the DID Document in a single transaction and be able to rollback the transaction if any of the operations fail. The SDK should provide an option to batch update the DID Document in a secure and verifiable manner. Updating the DID Document should be done in a way that is compatible with the Hedera DID method specification.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to batch update the DID Document.

  • The SDK should provide an option to rollback the transaction if any of the operations fail.

  • Updating includes adding and revoking any of the DID Document properties.

  • The SDK should support following Key Management modes:

    • Internal Secret Mode

    • External Secret Mode

    • Client-managed Secret Mode

FR 018: Transfer DID Ownership

Description

Transfer the ownership of a DID from one entity to another. Transfer of ownership should be done in a secure and verifiable manner. Changing the ownership of a DID should be done in a way that is compatible with the Hedera DID method specification.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to transfer the ownership of a DID.

  • The SDK should support following Key Management modes:

    • Internal Secret Mode

    • External Secret Mode

    • Client-managed Secret Mode

FR 019: Deactivate A DID

Description

Deactivate a DID and associated DID document, according to a Hedera DID method specification. Clients should be able to deactivate a DID using provided Private Key or be able to delegate the signing to the external service.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to deactivate a DID.

  • The SDK should support following Key Management modes:

    • Internal Secret Mode

    • External Secret Mode

    • Client-managed Secret Mode

FR 020: Manage Verification Relationships

Description

The SDK should provide an option to manage the verification relationships of a DID Document. Clients should be able to add and revoke verification relationships from the DID Document. Verification relationships are used to establish a trust relationship between a DID and a verification method. Supported verification relationships include authentication, assertionMethod, keyAgreement, capabilityInvocation, and capabilityDelegation. Accepting aliases for these relationships should be presented. The SDK should be compatible with the Hedera DID method specification.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to add a verification relationships to a DID Document.

  • The SDK should provide an option to revoke a verification relationships from a DID Document.

  • The SDK should support following verification relationships:

    • authentication

    • assertionMethod

    • keyAgreement

    • capabilityInvocation

    • capabilityDelegation

  • The SDK should support following Key Management modes:

    • Internal Secret Mode

    • External Secret Mode

    • Client-managed Secret Mode

FR 021: Manage Verification Method

Description

The SDK should provide an option to manage the verification method of a DID Document. Clients should be able to add and revoke verification methods from the DID Document. The SDK should be compatible with the Hedera DID method specification.

Status

Draft

Acceptance Criteria

  • The SDK should provide an option to add a verification method to a DID Document.

  • The SDK should provide an option to revoke a verification method from a DID Document.

  • The SDK should support following Key Management modes:

    • Internal Secret Mode

    • External Secret Mode

    • Client-managed Secret Mode

Non-Functional

NFR 001: Supported Environments

Description

The SDK should work in both Node.js and browser environments. The SDK should be tested in both environments to ensure compatibility. The SDK should work without any issues in both environments.

Status

Draft

Acceptance Criteria

  • The SDK should work inNode.js environments.

  • The SDK should work in browser environments.

  • The SDK should be tested in both environments to ensure compatibility.

References

N/A

NFR 002: Node.js Building Modules

Description

The SDK should support both CommonJS and ES Modules. Therefor correct building of the SDK is required to support both module types. Correct package.json configuration is required to support both module types. The SDK should be tested with both module types to ensure compatibility.

Status

Draft

Acceptance Criteria

  • The SDK should support both CommonJS and ES Modules.

NFR 003: Node.js Version Support

Description

The SDK should support Node.js version 20 and above. Support for older versions of Node.js is not required. The SDK should be tested with all the latest versions of Node.js to ensure compatibility. Support means that the SDK should work without any issues on the supported versions of Node.js. Major issues that prevent the SDK from working on the supported versions of Node.js should be fixed.

Status

Draft

Acceptance Criteria

  • The SDK should support Node.js version 20 and above.

  • The SDK should be tested with all the latest versions of Node.js to ensure compatibility.

  • The SDK should work without any issues on the supported versions of Node.js.

NFR 004: Testing

Description

Testing is an important part of the development process. The SDK should be tested in all the supported environments to ensure compatibility. The SDK should be tested with all the supported versions of Node.js to ensure compatibility. The SDK should be tested with both CommonJS and ES Modules to ensure compatibility. 80% code coverage should be achieved in the testing process. Unit tests and integration tests should be written to test the SDK. Each module of the SDK should be tested to ensure that it works as expected.

Status

Draft

Acceptance Criteria

  • The SDK should be tested in all the supported environments.

  • The SDK should be tested with all the supported versions of Node.js.

  • The SDK should be tested with both CommonJS and ES Modules.

  • 80% code coverage should be achieved in the testing process.

  • Unit tests and integration tests should be written to test the SDK.

References

N/A