Documentation ¶
Index ¶
Constants ¶
const ( BitcoinNetworkPrefix = "bip122:000000000019d6689c085ae165831e93" EthereumNetworkPrefix = "eip155:1" PolygonNetworkPrefix = "eip155:137" ECDSASECP256k1RecoveryMethod2020 = "EcdsaSecp256k1RecoveryMethod2020" )
const (
// DIDPKHPrefix did:pkh prefix
DIDPKHPrefix = "did:pkh"
)
Variables ¶
This section is empty.
Functions ¶
func GetDIDPKHContext ¶
GetDIDPKHContext returns a context which should be manually inserted into each did:pkh document. This will likely change over time as new verification methods are supported, and general-purpose methods are specified.
func GetDIDPKHNetworkPrefixes ¶
func GetDIDPKHNetworkPrefixes() []string
func GetDIDPKHPrefixForNetwork ¶
GetDIDPKHPrefixForNetwork returns the did:pkh prefix for a given network
func GetVerificationTypeForNetwork ¶
GetVerificationTypeForNetwork returns the verification key type for a given network
func IsValidPKH ¶
IsValidPKH checks if a pkh did is valid based on the following parameters: pkh-did = "did:pkh:" address address = account_id according to [CAIP-10] account_id: chain_id + ":" + account_address chain_id: [-a-z0-9]{3,8}:[-a-zA-Z0-9]{1,32} account_address: [a-zA-Z0-9]{1,64} chain_id: namespace + ":" + reference namespace: [-a-z0-9]{3,8} reference: [-a-zA-Z0-9]{1,32}
Types ¶
type Network ¶
type Network string
func GetDIDPKHNetworkForDID ¶
GetDIDPKHNetworkForDID returns the network for a given did:pkh
func GetDIDPKHNetworkForPrefix ¶
GetDIDPKHNetworkForPrefix returns the did:pkh network for a given prefix
func GetSupportedPKHNetworks ¶
func GetSupportedPKHNetworks() []Network
type PKH ¶
type PKH string
func CreateDIDPKH ¶
CreateDIDPKH constructs a did:pkh from a namespace, reference, and account address. Reference: did:pkh:namespace:reference:account_address
func CreateDIDPKHFromNetwork ¶
CreateDIDPKHFromNetwork constructs a did:pkh from a network and the networks native address.