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

    Class Btc1Update

    Implements 4.3 Update.

    An update to a did:btc1 document is an invoked capability using the ZCAP-LD data format, signed by a verificationMethod that has the authority to make the update as specified in the previous DID document. Capability invocations for updates MUST be authorized using Data Integrity following the bip340-jcs-2025 cryptosuite with a proofPurpose of capabilityInvocation.

    Btc1Update

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Implements 4.3.3 Announce DID Update.

      The Announce DID Update algorithm retrieves beaconServices from the sourceDocument and calls the Broadcast DID Update algorithm corresponding to the type of the Beacon. It takes in a btc1Identifier, sourceDocument, an array of beaconIds, and a didUpdateInvocation. It returns an array of signalsMetadata, containing the necessary data to validate the Beacon Signal against the didUpdateInvocation.

      Parameters

      • params: {
            beaconIds: string[];
            didUpdateInvocation: DidUpdateInvocation;
            sourceDocument: Btc1DidDocument;
        }

        Required params for calling the announcePayload method

        • beaconIds: string[]

          The didUpdatePayload object to be signed

        • didUpdateInvocation: DidUpdateInvocation
        • sourceDocument: Btc1DidDocument

          The did-btc1 did document to derive the root capability from

      Returns Promise<SignalsMetadata>

      The signalsMetadata object containing data to validate the Beacon Signal

      if the beaconService type is invalid

    • Implements 4.3.1 Construct DID Update Payload.

      The Construct DID Update Payload algorithm applies the documentPatch to the sourceDocument and verifies the resulting targetDocument is a conformant DID document. It takes in a btc1Identifier, sourceDocument, sourceVersionId, and documentPatch objects. It returns an unsigned DID Update Payload.

      Parameters

      • params: {
            identifier: string;
            patch: PatchOperation[];
            sourceDocument: Btc1DidDocument;
            sourceVersionId: number;
        }

        See ConstructPayloadParams for more details.

        • identifier: string

          The did-btc1 identifier to derive the root capability from.

        • patch: PatchOperation[]

          The JSON patch to be applied to the source document.

        • sourceDocument: Btc1DidDocument

          The source document to be updated.

        • sourceVersionId: number

          The versionId of the source document.

      Returns Promise<DidUpdatePayload>

      The constructed DidUpdatePayload object.

      InvalidDid if sourceDocument.id does not match identifier.

    • 4.3.2 Invoke DID Update Payload.

      The Invoke DID Update Payload algorithm takes in a btc1Identifier, an unsigned didUpdatePayload, and a verificationMethod. It retrieves the privateKeyBytes for the verificationMethod and adds a capability invocation in the form of a Data Integrity proof following the Authorization Capabilities (ZCAP-LD) and VC Data Integrity specifications. It returns the invoked DID Update Payload.

      Parameters

      • params: {
            didUpdatePayload: DidUpdatePayload;
            identifier: string;
            verificationMethod: Btc1VerificationMethod;
        }

        Required params for calling the invokePayload method

        • didUpdatePayload: DidUpdatePayload

          The updatePayload object to be signed

        • identifier: string

          The did-btc1 identifier to derive the root capability from

        • verificationMethod: Btc1VerificationMethod

          The verificationMethod object to be used for signing

      Returns Promise<DidUpdateInvocation>

      Did update payload secured with a proof => DidUpdateInvocation

      if the privateKeyBytes are invalid