@did-btc1/method
    Preparing search index...

    Class Btc1Appendix

    Implements 9. Appendix methods.

    Btc1Appendix

    Index

    Constructors

    Methods

    • Implements 9.4.2 Dereference Root Capability Identifier.

      This algorithm takes in capabilityId, a root capability identifier, and dereferences it to rootCapability, the root capability object.

      Parameters

      • capabilityId: string

        The root capability identifier to dereference.

      Returns Btc1RootCapability

      The root capability object.

      for did:btc1:k1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u SHOULD be mutated.

      {
      "@context": [
      "https://w3id.org/zcap/v1",
      "https://w3id.org/security/data-integrity/v2",
      "https://w3id.org/json-ld-patch/v1"
      ],
      "patch": [
      {
      "op": "add",
      "path": "/service/4",
      "value": {
      "id": "#linked-domain",
      "type": "LinkedDomains",
      "serviceEndpoint": "https://contact-me.com"
      }
      }
      ],
      "proof": {
      "type": "DataIntegrityProof",
      "cryptosuite": "schnorr-secp256k1-jcs-2025",
      "verificationMethod": "did:btc1:k1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u#initialKey",
      "invocationTarget": "did:btc1:k1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u",
      "capability": "urn:zcap:root:did%3Abtc1%3Ak1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u",
      "capabilityAction": "Write",
      "proofPurpose": "assertionMethod",
      "proofValue": "z381yXYmxU8NudZ4HXY56DfMN6zfD8syvWcRXzT9xD9uYoQToo8QsXD7ahM3gXTzuay5WJbqTswt2BKaGWYn2hHhVFKJLXaDz"
      }
    • Implements 9.4.1 Derive Root Capability from did:btc1 Identifier.

      The Derive Root Capability algorithm deterministically generates a ZCAP-LD root capability from a given did:btc1 identifier. Each root capability is unique to the identifier. This root capability is defined and understood by the did:btc1 specification as the root capability to authorize updates to the specific did:btc1 identifiers DID document. It takes in a did:btc1 identifier and returns a rootCapability object. It returns the root capability.

      Parameters

      • identifier: string

        The did-btc1 identifier to derive the root capability from

      Returns Btc1RootCapability

      The root capability object

      did:btc1:k1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u

      {
      "@context": "https://w3id.org/zcap/v1",
      "id": "urn:zcap:root:did:btc1:k1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u",
      "controller": "did:btc1:k1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u",
      "invocationTarget": "did:btc1:k1q0rnnwf657vuu8trztlczvlmphjgc6q598h79cm6sp7c4fgqh0fkc0vzd9u"
      }
    • Extracts a DID fragment from a given input

      Parameters

      • input: unknown

        The input to extract the DID fragment from

      Returns undefined | string

      The extracted DID fragment or undefined if not found

    • Implements 9.3. Fetch Content from Addressable Storage.

      The Fetch Content from Addressable Storage function takes in SHA256 hash of some content, hashBytes, converts these bytes to a IPFS v1 Content Identifier and attempts to retrieve the identified content from Content Addressable Storage (CAS). It returns the retrieved content or null.

      Parameters

      • hashBytes: Bytes

        The SHA256 hash of the content to be fetched.

      Returns Promise<undefined | string>

      The fetched content or null if not found.

    • Validates that the given object is a DidService

      Parameters

      • obj: unknown

        The object to validate

      Returns obj is DidService

      A boolean indicating whether the object is a DidService

    • Validates that the given object is a DidVerificationMethod

      Parameters

      • obj: unknown

        The object to validate

      Returns obj is DidVerificationMethod

      A boolean indicating whether the object is a DidVerificationMethod