@ew-did-registry/did-resolver-interface
TypeScript icon, indicating that this package has built-in type declarations

0.9.0 • Public • Published

DID Resolver Interface

EW-DID library has a design goal to support different DID methods. did-document allows management of keys, authorisation, delegation and service endpoints in standardised way. In the practical scenario, the CRUD behaviour of the did-document needs to be specific to the DID method's underlying implementation. EW-DID aims to handle this through the DID method specific resolver implementation.

did-resolver-interface defines the contract required for CRUD behaviour of the did-document. did-ethr-resolver provides a reference implementation of ERC 1056 standard.

Class Diagram

Pseudo example of implementation

// MyResolver - Implement the read only behaviour for your DID Method
class Resolver implements IResolver{
        
    read(){
    // return the whole DID Document
    }
    
    readAttribute(){
    // read an attribute as per did method requirement 
    }
    
    validDelegate(){
    //validate a delegate as per did method requirement
    }

}

// MyResolver - Implement the update and revoke behaviour for your DID Method
class Operator extends Resolver implements IOperator {

    create(){
    //create specific to did method
    }

    update(){
    //update specific to did method
    }

    deactivate(){
    //deactivate specific to did method
    }

    revokeDelegate(){
    //revokeDelegate specific to did method
    }
    
    revokeAttribute(){
    //revoke attribute specific to did method
    }

}

/@ew-did-registry/did-resolver-interface/

    Package Sidebar

    Install

    npm i @ew-did-registry/did-resolver-interface

    Weekly Downloads

    455

    Version

    0.9.0

    License

    ISC

    Unpacked Size

    69.9 kB

    Total Files

    17

    Last publish

    Collaborators

    • energywebdev