Description:
This Pull Request introduces new features to the EthrDID class, enhancing its capabilities for creating Decentralized Identifiers (DIDs) for Ethereum-based identities (ref: https://github.com/uport-project/ethr-did). The changes include the addition of three new factory methods that allow the creation of EthrDID instances using different inputs:
fromPublicKeyEncoded: This factory method allows the creation of an EthrDID instance from an encoded public key. It takes an EthPrivateKey object and a chainNameOrId as input. The method constructs the DID by combining the chain name or ID with the hexadecimal representation of the provided encoded public key.
fromEthereumAddress: With this factory method, an EthrDID instance can be created directly from an Ethereum address. It takes an EthereumAddress object and a chainNameOrId as input. The method constructs the DID using the chain name or ID and the EIP-55 encoded representation of the Ethereum address.
fromIdentifier: This factory method offers flexibility by allowing the creation of an EthrDID instance from a custom identifier. It takes a String identifier and a chainNameOrId as input. The method constructs the DID using the provided identifier along with the chain name or ID. Examples of identifiers include Ethereum addresses, public keys, or even a full did:ethr representing Identity.
The new constructors provide more options for developers to create EthrDID instances based on their specific requirements, making the class more versatile and adaptable to different use cases.
Thank you for considering this Pull Request. I have tested the changes thoroughly to ensure their correctness and compatibility with existing code. Please review the changes, and I am open to any feedback or suggestions to improve the implementation further.
Let me know if you have any questions or need additional information.
Description: This Pull Request introduces new features to the
EthrDID
class, enhancing its capabilities for creating Decentralized Identifiers (DIDs) for Ethereum-based identities (ref: https://github.com/uport-project/ethr-did). The changes include the addition of three new factory methods that allow the creation ofEthrDID
instances using different inputs:fromPublicKeyEncoded
: This factory method allows the creation of anEthrDID
instance from an encoded public key. It takes anEthPrivateKey
object and achainNameOrId
as input. The method constructs the DID by combining the chain name or ID with the hexadecimal representation of the provided encoded public key.fromEthereumAddress
: With this factory method, anEthrDID
instance can be created directly from an Ethereum address. It takes anEthereumAddress
object and achainNameOrId
as input. The method constructs the DID using the chain name or ID and the EIP-55 encoded representation of the Ethereum address.fromIdentifier
: This factory method offers flexibility by allowing the creation of anEthrDID
instance from a custom identifier. It takes aString
identifier and achainNameOrId
as input. The method constructs the DID using the provided identifier along with the chain name or ID. Examples of identifiers include Ethereum addresses, public keys, or even a fulldid:ethr
representing Identity.The new constructors provide more options for developers to create
EthrDID
instances based on their specific requirements, making the class more versatile and adaptable to different use cases.Thank you for considering this Pull Request. I have tested the changes thoroughly to ensure their correctness and compatibility with existing code. Please review the changes, and I am open to any feedback or suggestions to improve the implementation further.
Let me know if you have any questions or need additional information.