@web3-storage/ucanto-name-system
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

ucanto-name-service

A networked service that maintains a mapping of DIDs to CIDs.

Controllers of a DID can invoke the name/publish capability to change the CID corresponding to their DID.

Controllers can also delegate the name/publish capability using UCANs so that other people can publish on their behalf.

Anyone can resolve the CID for a DID using the name/resolve capability.

Interface

interface Publish {
  can: "name/publish"
  with: DID
  content: Link<any>
  origin: null|Link<Publish>
}

interface Resolve {
  can: "name/resolve",
  with: DID
}

interface NameService {
  publish(request: Invocation<Publish>): Promise<
    Result<
      Link<Publish>>,
      PermissionError | OriginError
    >
  >
  resolve(request: Invocation<Resolve>): Promise<
    Result<
      Publish,
      PermissionError | NotFoundError
    >
  >
}

Readme

Keywords

none

Package Sidebar

Install

npm i @web3-storage/ucanto-name-system

Weekly Downloads

1

Version

1.4.0

License

ISC

Unpacked Size

8.94 kB

Total Files

3

Last publish

Collaborators

  • it-dag-house
  • gozala
  • olizilla
  • vascosantos
  • alanshaw