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

    Class SingletonBeacon

    Implements 5.1 Singleton Beacon.

    A Singleton Beacon enables a single entity to independently post a DID Update Payload in a Beacon Signal. Its is a Beacon that can be used to publish a single DID Update Payload targeting a single DID document. The serviceEndpoint for this Beacon Type is a Bitcoin address represented as a URI following the BIP21 scheme. It is recommended that this Bitcoin address be under the sole control of the DID controller. How the Bitcoin address and the cryptographic material that controls it are generated is left to the implementation.

    SingletonBeacon

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    id: string

    A unique identifier for the Beacon

    serviceEndpoint: DidServiceEndpoint

    The service endpoint of the Beacon

    type: string

    The type of the Beacon

    Accessors

    Methods

    • Implements 5.1.2 Broadcast Singleton Beacon Signal.

      The Broadcast Singleton Beacon Signal algorithm is called by the Announce DID Update algorithm as part of the Update operation, if the Beacon being used is of the type SingletonBeacon. It takes as input a Beacon service and a secured didUpdatePayload. The algorithm constructs a Bitcoin transaction that spends from the Beacon address identified in the service and contains a transaction output of the format [OP_RETURN, OP_PUSH32, ], where hashBytes is the SHA256 hash of the canonical didUpdatePayload. The Bitcoin transaction is then signed and broadcast to the Bitcoin network, thereby publicly announcing a DID update in a Beacon Signal. It returns a signalMetadata object mapping the Bitcoin transaction identifier of the Beacon Signal to the necessary data needed to verify the signal announces a specific DID Update Payload.

      Parameters

      • didUpdatePayload: DidUpdatePayload

        The verificationMethod object to be used for signing.

      Returns Promise<SignalsMetadata>

      Successful output of a bitcoin transaction.

      if the bitcoin address is invalid or unfunded.

    • TODO: Finish implementation per spec

      Implements 5.1.3 Process Singleton Beacon Signal. See Abstract Beacon Interface Method processSignal for more details.

      The Process Singleton Beacon Signal algorithm is called by the Process Beacon Signals algorithm as part of the Read operation. It takes a Bitcoin transaction representing a Beacon Signal and optional signalSidecarData containing any sidecar data provided to the resolver for the Beacon Signal identified by the Bitcoin transaction identifier. It returns the DID Update payload announced by the Beacon Signal or throws an error.

      Parameters

      Returns Promise<undefined | DidUpdatePayload>

      The DID Update payload announced by the Beacon Signal.

      if the signalTx is invalid or the signalSidecarData is invalid.

    • Implements 5.1.1 Establish Singleton Beacon.

      Static, convenience method for establishing a Beacon object.

      A Singleton Beacon is a Beacon that can be used to publish a single DID Update Payload targeting a single DID document. The serviceEndpoint for this Beacon Type is a Bitcoin address represented as a URI following the BIP21 scheme. It is RECOMMENDED that this Bitcoin address be under the sole control of the DID controller. How the Bitcoin address and the cryptographic material that controls it are generated is left to the implementation. The Establish Singleton Beacon algorithm takes in a Bitcoin address and a serviceId and returns a Singleton Beacon service. It returns a SignletonBeacon object with the given id, type, and serviceEndpoint.

      Parameters

      Returns SingletonBeacon

      The Singleton Beacon.