.. and press ENTER to ask a question on web5, how to write code and more.

Skip to main content


Before beginning development of your PFI’s code, you’ll need to create an identity to use on the network. A tbDEX network is built to be decentralized, which is why you’ll need to create your own Decentralized Identifier (DID) to assign to the PFI. That DID will represent the PFI, as well as serve as the signer for tbDEX messages and resources that are sent to other parties.

DIDs are associated with DID Documents which describe how to engage with your PFI.

To create a DID and identify yourself as a PFI, use the web5/dids package:

Import Classes


Create DID with Service Endpoint

For a DID to be recognized as a PFI, it is important to include a service endpoint in the DID document. The value for serviceEndpoint should be the URL to your PFI's service entry.

If you also have an existing key management system to secure your secrets e.g AWS KMS, Google Cloud KMS etc, creating a DID provides a keyManager interface that you can pass it through.

  • LocalKeyManager or InMemoryKeyManager should only be used in non-production environments. See Key Management Service for more details.

Connect with us on Discord

Submit feedback: Open a GitHub issue

Edit this page: GitHub Repo

Contribute: Contributing Guide