Class: Update ​
Defined in: packages/method/src/core/update.ts:32
Implements 7.3 Update.
An update to a did:btcr2 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.
Update
Constructors ​
Constructor ​
new Update():
Update
Returns ​
Update
Methods ​
announce() ​
staticannounce(beaconService,update,secretKey,bitcoin):Promise<SignedBTCR2Update>
Defined in: packages/method/src/core/update.ts:139
Implements subsection 7.3.d Announce DID Update. BTCR2 Signed Updates are announced to the Bitcoin blockchain depending on the Beacon Type.
Parameters ​
beaconService ​
The BeaconService object representing the funded beacon to announce the update to.
update ​
The signed update object to be announced.
secretKey ​
The private key used to sign the update for announcement.
bitcoin ​
Returns ​
Promise<SignedBTCR2Update>
The SignedBTCR2Update object containing data to validate the Beacon Signal
Throws ​
if the beaconService type is invalid
construct() ​
staticconstruct(sourceDocument,patches,sourceVersionId):UnsignedBTCR2Update
Defined in: packages/method/src/core/update.ts:43
Implements subsection 7.3.b Construct BTCR2 Unsigned Update. This process constructs a BTCR2 Unsigned Update conformant to the spec template.
Parameters ​
sourceDocument ​
The source DID document to be updated.
patches ​
The array of JSON Patch operations to apply to the sourceDocument.
sourceVersionId ​
number
The version ID of the source document.
Returns ​
The constructed UnsignedBTCR2Update object.
Throws ​
InvalidDid if sourceDocument.id does not match identifier.
sign() ​
staticsign(did,unsignedUpdate,verificationMethod,secretKey):SignedBTCR2Update
Defined in: packages/method/src/core/update.ts:93
Implements subsection 7.3.c Construct BTCR2 Signed Update. This process constructs a BTCR2 Signed Update from a BTCR2 Unsigned Update.
Parameters ​
did ​
string
The did-btcr2 identifier to derive the root capability from
unsignedUpdate ​
The updatePayload object to be signed
verificationMethod ​
The verificationMethod object to be used for signing
secretKey ​
Returns ​
Did update payload secured with a proof => SignedBTCR2Update
Throws ​
if the privateKeyBytes are invalid