Skip to content

Instantly share code, notes, and snippets.

@bshambaugh
Created February 25, 2021 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bshambaugh/424715adc61c0928d5366e741d7da652 to your computer and use it in GitHub Desktop.
Save bshambaugh/424715adc61c0928d5366e741d7da652 to your computer and use it in GitHub Desktop.
const multibase = require('multibase')
const toString = require('uint8arrays/to-string')
const didKeyBase58btc = 'zQ3shokFTS3brHcDQrn82RUDfCZESWL1ZdCEJwekUDPQiYBme'
const didKey = multibase.decode(didKeyBase58btc)
console.log('did key from spec decoded an as hex: '+toString(didKey,'base16'))
@bshambaugh
Copy link
Author

zQ3shokFTS3brHcDQrn82RUDfCZESWL1ZdCEJwekUDPQiYBme to
e70103874c15c7fda20e539c6e5ba573c139884c351188799f5458b4b41f7924f235cd

from https://w3c-ccg.github.io/did-method-key/#secp256k1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment