Skip to content
View nichoth's full-sized avatar

Organizations

@ssc-half-light

Block or report nichoth

Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
nichoth/README.md

nichoth.com

https://nichoth.com/


nichoth's GitHub stats

Bluesky DID: did:plc:s53e6k6sirobjtz5s6vdddwr

templates

Links to various templates

notes

Links and notes

plus, a list

build

npm run build

start a local dev server

npm start

Notes

DID

See did.json.

The key format is Multikey, a generic, self-describing, multicodec-based public key encoding.

// ...
"verificationMethod": [
    {
        "id": "did:web:nichoth.com#main-key",
        "type": "Multikey",  // < -- this
        "controller": "did:web:nichoth.com",
        "publicKeyMultibase": "z6Mkmy1ak2zS6hPohyNnPwMUDqpC3WE8wTR3Fcz5esUoCFNH"
    }
],
// ...

To encode something as a multikey:

import { bases } from "multiformats/bases/base58"
import * as multicodec from "multicodec"

// Suppose you have a raw public-key Buffer/Uint8Array
const rawKeyBytes = /* ... */

// Add the proper multicodec prefix for, say, ed25519-pub (via multicodec)
const prefixed = multicodec.addPrefix('ed25519-pub', rawKeyBytes)

// Then multibase-encode it (e.g. base58btc)
const mb = bases.base58.encoder.encode(prefixed)

// This yields something like "z6Mk...", same style as in the DID doc
console.log(mb)

Popular repositories Loading

  1. ssb-field-guide ssb-field-guide Public

    A field guide for developing with secure-scuttlebutt

    37

  2. pull-stream-spec pull-stream-spec Public

    Tests for pull streams

    JavaScript 9 2

  3. preact-pull-stream preact-pull-stream Public

    Create a duplex stream from a preact component

    JavaScript 9

  4. pull-catch pull-catch Public

    Catch errors in a pull stream

    JavaScript 7

  5. pull-combine-latest pull-combine-latest Public

    Combine the latest values from many pull streams

    JavaScript 6 1

  6. continuable-fp continuable-fp Public

    Rewriting continuable operators, but with the arguments flipped

    JavaScript 6 4