import * as u8a from 'uint8arrays' ; /**
 * Constructs the document based on the method key
 */ export function keyToDidDoc ( pubKeyBytes , fingerprint ) { const did = `did:key:${ fingerprint }` ; const keyId = `${ did }#${ fingerprint }` ; return { id : did , verificationMethod : [ { id : keyId , type : 'Secp256k1VerificationKey2018' , controller : did , publicKeyBase58 : u8a . toString ( pubKeyBytes , 'base58btc' ) , } , ] , authentication : [ keyId ] , assertionMethod : [ keyId ] , capabilityDelegation : [ keyId ] , capabilityInvocation : [ keyId ] , } ; }